Conditional probability from tables, trees and Venn diagrams
What this lesson covers
- A conditional probability restricts attention to one group, so its denominator is that group's total.
- The notation P(A | B) is read 'A given B', and the order matters.
A probability inside one group
- Look only at outcomes that meet a condition.
- The denominator changes.
- It becomes that group's total.
Reading P(A | B)
- Say it: "the probability of A given B".
- After the bar: the group you are in.
- Denominator: the total of B.
| Means | |
|---|---|
| P(A | B) | "A given B" |
| After the bar | the group you are in |
| Before the bar | what you want in it |
| Denominator | the group's total |
Cycling to work: 500 residents
- 200 under 40: 60 of them cycle.
- 300 aged 40 and over: 45 cycle.
- 105 cyclists in all.
| Cycle | Do not | Total | |
|---|---|---|---|
| Under 40 | 60 | 140 | 200 |
| 40 and over | 45 | 255 | 300 |
| Total | 105 | 395 | 500 |
The gaps, by subtraction
- Each gap: total − known.
- Check the grand total.
- under 40, do not: 200 − 60 = 140
- 40+, do not: 300 − 45 = 255
- cycle: 60 + 45 = 105
- do not: 140 + 255 = 395
- 105 + 395 = 500
Words into notation
- "Of cyclists" means given C.
- "Of under-40s" means given U.
- "Under 40 and cycle": no condition.
| Question asks | Write |
|---|---|
| % of cyclists under 40 | P(U | C) |
| % of under-40s who cycle | P(C | U) |
| % under 40 and cycle | P(U and C) |
One numerator, three denominators
- And: divide by everyone.
- Given: divide by the group.
- P(C and U) = 60 ÷ 500everyone
- = 0.12
- P(C | U) = 60 ÷ 200under-40s only
- = 0.3
- P(U | C) = 60 ÷ 105cyclists only
- = 0.57144 decimal places
Try it: one numerator, three totals
The order matters
- P(C | U) = 0.3: 30% of under-40s cycle.
- P(U | C) = 0.5714: 57% of cyclists are under 40.
- Say which group you mean.
With probabilities, not counts
- Divide by P(B).
- Same as the counts.
- P(A | B) = P(A and B) ÷ P(B)
- P(U) = 200 ÷ 500 = 0.4from the table
- P(C | U) = 0.12 ÷ 0.4substitute
- = 0.3same as 60 ÷ 200
In a Venn, the condition is a circle
- Given coffee: only the coffee circle.
- Its total: 0.35 + 0.15 = 0.5.
- P(M | C) = 0.15 ÷ 0.5 = 0.3.

Other conditions from the same Venn
- Only the given regions.
- Given no muffin: outside.
- P(M) = 0.15 + 0.1 = 0.25the muffin circle
- P(C | M) = 0.15 ÷ 0.25both ÷ P(M)
- = 0.6
- P(not M) = 0.35 + 0.4 = 0.75outside the circle
- P(C | not M) = 0.35 ÷ 0.75coffee only ÷ P(not M)
- = 0.46674 decimal places
Three circles: fill the gap first
- Surfing only = 78 − 12 − 18 − 8 = 40.
- Given surfing: all four surfing regions, 78.
- P(K | S) = (12 + 8) ÷ 78 = 0.2564.
Unions and exactly one
- Given K or T: every region in either circle.
- At least one: all but outside.
- K or T = 25 + 50 + 12 + 18 + 10 + 8 = 123each region once
- P(S | K or T) = (12 + 18 + 8) ÷ 123surfers in the group ÷ group
- = 0.30894 decimal places
- At least one = 200 − 37 = 163all but outside
- P(exactly one | at least one) = (40 + 25 + 50) ÷ 163the three "only" regions
- = 0.70554 decimal places
Second branches are conditional
- Polluted 0.2, clean 0.8.
- P(pos | polluted) = 0.85.
- P(pos | clean) = 0.1.

