Bayes' Theorem (AA HL)
Bayes' theorem answers a question conditional probability alone can't: given the result of a test, what's the probability of the underlying cause? It reverses a conditional probability you already know into the one you actually want - the classic "positive test result, probability of actually having the condition" problem. It's part of the broader Probability topic.
13 questions on this sub-topic.
Reversing a conditional probability
Covered under IB syllabus reference AHL4.13: use of Bayes' theorem for a maximum of three events - building on the conditional probability and independence work from SL4.6.
Bayes' theorem
\[P(B\mid A)=\dfrac{P(A\mid B)P(B)}{P(A)}\]
Given a test result, find the probability of the underlying cause - the classic "positive test, actually has the condition" question.
Not in the formula booklet - prior knowledgeFinding \(P(A)\) first
Bayes' theorem needs \(P(A)\) in the denominator. Usually you don't have it directly - build it with the law of total probability, summing \(P(B_i)P(A\mid B_i)\) over every way \(A\) can happen.
Need the full syllabus wording and formula-booklet reference table? See Probability.
Worked examples
Event \(A\) has \(P(A) = 0.3\). Event \(B\) is such that \(P(B|A) = 0.8\) and \(P(B|A\prime) = 0.2\).
(a) Find \(P(B)\).
(b) Find \(P(A|B)\), giving your answer as a fraction.
Worked solution
(a) \(P(B) = P(B|A)P(A) + P(B|A\prime)P(A\prime)\) M1
\(= 0.8(0.3) + 0.2(0.7) = 0.24 + 0.14 = 0.38\) A1
(b) \(P(A|B) = \dfrac{P(B|A)P(A)}{P(B)}\) M1
\(= \dfrac{0.24}{0.38}\) M1
\(= \dfrac{12}{19}\) A1
A test is 95% accurate. 2% of people have a disease. If someone tests positive, find the probability they actually have it.
Worked solution
\(D\) = has disease, \(+\) = positive. \(P(D)=0.02,\ P(+|D)=0.95,\ P(+|D')\) M1 \(=0.05.\) A1
\(P(+) = 0.95(0.02) + 0.05(0.98)\) M1 \(= 0.068.\) A1
\(P(D|+) = \dfrac{0.019}{0.068}\) M1 \(\approx 0.279.\) A1
Common mistakes
- Mixing up \(P(A\mid B)\) and \(P(B\mid A)\). These are generally different numbers - "given it rained, the probability the match was cancelled" is not the same as "given the match was cancelled, the probability it rained". Bayes' theorem exists specifically to convert between them.
- Skipping the law of total probability for \(P(A)\). The denominator of Bayes' theorem is rarely given outright - it has to be built by summing \(P(B_i)P(A\mid B_i)\) over every branch, or the whole calculation falls apart.
- Rounding intermediate values too early. A test-accuracy problem often produces awkward decimals like \(0.068\) - carry full precision (or exact fractions) through to the final division, since early rounding shifts the final probability noticeably.
Ready to practise properly?
11 Bayes' theorem questions, marked instantly like the real exam.
Quick answers
What is Bayes' theorem?
\(P(B\mid A)=\dfrac{P(A\mid B)P(B)}{P(A)}\). It lets you reverse a conditional probability - work out \(P(B\mid A)\) when you're given \(P(A\mid B)\) instead.
Is Bayes' theorem in the formula booklet?
No. It has to be derived from the conditional probability formula each time, usually by first finding \(P(A)\) with the law of total probability. For calculator tips, see the Probability GDC section.