Free access until 31 December 2026 · Physics and Maths questions and notes, updated continuously · Build a test

4 · IB Maths

Tree diagrams and Bayes’ theorem

Multiply along the branches, add down the leaves, then run the tree backwards: given a positive test, how likely is the disease? The answer surprises almost everyone.

Predict first

Start from the default settings (P(A) = 0.30). If you raise P(A) to 0.60 and leave the other sliders alone, what happens to P(A | B)?

A branches A′ branches

Presets
along a path: multiply
P(B) = P(A)P(B|A) + P(A′)P(B|A′)
P(A|B) = P(A)P(B|A) ÷ P(B)

Try this

  1. Press Medical test shock and read P(A | B). Then tick the counts box and explain the answer using the 1000 people.
  2. Keep P(B | A) = 0.80 and P(B | A′) = 0.20, and raise P(A) from 0.05 to 0.50. How does P(A | B) change?
  3. Set P(B | A) equal to P(B | A′). What happens to P(A | B) compared with P(A), and why do we call A and B independent?

Exam tip: Along a path multiply, between paths that end in the same outcome add, and write P(B) = P(A)P(B|A) + P(A′)P(B|A′) before dividing, because that sum is the denominator in Bayes’ theorem.