2.1 — Conditional Probability and Dependent Events
2.1 — Conditional Probability and Dependent Events#
In Chapter 1, we learned about independence and dependence, and we briefly introduced conditional probability. Now we’ll explore conditional probability in depth—one of the most important concepts in probability theory and quantitative finance. Conditional probability allows us to update our beliefs about events when we receive new information. This lesson introduces conditional probability formally and explores its relationship with dependent events.
What is Conditional Probability?#
Conditional probability is the probability of an event occurring given that another event has already occurred. Learn more: Conditional Probability
Mathematical Definition:
The conditional probability of event given event is:
provided that .
Notation: is read as “the probability of given ” or “the probability of conditional on .”
Intuitive Meaning: We restrict our attention to outcomes where has occurred, and ask what fraction of those outcomes also have occurring.
Understanding the Formula#
The formula can be understood as:
- Numerator (): The probability that both and occur
- Denominator (): The probability that occurs (our “new sample space”)
- Result: The fraction of outcomes that also have
Visual Intuition#
If we think of probability as area:
- is the area of event
- is the area where both and occur
- is the fraction of ‘s area that overlaps with
Basic Examples#
Example 1: Drawing Cards#
A standard deck has 52 cards. We draw one card:
- = “Card is a heart”:
- = “Card is a face card (J, Q, K)”:
- = “Card is a heart AND a face card”:
Question: What is the probability of drawing a face card given that we’ve drawn a heart?
Interpretation: Among the 13 hearts, 3 are face cards, so the conditional probability is .
Example 2: Stock Price Movement#
Consider a stock that can move up, down, or stay unchanged:
- = “Market is bullish”:
- = “Stock goes up”:
- = “Market is bullish AND stock goes up”:
Question: What is the probability the stock goes up given a bullish market?
Interpretation: In bullish markets, the stock goes up 75% of the time.
Example 3: Portfolio Returns#
A portfolio has three possible outcomes:
-
High return: probability 0.3
-
Medium return: probability 0.5
-
Low return: probability 0.2
-
= “Return is at least medium”:
-
= “Return is high”:
-
= “Return is high” (since high is included in “at least medium”):
Question: What is the probability of a high return given that the return is at least medium?
Interpretation: Among outcomes with at least medium returns, 37.5% are high returns.
Rearranging the Formula#
The conditional probability formula can be rearranged to calculate joint probabilities:
This is called the multiplication rule or chain rule for probabilities.
Key Insight: The probability that both and occur equals the probability of times the probability of given .
Example: Sequential Events#
Drawing two cards without replacement:
- = “First card is an ace”:
- = “Second card is an ace”: (given first was ace)
Conditional Probability and Independence#
Recall from Chapter 1 (lesson 1.3) that events and are independent if:
Using conditional probability, we can express independence as:
Interpretation: If and are independent, knowing that occurred doesn’t change the probability of .
Example: Independent Events#
Two fair coin tosses:
- = “First coin is heads”:
- = “Second coin is heads”:
Since , the events are independent.
Example: Dependent Events#
Drawing cards without replacement:
- = “First card is an ace”:
- = “Second card is an ace”: (unconditional)
Since , the events are dependent.
Conditional Probability with Multiple Events#
We can condition on multiple events:
provided that .
Chain Rule (General Form)#
For multiple events, the chain rule extends:
Example: Drawing Three Cards#
Drawing three cards without replacement:
- = “First card is an ace”:
- = “Second card is an ace”:
- = “Third card is an ace”:
Financial Applications#
Risk Assessment#
Example: Credit risk analysis
- = “Economic recession”:
- = “Company defaults”: (unconditional)
- (conditional on recession)
Interpretation: The default probability increases from 2% to 15% during a recession.
Portfolio Management#
Example: Sector performance
- = “Technology sector outperforms”:
- = “Portfolio return > 10%”:
Interpretation: When tech outperforms, the portfolio has a 60% chance of returning more than 10%.
Trading Strategies#
Example: Signal-based trading
- = “Technical indicator signals buy”:
- = “Stock price increases next day”:
Interpretation: When the indicator signals buy, the stock goes up 70% of the time (better than the unconditional 50%).
Python Implementation#
def conditional_probability(p_intersection, p_given):
"""
Calculate conditional probability P(B | A) = P(A ∩ B) / P(A)
Parameters:
p_intersection: P(A ∩ B)
p_given: P(A)
Returns:
P(B | A) or None if P(A) = 0
"""
if p_given == 0:
return None # Cannot condition on impossible event
return p_intersection / p_given
def joint_probability(p_a, p_b_given_a):
"""
Calculate joint probability P(A ∩ B) = P(A) * P(B | A)
Parameters:
p_a: P(A)
p_b_given_a: P(B | A)
Returns:
P(A ∩ B)
"""
return p_a * p_b_given_a
def chain_rule(probabilities):
"""
Calculate P(A1 ∩ A2 ∩ ... ∩ An) using chain rule
Parameters:
probabilities: List of [P(A1), P(A2|A1), P(A3|A1∩A2), ...]
Returns:
Joint probability
"""
result = 1.0
for p in probabilities:
result *= p
return result
# Example 1: Card drawing
p_first_ace = 4/52
p_second_ace_given_first = 3/51
p_both_aces = joint_probability(p_first_ace, p_second_ace_given_first)
print(f"P(both aces) = {p_both_aces:.6f}")
# Example 2: Stock movement
p_bullish = 0.6
p_stock_up_given_bullish = 0.75
p_bullish_and_up = joint_probability(p_bullish, p_stock_up_given_bullish)
print(f"P(bullish and stock up) = {p_bullish_and_up:.2f}")
# Example 3: Three cards
p_three_aces = chain_rule([4/52, 3/51, 2/50])
print(f"P(three aces) = {p_three_aces:.6f}")
# Example 4: Conditional probability from joint
p_intersection = 0.45
p_given = 0.6
p_conditional = conditional_probability(p_intersection, p_given)
print(f"P(B | A) = {p_conditional:.2f}")
Common Mistakes#
-
Reversing the condition
- Wrong: when you need
- Fix: Carefully identify which event is given (the condition)
-
Dividing by zero
- Wrong: Calculating when
- Fix: Check that before calculating
-
Confusing conditional and unconditional probabilities
- Wrong: Using when you need
- Fix: Always check what information is given
-
Assuming independence
- Wrong: Assuming without verification
- Fix: Calculate both and compare
Key Takeaways#
- Conditional Probability: (provided )
- Multiplication Rule:
- Independence: if and only if and are independent
- Chain Rule: Extends to multiple events:
- Financial Context: Conditional probabilities are essential for risk assessment and decision-making
Next Steps#
In the next lesson, we’ll explore more applications of conditional probability, including how to calculate probabilities of outcomes when multiple conditions are involved, and how conditional probability helps us understand complex dependent systems in quantitative finance.