Vertex Learn

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.
Key idea

A probability inside one group

  • Look only at outcomes that meet a condition.
  • The denominator changes.
  • It becomes that group's total.
Key idea

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 barthe group you are in
Before the barwhat you want in it
Denominatorthe group's total
Worked example

Cycling to work: 500 residents

  • 200 under 40: 60 of them cycle.
  • 300 aged 40 and over: 45 cycle.
  • 105 cyclists in all.
CycleDo notTotal
Under 4060140200
40 and over45255300
Total105395500
Worked example

The gaps, by subtraction

  • Each gap: total − known.
  • Check the grand total.
  1. under 40, do not: 200 − 60 = 140
  2. 40+, do not: 300 − 45 = 255
  3. cycle: 60 + 45 = 105
  4. do not: 140 + 255 = 395
  5. 105 + 395 = 500
Key idea

Words into notation

  • "Of cyclists" means given C.
  • "Of under-40s" means given U.
  • "Under 40 and cycle": no condition.
Question asksWrite
% of cyclists under 40P(U | C)
% of under-40s who cycleP(C | U)
% under 40 and cycleP(U and C)
Worked example

One numerator, three denominators

  • And: divide by everyone.
  • Given: divide by the group.
  1. P(C and U) = 60 ÷ 500everyone
  2. = 0.12
  3. P(C | U) = 60 ÷ 200under-40s only
  4. = 0.3
  5. P(U | C) = 60 ÷ 105cyclists only
  6. = 0.57144 decimal places
Key idea

Try it: one numerator, three totals

Key idea

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.
Worked example

With probabilities, not counts

  • Divide by P(B).
  • Same as the counts.
  1. P(A | B) = P(A and B) ÷ P(B)
  2. P(U) = 200 ÷ 500 = 0.4from the table
  3. P(C | U) = 0.12 ÷ 0.4substitute
  4. = 0.3same as 60 ÷ 200
Worked example

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.
In a Venn, the condition is a circle
Worked example

Other conditions from the same Venn

  • Only the given regions.
  • Given no muffin: outside.
  1. P(M) = 0.15 + 0.1 = 0.25the muffin circle
  2. P(C | M) = 0.15 ÷ 0.25both ÷ P(M)
  3. = 0.6
  4. P(not M) = 0.35 + 0.4 = 0.75outside the circle
  5. P(C | not M) = 0.35 ÷ 0.75coffee only ÷ P(not M)
  6. = 0.46674 decimal places
Worked example

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.
Three circles for surfing, kayaking and tramping among 200 students. Surfing and kayaking only 12, surfing and tramping only 18, kayaking and tramping only 10, all three 8, kayaking only 25, tramping only 50, none 37, surfing only unknown, surfing total 78.
Worked example

Unions and exactly one

  • Given K or T: every region in either circle.
  • At least one: all but outside.
  1. K or T = 25 + 50 + 12 + 18 + 10 + 8 = 123each region once
  2. P(S | K or T) = (12 + 18 + 8) ÷ 123surfers in the group ÷ group
  3. = 0.30894 decimal places
  4. At least one = 200 − 37 = 163all but outside
  5. P(exactly one | at least one) = (40 + 25 + 50) ÷ 163the three "only" regions
  6. = 0.70554 decimal places
Worked example

Second branches are conditional

  • Polluted 0.2, clean 0.8.
  • P(pos | polluted) = 0.85.
  • P(pos | clean) = 0.1.
Second branches are conditional
Key idea

Try it: second branches are conditional

Worked example

Multiply along each path

  • Each path: multiply.
  • The four paths total 1.
  1. polluted, pos: 0.2 × 0.85 = 0.17
  2. polluted, neg: 0.2 × 0.15 = 0.03
  3. clean, pos: 0.8 × 0.1 = 0.08
  4. clean, neg: 0.8 × 0.9 = 0.72
  5. 0.17 + 0.03 + 0.08 + 0.72 = 1
Worked example

Reversing the conditional

  • Add the positive paths.
  • Path ÷ matching paths.
  1. P(pos) = 0.17 + 0.08both positive paths
  2. = 0.25
  3. P(polluted | pos)
  4. = P(polluted and pos) ÷ P(pos)
  5. = 0.17 ÷ 0.25substitute
  6. = 0.68
