IB MYP Extended Mathematics · Statistics and probability
Conditional probability
1What conditional probability means
A conditional probability is the probability of an event given that another event has happened. The extra information changes the set of possible outcomes.
Notation: $P(A \mid B)$ is "the probability of A given B".
A die
- A fair die is rolled. P(the score is 6) = 1/6.
- You are told the score is even. Now only 2, 4 and 6 are possible.
- P(6 given even) = 1/3.
- The information has changed the probability.
The idea: the condition shrinks the sample space to the outcomes where B happened. The probability is the fraction of those in which A also happened.
$$P(A \mid B) = \frac{P(A \cap B)}{P(B)}$$
In words: the probability of both, divided by the probability of the condition.
Order matters. $P(A \mid B)$ and $P(B \mid A)$ are different questions with different answers: the probability that a card is a king given that it is a picture card is 1/3; the probability that it is a picture card given that it is a king is 1.
Check yourself
A fair die is rolled and the score is greater than 2. What is the probability that it is a 5?
Show the answer
1/4
The possible scores are 3, 4, 5 and 6, and one of the four is 5.
2Two-way tables
A two-way table makes conditional probabilities easy to read. The condition tells you which row or column total to divide by.
Sport and gender
- Of 100 students, 60 are girls and 40 are boys. 24 of the girls and 26 of the boys play a sport.
- In all, 50 play a sport and 50 do not.
- $P(\text{sport}) = \frac{50}{100} = 0.5$.
- $P(\text{sport} \mid \text{girl}) = \frac{24}{60} = 0.4$. Divide by the number of girls.
- $P(\text{girl} \mid \text{sport}) = \frac{24}{50} = 0.48$. Divide by the number who play sport.
- $P(\text{boy} \mid \text{no sport}) = \frac{14}{50} = 0.28$.
Steps 4 and 5 use the same 24 students but different totals. Reading "given" as "out of" helps: "given girl" means "out of the girls".
Check with the formula: $P(\text{sport} \cap \text{girl}) = 0.24$ and $P(\text{girl}) = 0.6$, so $0.24 \div 0.6 = 0.4$.
Check yourself
In a group of 50 people, 20 wear glasses, and 8 of those are left-handed. What is P(left-handed | glasses)?
Show the answer
0.4
Out of the 20 who wear glasses, 8 are left-handed: 8 ÷ 20.
3Tree diagrams without replacement
In a tree diagram, the probabilities on the second set of branches are conditional: they depend on what happened first.
Counters without replacement
- A bag has 5 red and 3 blue counters. Two are taken, one after the other, and not put back.
- First pick: P(red) = 5/8, P(blue) = 3/8.
- Second pick, given the first was red: 4 reds remain among 7, so P(red) = 4/7 and P(blue) = 3/7.
- Second pick, given the first was blue: P(red) = 5/7 and P(blue) = 2/7.
- P(both red) = 5/8 × 4/7 = 20/56 = 5/14.
- P(one of each) = 5/8 × 3/7 + 3/8 × 5/7 = 30/56 = 15/28.
- P(both blue) = 3/8 × 2/7 = 6/56 = 3/28.
- Check: 20/56 + 30/56 + 6/56 = 1.
Multiplying along the branches uses the rearranged formula:
$$P(A \cap B) = P(A) \times P(B \mid A)$$
A conditional question from the tree
- Given that the two counters are the same colour, what is the probability that both are red?
- P(same colour) = 20/56 + 6/56 = 26/56.
- P(both red | same colour) = (20/56) ÷ (26/56) = 20/26 = 10/13.
Check yourself
A box has 4 good and 2 faulty bulbs. Two are taken without replacement. What is the probability that both are faulty?
Show the answer
1/15
2/6 × 1/5 = 2/30.
4Independent events
Two events are independent if knowing that one happened does not change the probability of the other.
Tests for independence, which are all equivalent:
- $P(A \mid B) = P(A)$
- $P(B \mid A) = P(B)$
- $P(A \cap B) = P(A) \times P(B)$
Testing independence
- $P(A) = 0.5$, $P(B) = 0.4$ and $P(A \cap B) = 0.2$.
- $P(A) \times P(B) = 0.5 \times 0.4 = 0.2$.
- This equals $P(A \cap B)$, so A and B are independent.
- Check another way: $P(A \mid B) = 0.2 \div 0.4 = 0.5 = P(A)$.
The sport table
- $P(\text{sport}) = 0.5$ but $P(\text{sport} \mid \text{girl}) = 0.4$.
- They differ, so playing sport and gender are not independent in this group.
Do not confuse independent with mutually exclusive. Mutually exclusive events cannot happen together, so $P(A \cap B) = 0$. If one happens, the other certainly does not, which makes them strongly dependent.
Picking with replacement gives independent events. Picking without replacement gives dependent events.
Check yourself
P(A) = 0.3, P(B) = 0.6 and P(A ∩ B) = 0.18. Are A and B independent?
Show the answer
Yes, because 0.3 × 0.6 = 0.18
The product of the probabilities equals the probability of both.
5Reversing the condition
Many real questions ask for a probability "the wrong way round": you know $P(\text{positive} \mid \text{ill})$, and you want $P(\text{ill} \mid \text{positive})$. Using natural frequencies (imagining a large group) is the clearest method.
A medical test
- 1% of people have a condition. The test is positive for 90% of people who have it, and gives a false positive for 5% of people who do not.
- Imagine 1,000 people. 10 have the condition, and 990 do not.
- Of the 10 with it, 9 test positive.
- Of the 990 without it, 5% test positive: 49.5.
- Total positives: 58.5.
- $P(\text{has it} \mid \text{positive}) = \dfrac{9}{58.5} \approx 0.154$.
Only about 15% of positive results are true positives. The condition is rare, so the few false positives from the very large healthy group outnumber the true positives.
This surprises most people, who confuse $P(\text{positive} \mid \text{ill}) = 0.9$ with $P(\text{ill} \mid \text{positive}) = 0.15$. The same confusion appears in courts ("the prosecutor's fallacy") and in news reports about risk.
With the formula: $P(\text{ill} \cap \text{positive}) = 0.01 \times 0.9 = 0.009$; $P(\text{positive}) = 0.009 + 0.99 \times 0.05 = 0.0585$; $0.009 \div 0.0585 = 0.154$.
Check yourself
Why can a positive result from an accurate test still mean a low chance of having a rare condition?
Show the answer
False positives from the large healthy group outnumber the true positives
When very few people have the condition, even a small false positive rate produces many false alarms.
Now test yourself
This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.
Practise in Impera