IB Mathematics: Analysis and Approaches · Topic 4 · Statistics and probability
4.13 Bayes' theorem
Apply Bayes’ theorem to update probabilities after new information, using tree diagrams, and interpret the results in context.
1/5New evidence lets us revise an initial probability
- New evidence lets us revise an initial probability
- The law of total probability adds every route to an outcome
- Bayes’ theorem reverses the direction of conditioning
- A tree diagram organises every step of the calculation
- Posterior probabilities can be much smaller than expected
- Check your recall
- Practice: 10 questions
Part 1 of 5: New evidence lets us revise an initial probability
A medical test for a rare condition gives a positive result. You want the chance that the person really has the condition. That differs from the chance that someone with the condition tests positive, which is what the test’s makers measure.
The probability held before the evidence is the prior probability. The updated probability after the evidence is the posterior probability. Both are ordinary probabilities, and only the information behind them differs. The rule that links them reverses the direction of a conditional probability. It lets evidence point back to its likely cause.
Key terms · tap one for its definition
prior probability
A prior probability is the probability assigned to an event before new evidence is observed, such as .
posterior probability
A posterior probability is the conditional probability of an event given the new evidence, such as .
Part 2 of 5: The law of total probability adds every route to an outcome
To update a probability we first need the overall chance of the evidence. Let be the event that does not occur, so . The evidence can happen after or after , and in no other way.
The law of total probability adds the two routes: . Each term is the chance of reaching by one route. A tree diagram shows these routes as separate paths.
Worked example
Total probability of a defect
- Via machine A: .
- Via machine B: .
- Add the two routes: .
Answer: .
The same method extends to more than two causes. List every cause, weight each route by its probability, and add all the routes.
Key term
law of total probability
The law of total probability states that for any event with complement .

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: C · Worked explanation
Part 3 of 5: Bayes’ theorem reverses the direction of conditioning
Now suppose an item is found to be defective. We want the reverse probability, that it came from machine A. Start from and replace by .
This gives Bayes’ theorem: . Write the denominator using total probability, so that . The numerator is one route to the evidence, and the denominator is every route. The answer is the fraction of all routes that pass through .
Worked example
Which machine made the defective item
- Numerator: .
- Denominator: .
- Divide: .
Answer: .
Notice that the posterior of 0.375 is lower than machine A’s share of production, 0.6. Machine B makes fewer items but is more often faulty, so a defect points towards it.
Key term
Bayes’ theorem
Bayes’ theorem states that for , linking a conditional probability to its reverse.
Part 4 of 5: A tree diagram organises every step of the calculation
Substituting into the formula works, but a tree diagram keeps the numbers tidy. Use the same layout every time, and label every branch before you multiply.
- Draw first branches for the causes, with prior probabilities.
- Draw second branches for the evidence, with conditional probabilities.
- Multiply along each path to get joint probabilities.
- Add the paths that end in the observed evidence.
- Divide the path through the cause of interest by that total.
Worked example
Probability of a condition after a positive test
- Condition and positive: .
- No condition and positive: .
- Total positive: .
- .
Answer: The probability is .
The tree makes each term visible. You can see that most positive results come from the larger branch, where the condition is absent.

Quick check
One question on the part you just read
Easy
Show answer and explanation
Answer: D · Worked explanation
Part 5 of 5: Posterior probabilities can be much smaller than expected
The result 0.161 may seem low for a test that detects 95% of cases. The prior was only 0.01. Healthy people are so numerous that their false positives outnumber the true positives. This happens even though each healthy person is unlikely to test positive.
Three different probabilities from the same test
- Probability
- Meaning
- prior probability of the condition
- Value
- 0.01
- Probability
- Meaning
- chance that a case tests positive
- Value
- 0.95
- Probability
- Meaning
- posterior after a positive test
- Value
- ≈ 0.161
A larger prior gives a larger posterior. Here stands for the condition and pos for a positive test. The posterior also depends on how often healthy people test positive.
Check your recall[14 marks]
5 written questions. Answer each one in your head or on paper, then open the mark scheme.
- 1.State[2 marks]
State Bayes’ theorem for events and with , including an expansion of .
Show mark schemeHide mark scheme
Model answer
, where .
- 1 mark for writing
- 1 mark for expanding as
- 2.Calculate[4 marks]
Calculate to 3 significant figures, given , and .
Show mark schemeHide mark scheme
Model answer
and , so . Then .
- 1 mark for finding
- 1 mark for finding and adding to obtain
- 1 mark for dividing 0.24 by 0.31
- 1 mark for obtaining 0.774
- 3.Explain[3 marks]
Explain why, for a rare condition , the probability can be small even when is large.
Show mark schemeHide mark scheme
Model answer
Because is rare, the prior is small. Most people do not have , so even a small false-positive rate gives many positive results among them. These false positives can outnumber the true positives, so the posterior is small.
- 1 mark for stating that the prior probability of is small
- 1 mark for explaining that many people without the condition still test positive
- 1 mark for concluding that false positives can outnumber true positives, so the posterior is small
- 4.Distinguish[2 marks]
Distinguish between a prior probability and a posterior probability.
Show mark schemeHide mark scheme
Model answer
A prior probability is held before new evidence is seen, such as . A posterior probability is the conditional probability after the evidence, such as .
- 1 mark for stating that a prior probability is the probability before the evidence
- 1 mark for stating that a posterior probability is the conditional probability after the evidence
- 5.Outline[3 marks]
Outline how a tree diagram is used to find a posterior probability.
Show mark schemeHide mark scheme
Model answer
Draw first branches for the causes with prior probabilities, then second branches for the evidence with conditional probabilities. Multiply along each path and add the paths ending in the evidence. Divide the path through the cause of interest by that total.
- 1 mark for drawing branches for causes then evidence with the correct probabilities
- 1 mark for multiplying along paths and adding those that end in the evidence
- 1 mark for dividing the path of interest by the total

Practice this topic
10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)
0 right0 of 10 answered
Includes the 2 quick checks in the note above.
EasyState[1 mark]
Show answer and explanation
Answer: B · Worked explanation
MediumCalculate[2 marks]
Show answer and explanation
Answer: D · Worked explanation
MediumCalculate[2 marks]
Show answer and explanation
Answer: B · Worked explanation
MediumCalculate[2 marks]
Show answer and explanation
Answer: B · Worked explanation
Medium[2 marks]
Show answer and explanation
Answer: A · Worked explanation
HardCalculate[2 marks]
Show answer and explanation
Answer: B · Worked explanation
HardCalculate[2 marks]
Show answer and explanation
Answer: D · Worked explanation
HardCalculate[2 marks]
Show answer and explanation
Answer: B · Worked explanation