Vertex Learn

Probability trees from written information, forwards and backwards

What this lesson covers

  • Each branch of a tree carries a probability conditional on the branches before it.
  • Working backwards through a tree finds the probability of an earlier event given a later one.
Key idea

From words to a tree

  • The exam gives a paragraph, not a tree.
  • Drawing the tree is part of the question.
  • First event first, then what depends on it.
InformationMeansOn the tree
60% of customerspay by cardfirst stage
15% of card payersbuy a warrantysecond stage, card branch
5% of cash payersbuy a warrantysecond stage, cash branch
Worked example

Build the tree

  • First stage: card 0.6, cash 0.4.
  • After card: warranty 0.15, none 0.85.
  • After cash: warranty 0.05, none 0.95.
Build the tree
Key idea

Try it: multiply along, add across

Worked example

Multiply along each path

  • Card and warranty: 0.6 × 0.15 = 0.09.
  • Every path gets its product.
  • The four products add to 1.
Multiply along each path
Worked example

The four paths

  • Along a path: multiply.
  • Check: the four total 1.
  1. card, W: 0.6 × 0.15 = 0.09
  2. card, none: 0.6 × 0.85 = 0.51
  3. cash, W: 0.4 × 0.05 = 0.02
  4. cash, none: 0.4 × 0.95 = 0.38
  5. check: 0.09 + 0.51 + 0.02 + 0.38
  6. = 1
Worked example

Add across paths

  • Two paths end in W.
  • Across paths: add.
  1. P(W) = 0.6 × 0.15 + 0.4 × 0.05
  2. = 0.09 + 0.02multiply along
  3. = 0.11add across
Worked example

Working backwards

  • Given W: only the W paths.
  • The path ÷ the total.
  1. P(card | W)
  2. = P(card and W) ÷ P(W)
  3. = 0.09 ÷ 0.11
  4. = 0.81818…calculator
  5. = 0.81824 d.p.
Key idea

Try it: the reverse question

Key idea

Why the answer is so high

  • Only 60% pay by card.
  • But 82% of W buyers did.
  1. P(card) = 0.6forwards
  2. 0.15 ÷ 0.05 = 3card rate ÷ cash rate
  3. P(card | W) = 0.8182backwards: 82%
Worked example

An unknown on the tree

  • Call P(card) p.
  • Multiply along, add across.
  1. P(card) = pthe unknown
  2. P(cash) = 1 − pbranches add to 1
  3. P(card and W) = 0.15pmultiply along
  4. P(cash and W) = 0.05(1 − p)multiply along
  5. 0.15p + 0.05(1 − p) = 0.12add: P(W) = 0.12
Worked example

Solve for p

  • Expand, collect, solve.
  • Check in the equation.
  1. 0.15p + 0.05(1 − p) = 0.12
  2. 0.15p + 0.05 − 0.05p = 0.12expand
  3. 0.1p + 0.05 = 0.12collect p terms
  4. 0.1p = 0.07subtract 0.05
  5. p = 0.07 ÷ 0.1 = 0.7divide by 0.1
  6. P(card) = 0.7: 70% by card
  7. check: 0.15 × 0.7 + 0.05 × 0.3
  8. = 0.105 + 0.015 = 0.12
Key idea

Try it: words to a tree and back

Key idea

Where the marks are

  • Achieved: a path probability.
  • Merit: adding paths, and working backwards.
  • Excellence: forming and solving an equation.
Summary

What to take away

  • Along, multiply. Across, add. Backwards, divide.
Buildfirst event, then conditional branches
Each set of branchesadds to 1
Along a pathmultiply
Across pathsadd
Backwardsthe path ÷ the total
Unknownan equation from the tree

Common mistakes

  • P(warranty) = 0.15 + 0.05 = 0.2
    Multiply along each path first, then add across: 0.6 × 0.15 + 0.4 × 0.05 = 0.11.
  • A warranty buyer is chosen, so P(card | warranty) = 0.15.
    0.15 is P(warranty | card). Backwards is path ÷ total: 0.09 ÷ 0.11 = 0.8182.
  • P(cash and no warranty) = 0.4 × 0.05 = 0.02
    After cash, no warranty is 1 − 0.05 = 0.95, so the path is 0.4 × 0.95 = 0.38. Each set of branches adds to 1.
  • Tested positive, so P(has the condition) = 0.9.
    That is P(positive | condition). Backwards: 0.036 ÷ 0.1128 = 0.3191, because most positives come from the 96% without it.
