Lesson 3: Conditional Probability & Independence
Module 3: Probability Basics • Lesson 3 of 4 • ~30-35 minutes
Learning Objectives
By the end of this lesson, you will be able to:
- Calculate conditional probabilities P(A|B)
- Use two-way tables to organize and calculate probabilities
- Apply the multiplication rule for probability
- Determine if two events are independent
- Distinguish between independent and dependent events
What is Conditional Probability?
Often, probabilities change when we have additional information. Conditional probability measures the likelihood of an event given that another event has occurred.
Real-World Example:
Scenario: What's the probability a student passes a statistics exam?
- Without information: P(pass) might be 0.75
- Given they studied 10+ hours: P(pass | studied) might be 0.92
- Given they didn't study: P(pass | didn't study) might be 0.40
The additional information (whether they studied) changes the probability!
Conditional Probability
The conditional probability of A given B, written as P(A|B), is the probability that event A occurs given that event B has already occurred.
Read as: "The probability of A given B"
Conditional Probability Formula
P(A|B) = P(A and B) / P(B)
Where: P(B) > 0 (B must be possible)
Understanding the Formula
P(A|B) = "What fraction of times B occurs does A also occur?"
We're restricting our sample space to only outcomes where B happens, then seeing how often A happens within that restricted space.
Calculating Conditional Probability
Example 1: Drawing Cards
Question: You draw one card from a standard deck. Given that the card is red, what is the probability it's a heart?
Solution:
- Let A = "card is a heart"
- Let B = "card is red"
- We want P(A|B) = P(heart | red)
- There are 26 red cards total (13 hearts + 13 diamonds)
- Of these 26 red cards, 13 are hearts
- P(heart | red) = 13/26 = 1/2
Alternative approach using formula:
- P(heart and red) = P(heart) = 13/52 = 1/4 (all hearts are red)
- P(red) = 26/52 = 1/2
- P(heart | red) = (1/4) / (1/2) = 1/2
Example 2: Rolling Dice
Question: You roll a fair die. Given that you rolled an even number, what's the probability you rolled a number greater than 3?
Solution:
- Let A = "number > 3" = {4, 5, 6}
- Let B = "even number" = {2, 4, 6}
- A and B = {4, 6} (even numbers greater than 3)
- Given B occurred, our restricted sample space is {2, 4, 6}
- Of these 3 outcomes, 2 satisfy A (the 4 and 6)
- P(A|B) = 2/3
Using formula:
- P(A and B) = 2/6 = 1/3
- P(B) = 3/6 = 1/2
- P(A|B) = (1/3) / (1/2) = 2/3
Two-Way Tables
Two-way tables (also called contingency tables) organize data for two categorical variables. They're excellent for calculating conditional probabilities!
Example 3: Student Survey
A survey of 200 students asked about their year (Freshman/Sophomore) and whether they have a job.
| Has Job | No Job | Total | |
|---|---|---|---|
| Freshman | 30 | 70 | 100 |
| Sophomore | 60 | 40 | 100 |
| Total | 90 | 110 | 200 |
Question 1: What is P(has job)?
Solution: P(has job) = 90/200 = 0.45 or 45%
Question 2: What is P(has job | Freshman)?
Solution:
- Given: Student is a Freshman (restrict to that row)
- Total Freshmen: 100
- Freshmen with jobs: 30
- P(has job | Freshman) = 30/100 = 0.30 or 30%
Question 3: What is P(has job | Sophomore)?
Solution:
- Given: Student is a Sophomore (restrict to that row)
- Total Sophomores: 100
- Sophomores with jobs: 60
- P(has job | Sophomore) = 60/100 = 0.60 or 60%
Observation: Sophomores are twice as likely to have a job as Freshmen! (60% vs 30%)
Using Two-Way Tables for Conditional Probability
To find P(A|B):
- Restrict to the row or column representing B (the "given" event)
- Find how many of those satisfy A
- Divide: (outcomes with A and B) / (total outcomes with B)
The Multiplication Rule
Sometimes we need to find P(A and B). The multiplication rule connects this to conditional probability.
Multiplication Rule (General)
P(A and B) = P(A) × P(B|A)
OR
P(A and B) = P(B) × P(A|B)
Both forms are equivalent - use whichever is easier to calculate!
Example 4: Drawing Without Replacement
Question: You draw 2 cards from a deck without replacement. What's the probability both are aces?
Solution:
- Let A₁ = "first card is an ace"
- Let A₂ = "second card is an ace"
- We want P(A₁ and A₂)
- P(A₁) = 4/52 (4 aces in 52 cards)
- P(A₂|A₁) = 3/51 (after drawing one ace, 3 aces left in 51 cards)
- P(A₁ and A₂) = (4/52) × (3/51) = 12/2652 = 1/221 ≈ 0.0045 or 0.45%
Notice: The second probability depends on what happened first (without replacement = dependent events)
Example 5: Multiple Events
Question: A box contains 5 red and 3 blue marbles. You draw 3 marbles without replacement. What's the probability all 3 are red?
Solution:
- P(R₁) = 5/8 (first is red)
- P(R₂|R₁) = 4/7 (second is red, given first was red)
- P(R₃|R₁ and R₂) = 3/6 = 1/2 (third is red, given first two were red)
- P(all 3 red) = (5/8) × (4/7) × (1/2) = 20/112 = 5/28 ≈ 0.179 or 17.9%
Independent Events
Independent Events
Two events A and B are independent if the occurrence of one does NOT affect the probability of the other.
In other words: A and B are independent if P(A|B) = P(A)
Equivalently: P(B|A) = P(B)
Independent vs. Dependent
| Independent Events | Dependent Events |
|---|---|
| One event doesn't affect the other | One event affects the probability of the other |
| P(A|B) = P(A) | P(A|B) ≠ P(A) |
| Examples: Flipping two coins, rolling two dice, drawing with replacement | Examples: Drawing without replacement, weather on consecutive days |
Multiplication Rule for Independent Events
If A and B are independent:
P(A and B) = P(A) × P(B)
No conditional probability needed - just multiply!
Example 6: Flipping Coins (Independent)
Question: You flip a fair coin twice. What's the probability of getting heads both times?
Solution:
The flips are independent (first flip doesn't affect second)
- P(H₁) = 1/2
- P(H₂) = 1/2
- P(H₁ and H₂) = (1/2) × (1/2) = 1/4 or 0.25
Example 7: Testing Independence with Data
Using our student survey from earlier:
| Has Job | No Job | Total | |
|---|---|---|---|
| Freshman | 30 | 70 | 100 |
| Sophomore | 60 | 40 | 100 |
| Total | 90 | 110 | 200 |
Question: Are "Year" and "Has Job" independent?
Solution:
Check if P(has job | Freshman) = P(has job)
- P(has job) = 90/200 = 0.45
- P(has job | Freshman) = 30/100 = 0.30
- 0.30 ≠ 0.45, so events are NOT independent
Conclusion: Year in school and having a job are dependent - being a sophomore makes you more likely to have a job!
Check Your Understanding
Practice Question 1
You roll a die. Given that you rolled a number less than 5, what's the probability you rolled a 2?
Solution:
Given: Rolled less than 5, so outcomes are {1, 2, 3, 4}
Of these 4 outcomes, one is a 2
P(2 | less than 5) = 1/4 = 0.25 or 25%
Practice Question 2
If P(A) = 0.6 and P(B|A) = 0.4, what is P(A and B)?
Solution:
Use multiplication rule: P(A and B) = P(A) × P(B|A)
P(A and B) = 0.6 × 0.4 = 0.24
Practice Question 3
Are flipping a coin and rolling a die independent events? Why or why not?
Answer: YES, they are independent
Reasoning:
The outcome of the coin flip has no effect on the die roll, and vice versa. They are completely separate physical events with no connection.
P(any die outcome | any coin outcome) = P(any die outcome)
Practice Question 4
You draw 2 cards from a deck WITH replacement. What's the probability both are kings?
Solution:
With replacement means the draws are independent
- P(K₁) = 4/52 = 1/13
- P(K₂) = 4/52 = 1/13 (card is replaced, so same probability)
- P(K₁ and K₂) = (1/13) × (1/13) = 1/169 ≈ 0.0059 or 0.59%
Practice Question 5
In a class, 60% of students are female. Among females, 80% passed the exam. Among males, 70% passed. What is P(passed | female)?
Answer: 0.80 or 80%
Explanation:
This is directly stated: "Among females, 80% passed the exam"
P(passed | female) = 0.80
Key Takeaways
- Conditional probability P(A|B): Probability of A given that B occurred
- Formula: P(A|B) = P(A and B) / P(B)
- Two-way tables: Excellent tool for organizing and calculating conditional probabilities
- Multiplication rule: P(A and B) = P(A) × P(B|A) = P(B) × P(A|B)
- Independent events: P(A|B) = P(A), meaning B doesn't affect A
- For independent events: P(A and B) = P(A) × P(B) (simplified!)
- Without replacement → dependent; with replacement → independent
What's Next?
You now understand how probabilities change with information! In Lesson 4: Probability Distributions, you'll learn how to organize all possible outcomes and their probabilities into a distribution, and calculate expected values.
Coming up: Random variables, probability distributions, expected value (mean), variance