Key idea

Try it: zoom into the given group

Key idea

Say what it means

  • The test catches 85% of polluted streams.
  • Of positives, 68% are polluted.
  • Clean streams are far more common.
Key idea

Where the marks are

  • Achieved: a conditional from a table or tree.
  • Merit: accurate, with correct notation.
  • Excellence: support or reject a claim.
Summary

What to take away

  • Given picks the group, and the group picks the denominator.
P(A | B)A given B
Denominatorthe given group
FormulaP(A and B) ÷ P(B)
OrderP(A | B) ≠ P(B | A)
Reversepath ÷ matching paths
Answerin context, 4 dp

Common mistakes

  • P(U | C) = 60 ÷ 200 = 0.3
    Given C means cyclists only, so divide by the 105 cyclists: P(U | C) = 60 ÷ 105 = 0.5714.
  • P(C and U) = 60 ÷ 200 = 0.3
    And 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

Your turn: four questions

  • Name the condition before you divide.
  • Four decimal places, then context.
GivenFind
1the cycling tableP(C | 40+)
2the cycling tableP(40+ | C)
30.2, 0.1, 0.3, 0.4P(A | B)
4U 0.1; flag 0.9, 0.05P(U | flag)
1
2
3
4
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.

Worked example

The answers: questions 1 to 3

  1. 1. P(C | 40+) = 45 ÷ 30040 and over only
  2. = 0.15
  3. 2. P(40+ | C) = 45 ÷ 105cyclists only
  4. = 0.42864 decimal places
  5. 3. P(B) = 0.1 + 0.3 = 0.4both + only B
  6. P(A | B) = 0.1 ÷ 0.4both ÷ P(B)
  7. = 0.25
Worked example

The answers: question 4

  1. 4. U and flag: 0.1 × 0.9 = 0.09
  2. not U, flag: 0.9 × 0.05 = 0.045
  3. P(flag) = 0.09 + 0.045 = 0.135both flagged paths
  4. P(U | flag) = 0.09 ÷ 0.135U path ÷ P(flag)
  5. = 0.66674 decimal places
Your turn

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
  1. Read P(licence | job) as the probability of a licence given a job.
  2. After the bar is the group you are in: students with a job. There are 180 of them.
  3. So the denominator is 180, not 400.
  4. Of those 180, 120 have a licence.
  5. P(licence | job) = 120 ÷ 180 = 0.6667, to 4 decimal places.
  6. Classic mistake: dividing by 400. That gives P(licence and job), a different question.
  7. In context: about two thirds of students with a part-time job have a full licence.
Full working
  1. given jobonly the 180 with a job
  2. P(licence|job) = 120 ÷ 180
  3. 0.6667
Your turn

Sample questions: Merit

1

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
  1. Let T be takes a train and B be takes a bus. Put 0.15 in the middle of the Venn diagram.
  2. 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.
  3. Recall the formula: P(A | B) = P(A and B) ÷ P(B). The given event goes on the bottom.
  4. P(B | T): the group is train takers, P(T) = 0.4. The part of it that also takes a bus is 0.15.
  5. P(B | T) = 0.15 ÷ 0.4 = 0.375.
  6. P(T | not B): the group is everyone outside the bus circle, P(not B) = 1 − 0.5 = 0.5.
  7. Inside that group, who takes a train? Train only, 0.25.
  8. P(T | not B) = 0.25 ÷ 0.5 = 0.5.
  9. Classic mistake: dividing by 1. That finds P(T and not B), not the conditional.
  10. Check: P(not T | not B) = 0.25 ÷ 0.5 = 0.5, and 0.5 + 0.5 = 1.
Full working
  1. T only = 0.25, both = 0.15, B only = 0.35, neither = 0.25
  2. P(B|T) = P(B and T) ÷ P(T) = 0.15 ÷ 0.4 = 0.375
  3. P(not B) = 1 − 0.5 = 0.5
  4. P(T|not B) = 0.25 ÷ 0.5 = 0.5
  5. P(BT) = 0.375, P(T | not B) = 0.5