Your turn

Your turn: eight questions

  • Draw the tree first.
  • Eight decimal places.
Question
Info4% have it. Positive: 90% if they do, 8% if not.
1P(a random person tests positive)?
2P(has the condition | tests positive)?
3P(does not have it and tests negative)?
4Of 1000 people tested, how many positives expected?
5P(has the condition and tests negative)?
6P(does not have it | tests negative)?
7The test finds 90% of cases, yet P(has it | positive) is only 0.3191. Why?
8A new test: still 4% have it and 90% of them test positive. If P(positive) = 0.084, what is P(positive | does not have it)?
1
2
3
4
5
6
7
8
Show answer

1. 0.04 × 0.9 + 0.96 × 0.08 = 0.036 + 0.0768 = 0.1128. 2. 0.036 ÷ 0.1128 = 0.3191. 3. 0.96 × 0.92 = 0.8832. 4. 1000 × 0.1128 = 112.8, about 113. 5. 0.0040. Along the path: 0.04 × 0.1 = 0.0040 (a negative is 1 − 0.9 = 0.1 for those who have it). 6. 0.9955. P(negative) = 0.8832 + 0.0040 = 0.8872, so 0.8832 ÷ 0.8872 = 0.9955. 7. Most positives come from the many people without it: 0.0768 of everyone are false positives against 0.036 true ones. 8. 0.0500. Let it be p: 0.04 × 0.9 + 0.96p = 0.084, so 0.96p = 0.048 and p = 0.0500.

Worked example

The answers: questions 1 and 2

  1. 1. P(not C) = 1 − 0.04 = 0.96C: has the condition
  2. P(pos) = 0.04 × 0.9 + 0.96 × 0.08two positive paths
  3. = 0.036 + 0.0768multiply along
  4. = 0.1128add across
  5. 2. P(C | pos) = 0.036 ÷ 0.1128path ÷ total
  6. = 0.31914…
  7. = 0.31914 d.p.
Worked example

The answers: questions 3 and 4

  1. 3. P(neg | not C) = 1 − 0.08branches add to 1
  2. = 0.92
  3. P(not C and neg) = 0.96 × 0.92multiply along
  4. = 0.8832
  5. 4. expected = 1000 × P(pos)
  6. = 1000 × 0.1128
  7. = 112.8
  8. about 113 positiveswhole people
Your turn

Sample question: Achieved

70% of students at a Hamilton school catch the bus. 10% of bus students are late on a given day, and 25% of the other students are late. Find the probability that a randomly chosen student catches the bus and is late.

Hint

Draw the tree with bus first, then late or on time. "And" along a path means multiply.

Answer

P(bus and late) = 0.07

Step by step
  1. Start the tree with the first event: bus 0.7 and not bus 0.3. These add to 1.
  2. From the bus branch, draw late 0.1 and on time 0.9. From the not-bus branch, draw late 0.25 and on time 0.75.
  3. The 10% is only for bus students, so it goes on the bus branch. That is what "of bus students" means.
  4. We want bus and late, which is one path through the tree.
  5. Along a path, multiply: 0.7 × 0.1 = 0.07.
  6. The classic mistake is to give 0.1. That is the chance a bus student is late, not the chance a random student is a late bus student.
  7. Check: 0.07 is smaller than 0.7 and smaller than 0.1, as an "and" probability must be.
Full working
  1. P(bus) = 0.7, P(late given bus) = 0.1read from the tree
  2. P(bus and late) = 0.7 × 0.1multiply along the path
  3. P(bus and late) = 0.07
Your turn

Sample questions: Merit

1

70% of students at a Hamilton school catch the bus. 10% of bus students are late on a given day, and 25% of the other students are late. A student is late. Find the probability that they caught the bus.

Hint

Find P(late) by adding the two late paths, then divide the bus-and-late path by it.

Answer

P(bus given late) = 0.4828

