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)?
P(A|B) = P(A)P(B|A) ÷ P(B). At 0.30 it is 0.24 ÷ 0.38 = 0.632; at 0.60 it is 0.48 ÷ 0.56 = 0.857, so a larger base rate raises it.
Check it in the model: Move the P(A) slider from 0.30 to 0.60 and compare P(A | B) Bayes in the readout.
A branches A′ branches
P(B) = P(A)P(B|A) + P(A′)P(B|A′)
P(A|B) = P(A)P(B|A) ÷ P(B)
Try this
- Press Medical test shock and read P(A | B). Then tick the counts box and explain the answer using the 1000 people.
- 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?
- 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.
More on 4: Venn diagrams and conditional probability · Discrete random variables · Continuous random variables · Bayes' theorem: medical test · Standard deviation and outliers · Binomial distribution · Markov chains · The normal distribution · Poisson distribution · Scatter and regression · Box plots and histograms