Try it: second branches are conditional
Multiply along each path
- Each path: multiply.
- The four paths total 1.
- polluted, pos: 0.2 × 0.85 = 0.17
- polluted, neg: 0.2 × 0.15 = 0.03
- clean, pos: 0.8 × 0.1 = 0.08
- clean, neg: 0.8 × 0.9 = 0.72
- 0.17 + 0.03 + 0.08 + 0.72 = 1
Reversing the conditional
- Add the positive paths.
- Path ÷ matching paths.
- P(pos) = 0.17 + 0.08both positive paths
- = 0.25
- P(polluted | pos)
- = P(polluted and pos) ÷ P(pos)
- = 0.17 ÷ 0.25substitute
- = 0.68
Try it: zoom into the given group
Say what it means
- The test catches 85% of polluted streams.
- Of positives, 68% are polluted.
- Clean streams are far more common.
Where the marks are
- Achieved: a conditional from a table or tree.
- Merit: accurate, with correct notation.
- Excellence: support or reject a claim.
What to take away
- Given picks the group, and the group picks the denominator.
| P(A | B) | A given B |
| Denominator | the given group |
| Formula | P(A and B) ÷ P(B) |
| Order | P(A | B) ≠ P(B | A) |
| Reverse | path ÷ matching paths |
| Answer | in context, 4 dp |
Common mistakes
- P(U | C) = 60 ÷ 200 = 0.3Given C means cyclists only, so divide by the 105 cyclists: P(U | C) = 60 ÷ 105 = 0.5714.
- P(C and U) = 60 ÷ 200 = 0.3And has no condition, so divide by everyone: P(C and U) = 60 ÷ 500 = 0.12.
- The test catches 85% of polluted streams, so a positive stream is 85% likely to be polluted.0.85 is P(pos | polluted); reverse it with the tree: P(polluted | pos) = 0.17 ÷ 0.25 = 0.68.
- P(M | C) = 0.15, the middle of the Venn.Given coffee, divide by the whole coffee circle: 0.15 ÷ 0.5 = 0.3.
Your turn: four questions
- Name the condition before you divide.
- Four decimal places, then context.
| Given | Find | |
|---|---|---|
| 1 | the cycling table | P(C | 40+) |
| 2 | the cycling table | P(40+ | C) |
| 3 | 0.2, 0.1, 0.3, 0.4 | P(A | B) |
| 4 | U 0.1; flag 0.9, 0.05 | P(U | flag) |
Show answer
1. P(cycle | 40 and over) = 45 ÷ 300 = 0.15. 2. P(40 and over | cycle) = 45 ÷ 105 = 0.4286. 3. P(B) = 0.1 + 0.3 = 0.4; P(A | B) = 0.1 ÷ 0.4 = 0.25. 4. P(flag) = 0.09 + 0.045 = 0.135; P(U | flag) = 0.09 ÷ 0.135 = 0.6667.
The answers: questions 1 to 3
- 1. P(C | 40+) = 45 ÷ 30040 and over only
- = 0.15
- 2. P(40+ | C) = 45 ÷ 105cyclists only
- = 0.42864 decimal places
- 3. P(B) = 0.1 + 0.3 = 0.4both + only B
- P(A | B) = 0.1 ÷ 0.4both ÷ P(B)
- = 0.25
The answers: question 4
- 4. U and flag: 0.1 × 0.9 = 0.09
- not U, flag: 0.9 × 0.05 = 0.045
- P(flag) = 0.09 + 0.045 = 0.135both flagged paths
- P(U | flag) = 0.09 ÷ 0.135U path ÷ P(flag)
- = 0.66674 decimal places
Sample question: Achieved
400 Year 13 students in Palmerston North are surveyed. 180 have a part-time job, and 120 of these have a full driver licence. Of the 220 without a job, 80 have a full licence. Find the probability that a student has a full licence given that they have a part-time job.
Hint
Given a job means you only look at the 180 students with a job.
Answer
P(licence | job) = 120 ÷ 180 = 0.6667
Step by step
- Read P(licence | job) as the probability of a licence given a job.
- After the bar is the group you are in: students with a job. There are 180 of them.
- So the denominator is 180, not 400.
- Of those 180, 120 have a licence.
- P(licence | job) = 120 ÷ 180 = 0.6667, to 4 decimal places.
- Classic mistake: dividing by 400. That gives P(licence and job), a different question.
- In context: about two thirds of students with a part-time job have a full licence.
Full working
- given jobonly the 180 with a job
- P(licence|job) = 120 ÷ 180
- 0.6667
Sample questions: Merit
For a randomly chosen Wellington commuter, P(takes a train) = 0.4, P(takes a bus) = 0.5 and P(takes both) = 0.15. Find the probability that a commuter takes a bus given that they take a train, and the probability that a commuter takes a train given that they do not take a bus. Use correct notation.
Hint
Fill the Venn regions first. Given train means only the train circle; given no bus means only the outside of the bus circle.
Answer
P(B | T) = 0.15 ÷ 0.4 = 0.375. P(T | not B) = 0.25 ÷ 0.5 = 0.5
Step by step
- Let T be takes a train and B be takes a bus. Put 0.15 in the middle of the Venn diagram.
- Train only: 0.4 − 0.15 = 0.25. Bus only: 0.5 − 0.15 = 0.35. Neither: 1 − (0.25 + 0.15 + 0.35) = 0.25.
- Recall the formula: P(A | B) = P(A and B) ÷ P(B). The given event goes on the bottom.
- P(B | T): the group is train takers, P(T) = 0.4. The part of it that also takes a bus is 0.15.
- P(B | T) = 0.15 ÷ 0.4 = 0.375.
- P(T | not B): the group is everyone outside the bus circle, P(not B) = 1 − 0.5 = 0.5.
- Inside that group, who takes a train? Train only, 0.25.
- P(T | not B) = 0.25 ÷ 0.5 = 0.5.
- Classic mistake: dividing by 1. That finds P(T and not B), not the conditional.
- Check: P(not T | not B) = 0.25 ÷ 0.5 = 0.5, and 0.5 + 0.5 = 1.
Full working
- T only = 0.25, both = 0.15, B only = 0.35, neither = 0.25
- P(B|T) = P(B and T) ÷ P(T) = 0.15 ÷ 0.4 = 0.375
- P(not B) = 1 − 0.5 = 0.5
- P(T|not B) = 0.25 ÷ 0.5 = 0.5
- P(BT) = 0.375, P(T | not B) = 0.5
Of 600 visitors to Rotorua one weekend, 240 are international and the rest are domestic. 150 of the international visitors and 120 of the domestic visitors go to a geothermal park. Find P(park | international) and P(international | park), and explain in context why they are different.
Hint
The two probabilities have different groups after the bar, so they have different denominators.
Answer
P(park | international) = 150 ÷ 240 = 0.625. P(international | park) = 150 ÷ 270 = 0.5556. The first says 62.5% of international visitors went to a park; the second says 55.6% of park visitors were international. They differ because the groups are different: 240 international visitors against 270 park visitors.
Step by step
- Domestic visitors: 600 − 240 = 360. Park visitors: 150 + 120 = 270.
- P(park | international): the group is the 240 international visitors. 150 of them went to a park.
- So P(park | international) = 150 ÷ 240 = 0.625.
- P(international | park): the group is the 270 park visitors. 150 of them are international.
- So P(international | park) = 150 ÷ 270 = 0.5556.
- Same numerator, 150, but different denominators, because the condition picks a different group.
- In context: 62.5% of international visitors went to a park, but only 55.6% of park visitors were international.
- The second is lower because many domestic visitors (120) also went to parks.
- Classic mistake: thinking P(A | B) = P(B | A). The order of the bar matters.
Full working
- domestic = 360, park = 150 + 120 = 270
- P(park|international) = 150 ÷ 240 = 0.625
- P(international|park) = 150 ÷ 270 = 0.5556
- same numerator, different groups
- 0.625 and 0.5556; the condition changes the group
Sample questions: Excellence
In a Waitākere forest, 6% of kauri trees have kauri dieback. A soil test gives a positive result for 92% of infected trees and for 8% of healthy trees. A ranger says "a positive test means the tree is almost certainly infected". Use a tree diagram to evaluate this claim.
Hint
Find both positive paths, then P(infected | positive) = infected-and-positive path ÷ all positives.
Answer
P(positive) = 0.0552 + 0.0752 = 0.1304, and P(infected | positive) = 0.0552 ÷ 0.1304 = 0.4233. Only about 42% of trees that test positive are infected, so the claim is not supported. Healthy trees are so common that their 8% false positives outnumber the true positives.
Step by step
- First stage: infected 0.06, healthy 0.94.
- Second stage, after infected: positive 0.92. After healthy: positive 0.08. These are conditional probabilities.
- Infected and positive: 0.06 × 0.92 = 0.0552.
- Healthy and positive: 0.94 × 0.08 = 0.0752.
- All positives: P(positive) = 0.0552 + 0.0752 = 0.1304.
- The claim is about trees that test positive, so we need P(infected | positive).
- P(infected | positive) = 0.0552 ÷ 0.1304 = 0.4233.
- So only about 42% of positive trees are infected. About 58% are healthy.
- Why so low? Healthy trees are 94% of the forest. Even a small 8% error on so many trees gives more positives than the infected trees do.
- Classic mistake: quoting 0.92. That is P(positive | infected), the reverse of what the ranger needs.
- Judgement: the claim is not supported. A positive test should lead to a second, independent check.
Full working
- infected, positive: 0.06 × 0.92 = 0.0552
- healthy, positive: 0.94 × 0.08 = 0.0752
- P(positive) = 0.1304
- P(infected|positive) = 0.0552 ÷ 0.1304 = 0.4233
- 0.4233 is not almost certainmost positives are healthy trees
- P(infectedpositive) = 0.4233; the claim is not supported
A biosecurity dog at Auckland Airport sits beside 90% of bags that contain fruit and wrongly sits beside 5% of bags that do not. A proportion p of bags contain fruit. (a) If p = 0.02, find the probability that a bag the dog sits beside contains fruit. (b) For which values of p is a bag the dog sits beside more likely than not to contain fruit?
Hint
Write P(fruit | sits) = 0.9p ÷ (0.9p + 0.05(1 − p)) and solve for when it is more than 0.5.
Answer
(a) 0.018 ÷ 0.067 = 0.2687. (b) When 0.9p > 0.05(1 − p), so p > 119 ≈ 0.0526: more than about 5.3% of bags must contain fruit.
Step by step
- Tree: first stage fruit p, no fruit 1 − p. Second stage: sits 0.9 after fruit, sits 0.05 after no fruit.
- Fruit and sits: 0.9p. No fruit and sits: 0.05(1 − p).
- So P(sits) = 0.9p + 0.05(1 − p), and P(fruit | sits) = 0.9p ÷ P(sits).
- (a) p = 0.02: fruit and sits = 0.9 × 0.02 = 0.018. No fruit and sits = 0.05 × 0.98 = 0.049.
- P(sits) = 0.018 + 0.049 = 0.067, so P(fruit | sits) = 0.018 ÷ 0.067 = 0.2687.
- (b) More likely than not means P(fruit | sits) > 0.5.
- That happens exactly when the fruit path is bigger than the no-fruit path: 0.9p > 0.05(1 − p).
- Expand: 0.9p > 0.05 − 0.05p, so 0.95p > 0.05.
- So p > 0.05 ÷ 0.95 = 119, about 0.0526.
- Check p = 119: fruit path 0.919 and no-fruit path 0.05 × 1819 = 0.919. Equal, so exactly 0.5 there.
- In context: the dog is right more often than not only when more than about 5.3% of bags carry fruit. At 2%, most of its sits are false alarms.
Full working
- P(fruit|sits) = 0.9p ÷ (0.9p + 0.05(1 − p))
- (a) 0.018 ÷ (0.018 + 0.049) = 0.2687
- (b) need 0.9p > 0.05(1 − p)fruit path bigger than false-alarm path
- 0.95p > 0.05
- p > 119 ≈ 0.0526
- (a) 0.2687 (b) p > 119 ≈ 0.0526
Practise this
Report a mistake
More in AS 91585
Tables, trees and Venn diagrams from written information10 min
Conditional probability from tables, trees and Venn diagrams9 min
Independent or mutually exclusive? The two tests10 min
Relative risk: times as likely, and when you need a ratio9 min
True probability, model estimates and experimental estimates8 min
Organising information: 7 exam questions solved step by step11 min
Conditional probability: 7 exam questions solved step by step10 min
Independent or exclusive: 7 exam questions solved step by step10 min
Relative risk: 7 exam questions solved step by step10 min
Probability estimates: 7 exam questions solved step by step9 minIs your child on track?
Take the free placement test