Step by step
  1. Draw the tree: bus 0.7, not bus 0.3; then late 0.1 on the bus branch and late 0.25 on the other branch.
  2. "A student is late" is the given part. We only look at the paths that end in late.
  3. Bus and late: 0.7 × 0.1 = 0.07. Not bus and late: 0.3 × 0.25 = 0.075.
  4. Across paths, add: P(late) = 0.07 + 0.075 = 0.145.
  5. Working backwards: P(bus given late) = P(bus and late) ÷ P(late) = 0.07 ÷ 0.145.
  6. 0.07 ÷ 0.145 = 0.48276, so 0.4828.
  7. In words: although 70% catch the bus, only about 48% of late students are bus students, because bus students are rarely late.
  8. The classic mistake is to divide by 1 or by 0.7. The total is P(late), because "given late" restricts us to the late paths.
  9. Check: the late paths split as 0.4828 bus and 0.5172 not bus, and these add to 1.
Full working
  1. P(bus and late) = 0.7 × 0.1 = 0.07
  2. P(not bus and late) = 0.3 × 0.25 = 0.075
  3. P(late) = 0.07 + 0.075 = 0.145add across paths
  4. P(bus given late) = 0.07 ÷ 0.145the path ÷ the total
  5. P(bus given late) = 0.4828
2

A bag has 5 green and 3 yellow lollies. Mere takes two lollies without replacement. Find the probability they are the same colour. Given they are the same colour, find the probability they are both green.

Hint

Draw a tree where the second-draw numbers drop by one. Same colour is two paths: add them, then divide.

Answer

P(same colour) = 1328 = 0.4643; P(both green given same colour) = 1013 = 0.7692

Step by step
  1. First draw: green 58, yellow 38.
  2. Without replacement, 7 lollies are left for the second draw. After a green: green 47, yellow 37. After a yellow: green 57, yellow 27.
  3. Both green: 58 × 47 = 2056. Both yellow: 38 × 27 = 656.
  4. Same colour means green-green or yellow-yellow. They cannot both happen, so add: 2056 + 656 = 2656 = 1328 = 0.4643.
  5. For the second part, "given same colour" means we only look at those two paths.
  6. P(both green given same) = (2056) ÷ (2656) = 2026 = 1013 = 0.7692.
  7. There are more green lollies, so most same-colour pairs are green. 0.7692 makes sense.
  8. The classic mistake is to use 58 × 58 for both green. That puts the first lolly back in the bag.
  9. Check: green-green 20, green-yellow 15, yellow-green 15, yellow-yellow 6, all out of 56. 20 + 15 + 15 + 6 = 56.
Full working
  1. P(GG) = 58 × 47 = 2056without replacement
  2. P(YY) = 38 × 27 = 656
  3. P(same) = 2656 = 1328 = 0.4643add the two paths
  4. P(GG given same) = 2056 ÷ 2656 = 1013the path ÷ the total
  5. 0.4643 and 0.7692
Your turn

Sample questions: Excellence

1

A screening test for a condition gives a positive result for 95% of people who have the condition, and for 5% of people who do not. In a large town, 10% of people tested get a positive result. Find the proportion p of people tested who have the condition. Hence find the probability that a person with a positive result has the condition, and explain what this means for someone who tests positive.

Hint

Put p on the first branch and 1 − p on the other. Adding the two positive paths gives an equation equal to 0.1.

Answer

p = 118 = 0.0556; P(condition given positive) = 0.5278

Step by step
  1. The unknown is the first branch, so call P(condition) = p and P(no condition) = 1 − p.
  2. Second stage: positive 0.95 after condition, positive 0.05 after no condition.
  3. Multiply along the positive paths: 0.95p and 0.05(1 − p).
  4. Add across them and set equal to the given total: 0.95p + 0.05(1 − p) = 0.1.
  5. Expand: 0.95p + 0.05 − 0.05p = 0.1, so 0.9p = 0.05.
  6. p = 0.05 ÷ 0.9 = 118 = 0.0556. About 5.6% of people tested have the condition.
  7. Working backwards: P(condition given positive) = P(condition and positive) ÷ P(positive).
  8. P(condition and positive) = 0.95 × 118 = 0.052778. Divide by 0.1: 0.5278.
  9. Meaning: even with a positive result, there is only about a 53% chance the person has the condition. About 47% of positives are false alarms.
  10. Why: the condition is rare, so the 5% false positives from the large healthy group are almost as many as the true positives.
  11. So a positive result should lead to a second, more accurate test, not a diagnosis.
  12. Check: 0.95 × 0.0556 + 0.05 × 0.9444 = 0.0528 + 0.0472 = 0.1. Correct.
