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: eight questions
- Name the condition before you divide.
- Eight 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) |
| 5 | of the students who play netball, the proportion in Year 12 | notation |
| 6 | 250 tourists: 40 of 100 under 30 and 90 of 150 aged 30+ visited | P(under 30 and visited) |
| 7 | P(B) = 0.4, P(A | B) = 0.35 | P(A and B) |
| 8 | 400 students: 160 work part-time, 120 of them drive; 200 drive in all | judge: 75% of drivers work part-time |
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. 5. P(Y12 | netball): "of those who play netball" is the condition, so netball goes after the bar. 6. 0.16: "and" has no condition, so divide by everyone: 40 ÷ 250 = 0.16. 7. 0.14: P(A | B) = P(A and B) ÷ P(B), so P(A and B) = 0.35 × 0.4 = 0.14. 8. Not supported: P(work | drive) = 120 ÷ 200 = 0.6. The 0.75 is 120 ÷ 160 = P(drive | work), the wrong way round.
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
Challenge
An invented Te Puke packhouse takes kiwifruit from three orchards: 50% from Orchard A, 30% from Orchard B and 20% from Orchard C. 2% of A's fruit and 5% of B's fruit is rejected, and 4.5% of all the fruit is rejected. (a) Find the percentage of Orchard C's fruit that is rejected. (b) The manager says: "Most of our rejects come from A, because A supplies most of our fruit." Evaluate this using conditional probabilities. (c) Find P(A | not rejected).
Hint
Draw a tree with three first branches and an unknown r for P(rejected | C). The three rejected paths add to 0.045.
Answer
(a) 10%. (b) P(A | rejected) = 0.2222, P(B | rejected) = 0.3333, P(C | rejected) = 0.4444. The claim is wrong: A supplies half the fruit but only about 22% of the rejects, while C supplies 20% of the fruit but about 44% of the rejects. (c) 0.49 ÷ 0.955 = 0.5131.
Step by step
- Rejected paths: A 0.5 × 0.02 = 0.01, B 0.3 × 0.05 = 0.015, C 0.2 × r.
- 0.01 + 0.015 + 0.2r = 0.045, so 0.2r = 0.02 and r = 0.1: 10% of C's fruit is rejected.
- Given rejected, divide each path by 0.045: A 0.2222, B 0.3333, C 0.4444.
- A's low reject rate outweighs its large share, so most rejects are not from A.
- Not rejected: 1 − 0.045 = 0.955. A and not rejected: 0.5 × 0.98 = 0.49. Divide.
Full working
- 0.5 × 0.02 + 0.3 × 0.05 + 0.2r = 0.045rejected paths
- 0.025 + 0.2r = 0.045, r = 0.1(a)
- P(A given rejected) = 0.01 ÷ 0.045 = 0.2222
- P(B given rejected) = 0.015 ÷ 0.045 = 0.3333
- P(C given rejected) = 0.02 ÷ 0.045 = 0.4444claim not supported
- P(A given not rejected) = 0.49 ÷ 0.955 = 0.5131(c)
- (a) 10%; (b) only 22% of rejects from A; (c) 0.5131
A Year 13 student at an invented school is chosen at random. Let S be "takes Statistics" and H be "takes Physics". Of the Statistics students, 25% take Physics. Of the Physics students, 40% take Statistics. 55% of the students take at least one of the two subjects. Find P(S), P(H), and P(S | the student takes exactly one of the two).
Hint
Let x = P(S and H). The two conditional facts give P(S) and P(H) in terms of x; then use the addition rule for P(S or H).
Answer
P(S and H) = 0.1, P(S) = 0.4, P(H) = 0.25, and P(S | exactly one) = 0.3 ÷ 0.45 = 0.6667.
Step by step
- Let x = P(S and H).
- P(H | S) = 0.25 means x ÷ P(S) = 0.25, so P(S) = 4x. P(S | H) = 0.4 gives P(H) = 2.5x.
- Addition rule: 4x + 2.5x − x = 0.55, so 5.5x = 0.55 and x = 0.1.
- So P(S) = 0.4 and P(H) = 0.25.
- Exactly one: 0.55 − 0.1 = 0.45. Statistics only: 0.4 − 0.1 = 0.3. Divide: 0.6667.
Full working
- x = P(S and H)unknown overlap
- x ÷ P(S) = 0.25, P(S) = 4xPhysics given Statistics
- x ÷ P(H) = 0.4, P(H) = 2.5xStatistics given Physics
- 4x + 2.5x − x = 0.55addition rule
- x = 0.1, P(S) = 0.4, P(H) = 0.25
- P(exactly one) = 0.55 − 0.1 = 0.45S only = 0.3
- P(S given exactly one) = 0.3 ÷ 0.45 = 0.6667
An invented club netball team plays one game a week and never draws. If it wins a game, the probability it wins the next game is 0.7. If it loses a game, the probability it wins the next game is 0.4. The probability it wins the first game of the season is 0.5. (a) Find the probability it wins the third game. (b) Given that it won the third game, find the probability that it won the first game. (c) Given that it won both the first and third games, find the probability that it won the second game. (d) A supporter says: "A win in game 3 tells you almost nothing about game 1, and nothing about game 2." Evaluate both parts of this.
Hint
Draw a three-stage tree. Each branch after the first depends only on the game just before it. For (b) and (c), add up the paths that match the given information.
Answer
(a) 0.565. (b) 0.305 ÷ 0.565 = 0.5398. (c) 0.245 ÷ 0.305 = 0.8033. (d) The first part is fair: knowing game 3 was won only lifts the chance of a game 1 win from 0.5 to 0.5398. The second part is wrong: given wins in games 1 and 3, a win in game 2 has probability 0.8033, against 0.55 with no information, because game 2 sits between the two and affects game 3 directly.
Step by step
- Game 2: P(W2) = 0.5 × 0.7 + 0.5 × 0.4 = 0.55.
- Game 3: P(W3) = 0.55 × 0.7 + 0.45 × 0.4 = 0.565.
- Paths with W1 and W3: W W W = 0.5 × 0.7 × 0.7 = 0.245 and W L W = 0.5 × 0.3 × 0.4 = 0.06, total 0.305.
- P(W1 | W3) = 0.305 ÷ 0.565 = 0.5398, only a little above 0.5.
- P(W2 | W1 and W3) = 0.245 ÷ 0.305 = 0.8033, far above P(W2) = 0.55.
Full working
- P(W2) = 0.5 × 0.7 + 0.5 × 0.4 = 0.55
- P(W3) = 0.55 × 0.7 + 0.45 × 0.4 = 0.565(a)
- WWW = 0.245, WLW = 0.06paths with W1 and W3
- P(W1 and W3) = 0.305
- P(W1 given W3) = 0.305 ÷ 0.565 = 0.5398(b)
- P(W2 given W1 and W3) = 0.245 ÷ 0.305 = 0.8033(c)
- (a) 0.565; (b) 0.5398; (c) 0.8033; (d) first part fair, second part wrong
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