Conditional Probability and Independence
Learn to calculate probabilities when conditions are known. Understand independent vs dependent events and master conditional probability.
On This Page
What is Conditional Probability?
Conditional probability answers the question: “What’s the probability of A, given that B has occurred?”
Read as: “Probability of A given B”
Where:
- = probability of A given B occurred
- = probability of both A and B
- = probability of B (must be greater than 0)
Draw one card from a standard deck.
A = card is a Queen B = card is a face card (J, Q, K)
What’s P(Queen | Face card)?
Without condition: P(Queen) = 4/52 = 1/13
With condition: Given it’s a face card (12 cards), what’s P(Queen)?
Or directly: 4 queens among 12 face cards = 1/3
Multiplication Rule
Rearranging the conditional probability formula gives us the multiplication rule:
Or equivalently:
A bag has 5 red and 3 blue marbles. Draw 2 without replacement.
P(both red)?
A = first marble is red B = second marble is red
(5 red out of 8 total) (after removing one red: 4 red out of 7)
Independent Events
Two events are independent if knowing one occurred doesn’t change the probability of the other.
Events A and B are independent if:
Or equivalently:
Or equivalently:
Flip a fair coin twice.
A = first flip is heads B = second flip is heads
Are these independent?
(second flip doesn’t “know” about the first)
Since , the events are independent.
Dependent Events
Events are dependent if one event affects the probability of the other.
A bag has 6 red and 4 green balls.
A = first draw is red B = second draw is red
(only 5 red left among 9 balls) (all 6 red still among 9 balls)
Since , these events are dependent.
Testing for Independence
To check if events are independent, verify any one of:
Survey of 200 people:
| Coffee Drinker | Not Coffee | Total | |
|---|---|---|---|
| Morning Person | 60 | 40 | 100 |
| Night Owl | 50 | 50 | 100 |
| Total | 110 | 90 | 200 |
Are “morning person” and “coffee drinker” independent?
Since , these events are dependent.
Morning people are more likely to drink coffee than night owls (60% vs 50%).
The Chain Rule
For multiple events, we can chain conditional probabilities:
Draw 3 cards from a deck without replacement. P(all hearts)?
About 1.3% chance of drawing 3 hearts in a row.
Tree Diagrams
Tree diagrams visualize sequential events and their probabilities.
A disease affects 1% of the population. A test is:
- 95% accurate for people WITH disease (sensitivity)
- 90% accurate for people WITHOUT disease (specificity)
Tree structure:
Population
├── Disease (0.01)
│ ├── Test + (0.95) → True Positive
│ └── Test - (0.05) → False Negative
└── No Disease (0.99)
├── Test + (0.10) → False Positive
└── Test - (0.90) → True NegativeP(Test positive)?
About 10.85% of all people test positive!
Law of Total Probability
The probability of an event can be calculated by summing over all possible conditions.
If are mutually exclusive and exhaustive events:
For two conditions:
Factory has 3 machines producing widgets:
- Machine A: 50% of production, 2% defect rate
- Machine B: 30% of production, 3% defect rate
- Machine C: 20% of production, 5% defect rate
What’s P(randomly selected widget is defective)?
2.9% of all widgets are defective.
Common Conditional Probability Mistakes
A = It’s raining B = Ground is wet
(rain almost always makes ground wet) (ground might be wet from sprinklers, hose, etc.)
These are very different probabilities!
Applications of Conditional Probability
1. Medical Diagnosis
Interpreting test results requires understanding false positive/negative rates.
2. Quality Control
Tracking defect rates by machine, shift, or supplier.
3. Risk Assessment
Insurance companies calculate conditional risks based on demographics.
4. Machine Learning
Naive Bayes classifiers are based entirely on conditional probability.
5. Legal Evidence
DNA matching, fingerprint analysis, and forensic statistics.
Summary
In this lesson, you learned:
- Conditional probability:
- Multiplication rule:
- Independence: or
- Dependent events: Probability of one changes based on the other
- Tree diagrams: Visualize sequential conditional probabilities
- Law of Total Probability: Sum probabilities over all conditions
- in general
Practice Problems
1. A deck has 52 cards. Find: a) P(King | Red card) b) P(Red | King) c) P(King and Red)
2. Box contains 4 white and 6 black balls. Two are drawn without replacement. a) P(both white) b) P(second is white | first is black) c) P(at least one white)
3. 60% of emails are spam. A filter catches 90% of spam but also flags 5% of legitimate emails. a) P(email is flagged)? b) P(email is spam | flagged)?
4. Are A and B independent if P(A) = 0.4, P(B) = 0.5, and P(A ∩ B) = 0.2?
Click to see answers
1. a) P(King | Red) = P(King and Red) / P(Red) = (2/52) / (26/52) = 2/26 = 1/13 b) P(Red | King) = P(King and Red) / P(King) = (2/52) / (4/52) = 2/4 = 1/2 c) P(King and Red) = 2/52 = 1/26
2. a) P(both white) = (4/10) × (3/9) = 12/90 = 2/15 b) P(2nd white | 1st black) = 4/9 ≈ 0.444 c) P(at least one white) = 1 - P(both black) = 1 - (6/10)(5/9) = 1 - 30/90 = 2/3
3. a) P(flagged) = P(spam)P(flagged|spam) + P(not spam)P(flagged|not spam) = (0.6)(0.9) + (0.4)(0.05) = 0.54 + 0.02 = 0.56 b) P(spam|flagged) = P(spam and flagged) / P(flagged) = (0.6)(0.9) / 0.56 = 0.54 / 0.56 ≈ 0.964 (96.4%)
4. Check: P(A) × P(B) = 0.4 × 0.5 = 0.2 = P(A ∩ B) Yes, A and B are independent.
Next Steps
Continue your probability journey:
- Bayes’ Theorem - Reverse conditional probabilities
- Discrete Distributions - Binomial and Poisson
- Probability Calculator - Practice calculations
Was this lesson helpful?
Help us improve by sharing your feedback or spreading the word.