Full working
  1. P(C) = p, P(not C) = 1 − p
  2. 0.95p + 0.05(1 − p) = 0.1add the two positive paths
  3. 0.9p = 0.05, p = 118 = 0.0556
  4. P(C and pos) = 0.95 × 118 = 0.052778
  5. P(C given pos) = 0.052778 ÷ 0.1the path ÷ the total
  6. p = 0.0556; P(C given pos) = 0.5278
2

A bag holds n red balls and 3 blue balls, with more red than blue. Two balls are taken without replacement. The probability that they are the same colour is 12. Find n.

Hint

Write P(same colour) in terms of n from the tree. Set it equal to 12 and you get a quadratic.

Answer

n = 6

Step by step
  1. There are n + 3 balls at the start, and n + 2 after one is taken out.
  2. Both red: nn + 3 × n − 1n + 2 = n(n − 1)(n + 3)(n + 2).
  3. Both blue: 3n + 3 × 2n + 2 = 6(n + 3)(n + 2).
  4. Same colour is both red or both blue, so add: n(n − 1) + 6(n + 3)(n + 2) = 12.
  5. Cross-multiply: 2(n² − n + 6) = (n + 3)(n + 2).
  6. Expand both sides: 2n² − 2n + 12 = n² + 5n + 6.
  7. Collect everything on one side: n² − 7n + 6 = 0.
  8. Factorise: (n − 1)(n − 6) = 0, so n = 1 or n = 6.
  9. Both make the probability 12, but the question says there are more red than blue, so n = 1 is out. n = 6.
  10. Check n = 6: both red 69 × 58 = 3072, both blue 39 × 28 = 672. Total 3672 = 12. Correct.
  11. The classic mistake is to forget that the second denominator is n + 2, not n + 3.
Full working
  1. P(RR) = n(n − 1)(n + 3)(n + 2)without replacement
  2. P(BB) = 6(n + 3)(n + 2)
  3. 2(n² − n + 6) = (n + 3)(n + 2)set the sum equal to 12
  4. n² − 7n + 6 = 0, so (n − 1)(n − 6) = 0
  5. n = 1 or 6; more red than blue, so n = 6check: 3072 + 672 = 12
  6. n = 6

Challenge

1

A Christchurch bottling plant has two machines. Machine A fills 60% of the bottles and machine B fills the rest. 3% of machine A's bottles are faulty. Of all the faulty bottles, 40% come from machine B. Find the percentage of machine B's bottles that are faulty, and the probability that a randomly chosen bottle is faulty. Explain why your answer to the first part makes sense.

Hint

Put the unknown fault rate d on machine B's branch. Write P(B given faulty) as the B path ÷ the total of the faulty paths, and set it equal to 0.4.

Answer

Machine B: 3% faulty; P(faulty) = 0.03. Both machines have the same fault rate, so the faulty bottles split 60 to 40, just like all bottles.

Step by step
  1. Tree: A 0.6, B 0.4. Faulty after A is 0.03. Faulty after B is the unknown d.
  2. Faulty paths: A and faulty = 0.6 × 0.03 = 0.018, B and faulty = 0.4d.
  3. Working backwards: P(B given faulty) = 0.4d ÷ (0.018 + 0.4d) = 0.4.
  4. Multiply out: 0.4d = 0.0072 + 0.16d, so 0.24d = 0.0072 and d = 0.03. Machine B also makes 3% faulty bottles.
  5. P(faulty) = 0.018 + 0.4 × 0.03 = 0.03.
  6. It makes sense: B makes 40% of all bottles and 40% of the faulty ones, so B is no more or less likely to make a fault. The machine and being faulty are independent.
Full working
  1. P(A and F) = 0.6 × 0.03 = 0.018multiply along
  2. P(B and F) = 0.4d
  3. 0.4d ÷ (0.018 + 0.4d) = 0.4the path ÷ the total
  4. 0.4d = 0.0072 + 0.16d, so 0.24d = 0.0072
  5. d = 0.03
  6. P(F) = 0.018 + 0.012 = 0.03add across
  7. machine B: 3% faulty; P(faulty) = 0.03
2

In Wellington, if it rains on a day, the probability that it rains the next day is 0.6. If a day is dry, the probability that it rains the next day is 0.2. It rains on Monday. Find the probability that it rains on Wednesday, and the probability that it rains on exactly one of Tuesday, Wednesday and Thursday. Given that it rains on Wednesday, find the probability that it also rained on Tuesday.