2

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
  1. Domestic visitors: 600 − 240 = 360. Park visitors: 150 + 120 = 270.
  2. P(park | international): the group is the 240 international visitors. 150 of them went to a park.
  3. So P(park | international) = 150 ÷ 240 = 0.625.
  4. P(international | park): the group is the 270 park visitors. 150 of them are international.
  5. So P(international | park) = 150 ÷ 270 = 0.5556.
  6. Same numerator, 150, but different denominators, because the condition picks a different group.
  7. In context: 62.5% of international visitors went to a park, but only 55.6% of park visitors were international.
  8. The second is lower because many domestic visitors (120) also went to parks.
  9. Classic mistake: thinking P(A | B) = P(B | A). The order of the bar matters.
Full working
  1. domestic = 360, park = 150 + 120 = 270
  2. P(park|international) = 150 ÷ 240 = 0.625
  3. P(international|park) = 150 ÷ 270 = 0.5556
  4. same numerator, different groups
  5. 0.625 and 0.5556; the condition changes the group
Your turn

Sample questions: Excellence

1

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
  1. First stage: infected 0.06, healthy 0.94.
  2. Second stage, after infected: positive 0.92. After healthy: positive 0.08. These are conditional probabilities.
  3. Infected and positive: 0.06 × 0.92 = 0.0552.
  4. Healthy and positive: 0.94 × 0.08 = 0.0752.
  5. All positives: P(positive) = 0.0552 + 0.0752 = 0.1304.
  6. The claim is about trees that test positive, so we need P(infected | positive).
  7. P(infected | positive) = 0.0552 ÷ 0.1304 = 0.4233.
  8. So only about 42% of positive trees are infected. About 58% are healthy.
  9. 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.
  10. Classic mistake: quoting 0.92. That is P(positive | infected), the reverse of what the ranger needs.
  11. Judgement: the claim is not supported. A positive test should lead to a second, independent check.
Full working
  1. infected, positive: 0.06 × 0.92 = 0.0552
  2. healthy, positive: 0.94 × 0.08 = 0.0752
  3. P(positive) = 0.1304
  4. P(infected|positive) = 0.0552 ÷ 0.1304 = 0.4233
  5. 0.4233 is not almost certainmost positives are healthy trees
  6. P(infectedpositive) = 0.4233; the claim is not supported
2

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
  1. Tree: first stage fruit p, no fruit 1 − p. Second stage: sits 0.9 after fruit, sits 0.05 after no fruit.
  2. Fruit and sits: 0.9p. No fruit and sits: 0.05(1 − p).
  3. So P(sits) = 0.9p + 0.05(1 − p), and P(fruit | sits) = 0.9p ÷ P(sits).
  4. (a) p = 0.02: fruit and sits = 0.9 × 0.02 = 0.018. No fruit and sits = 0.05 × 0.98 = 0.049.
  5. P(sits) = 0.018 + 0.049 = 0.067, so P(fruit | sits) = 0.018 ÷ 0.067 = 0.2687.
  6. (b) More likely than not means P(fruit | sits) > 0.5.
  7. That happens exactly when the fruit path is bigger than the no-fruit path: 0.9p > 0.05(1 − p).
  8. Expand: 0.9p > 0.05 − 0.05p, so 0.95p > 0.05.
  9. So p > 0.05 ÷ 0.95 = 119, about 0.0526.
  10. Check p = 119: fruit path 0.919 and no-fruit path 0.05 × 1819 = 0.919. Equal, so exactly 0.5 there.
  11. 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
  1. P(fruit|sits) = 0.9p ÷ (0.9p + 0.05(1 − p))
  2. (a) 0.018 ÷ (0.018 + 0.049) = 0.2687
  3. (b) need 0.9p > 0.05(1 − p)fruit path bigger than false-alarm path
  4. 0.95p > 0.05
  5. p > 119 ≈ 0.0526
  6. (a) 0.2687 (b) p > 119 ≈ 0.0526
Practice

Practise this

Worksheet with answersWithout answersDownload PDF
2026 practice paper with worked answersOpen the paper
Revision video: exam questions workedWatch and practise
Report a mistake

More in AS 91585

Is your child on track?

Take the free placement test