Hint

Draw a tree with a stage for Tuesday, Wednesday and Thursday. The branch probabilities on each stage depend on the day before, so after a rainy day use 0.6 and 0.4, after a dry day use 0.2 and 0.8.

Answer

P(rain on Wednesday) = 0.44; P(rain on exactly one of the three days) = 0.288; P(rain on Tuesday given rain on Wednesday) = 911 ≈ 0.8182

Step by step
  1. Tuesday follows a rainy Monday: rain 0.6, dry 0.4.
  2. Wednesday: rain after rain is 0.6 × 0.6 = 0.36, rain after dry is 0.4 × 0.2 = 0.08. So P(rain Wednesday) = 0.36 + 0.08 = 0.44.
  3. Exactly one rainy day has three paths. Rain, dry, dry: 0.6 × 0.4 × 0.8 = 0.192. Dry, rain, dry: 0.4 × 0.2 × 0.4 = 0.032. Dry, dry, rain: 0.4 × 0.8 × 0.2 = 0.064.
  4. Add across: 0.192 + 0.032 + 0.064 = 0.288.
  5. Working backwards: P(rain Tuesday given rain Wednesday) = 0.36 ÷ 0.44 = 911 ≈ 0.8182.
  6. The classic mistake is to use 0.6 for every branch. After a dry day the chance of rain drops to 0.2, so each branch must use the day before it.
Full working
  1. Tuesday: rain 0.6, dry 0.4Monday was rainy
  2. P(R, R) = 0.6 × 0.6 = 0.36; P(D, R) = 0.4 × 0.2 = 0.08multiply along
  3. P(rain Wednesday) = 0.36 + 0.08 = 0.44add across
  4. RDD 0.6 × 0.4 × 0.8 = 0.192; DRD 0.4 × 0.2 × 0.4 = 0.032; DDR 0.4 × 0.8 × 0.2 = 0.064
  5. P(exactly one) = 0.192 + 0.032 + 0.064 = 0.288add across
  6. P(rain Tuesday given rain Wednesday) = 0.36 ÷ 0.44 = 911the path ÷ the total
  7. 0.44; 0.288; 911 ≈ 0.8182
3

Bag A holds 3 red and 2 blue marbles. Bag B holds 2 red and 3 blue. Tama rolls a die: on a 1 or 2 he uses bag A, otherwise bag B. He takes two marbles from that bag without replacement. Given that both marbles are red, find the probability he used bag A. Then, given only that the first marble is red, find the probability the second is red too.

Hint

The first stage of the tree is the bag, with 13 and 23. For the second part, P(second red given first red) = P(both red) ÷ P(first red), and the first red can come from either bag.

Answer

P(bag A given both red) = 35 = 0.6; P(second red given first red) = 514 ≈ 0.3571

Step by step
  1. P(A) = 26 = 13 and P(B) = 23.
  2. Both red from A: 35 × 24 = 310. Both red from B: 25 × 14 = 110.
  3. P(both red) = 13 × 310 + 23 × 110 = 110 + 115 = 16. So P(A given both red) = (110) ÷ (16) = 35.
  4. P(first red) = 13 × 35 + 23 × 25 = 15 + 415 = 715.
  5. P(second red given first red) = (16) ÷ (715) = 1542 = 514 ≈ 0.3571.
  6. The classic mistake is to pick one bag's numbers. A red first marble makes bag A more likely, so both bags must stay in the calculation.
Full working
  1. P(A) = 13, P(B) = 23die: 1 or 2 out of 6
  2. P(A, R, R) = 13 × 35 × 24 = 110without replacement
  3. P(B, R, R) = 23 × 25 × 14 = 115
  4. P(R, R) = 110 + 115 = 16, so P(A given R, R) = 110 ÷ 16 = 35
  5. P(first R) = 13 × 35 + 23 × 25 = 715add across
  6. P(second R given first R) = 16 ÷ 715 = 514the path ÷ the total
  7. 35 = 0.6; 514 ≈ 0.3571

More challenge problems

Practice

Practise this

Worksheet with answersWithout answersDownload PDF
2026 practice paper with worked answersOpen the paper
Report a mistake

More in AS 91267

Is your child on track?

Take the free placement test