Bayes' theorem AA HL
Bayes' theorem answers a reversed question: given that an outcome has happened, how likely is it that it came from a particular cause? The method is always the same: build the probability of the outcome from every route that leads to it, then find the share that comes from the cause you want. This page uses a tree diagram for up to three events, and a two-way table when the data come as percentages or counts. Most of the arithmetic is by hand, so practise without a calculator.
Formulas at a glance
Conditional probability, Bayes' theorem and the rule for independent events are in the formula booklet. The multiplication form and the law of total probability are not listed there, so learn them: Bayes' theorem needs both.
Conditional probability
In the bookletMultiplication form
Not in the bookletLaw of total probability, two events
Not in the bookletLaw of total probability, three events
Not in the bookletBayes' theorem
In the bookletIndependent events
In the bookletWhich method to use
Decide first which way the condition runs. A probability that is given for each cause is a forward condition; a question that says "given that" the outcome happened and asks about the cause is a reversed one, and needs Bayes' theorem.
| The question has | Use | Notes |
|---|---|---|
| A probability of both events, and a conditional probability is wanted | Divide by the probability of the event that is given | |
| Conditional probabilities for each cause, and the overall probability of an outcome | A tree diagram: multiply along each route to the outcome, then add the routes | The branches from each point must add to 1 |
| An outcome has happened, and the probability of an earlier cause is wanted | Bayes' theorem: | The denominator is the total probability of the outcome, from the tree |
| Three possible causes | A third branch at the first stage; the same total probability, with three terms | The three first-stage probabilities add to 1, so find a missing one by subtraction |
| Percentages or numbers of people instead of probabilities | A two-way table, using a convenient total such as 1000 | Read the conditional probability as one cell over the row or column total that is given |
| Items drawn one after another without replacement | A tree whose second-stage probabilities change after the first draw | The second-stage numbers have a smaller total |
| Whether two events are independent | Test whether , or whether | Show both sides with numbers, then state the conclusion |
Bayes' theorem
Bayes' theorem reverses a conditional probability: given , it finds using . The denominator comes from the law of total probability, by adding the probabilities of reaching along every branch of a tree diagram. It is used with up to three events, and a tree diagram keeps the given probabilities organised. A worked example with a tree diagram and three possible causes is included.
Reversing a conditional probability
Bayes' theorem
Given a test result, find the probability of the underlying cause - the classic "positive test, actually has the condition" question.
In the formula bookletFinding first
Bayes' theorem needs in the denominator. Usually you don't have it directly - build it with the law of total probability, summing over every way can happen.
Key terms
What is the law of total probability?
It finds by adding every way can happen: .
e.g. If , and , then .
How does a tree diagram help with Bayes' theorem?
Multiply along the path through and then to get the numerator. Add the products for every path that ends in to get the denominator.
e.g. Using the probabilities above, .
What is a reversed conditional probability?
and answer different questions, and Bayes' theorem links them. The first asks for the cause given the effect, the second for the effect given the cause.
e.g. A test that detects a condition in of people who have it gives , not .
What does A' represent on a tree diagram?
is the complement of , meaning does not happen, and . It gives the second branch at the first stage.
e.g. If , then .
Worked example, step by step
The question No calculator needed [4 marks]
A factory has three machines, , and . Machine makes of the bolts, machine makes and machine makes . The proportions of bolts that are faulty are for machine , for machine and for machine . A bolt is chosen at random.
(a) Find the probability that the bolt is faulty.
(b) Given that the bolt is faulty, find the probability that it was made by machine . Give your answer as a fraction.
Worked solution: worked example
Answer: (a) (b)
Step 1 - Set up the three branches.
Let be the event that the bolt is faulty. At the first stage, , and . At the second stage, , and .
Why? A tree has one branch for each machine, and from each machine one branch for faulty and one for not faulty. The first-stage probabilities add to , which checks the set-up.
Step 2 - Multiply along each route to a faulty bolt.
M1 - Multiply the probabilities along each of the three routes to a faulty bolt
Why? A route through the tree is a sequence of events, so its probability is the product of the probabilities on its branches. Only the three routes that end in a faulty bolt matter for this question.
Step 3 - Add the routes.
A1 -
Why? A faulty bolt can come from machine , or , and these cases cannot overlap, so their probabilities are added. This is the law of total probability.
Step 4 - Write Bayes' theorem for machine .
M1 - Use with their
Why? The question is reversed: the condition is the faulty bolt, and the unknown is the machine. The top is the route through , and the bottom is the total probability from part (a).
Step 5 - Write the answer as a fraction.
A1 -
Why? Multiplying the top and the bottom by removes the decimals. The fraction cannot be reduced further, because is prime and does not divide .
M1 Multiply the probabilities along each of the three routes to a faulty bolt
A1
M1 Use with their
A1
Now you try: enter your answers to be marked
These are real practice questions. Type your answer in each box and press Mark it. The worked solution and mark scheme appear straight away, and your first attempt is the one that counts. Use the keyboard for powers, roots and trig, and the working box for your notes.
Worked solution: practice question 1
An email arrives containing the word "prize". Find the probability that it is spam.
Worked solution: practice question 2
Worked solution: practice question 3
Your score so far: 0 out of 15 marks
Common mistakes
- Mixing up and . 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 . The denominator of Bayes' theorem is rarely given outright - it has to be built by summing over every branch, or the whole calculation falls apart.
- Rounding intermediate values too early. A test-accuracy problem often produces awkward decimals like - carry full precision (or exact fractions) through to the final division, since early rounding shifts the final probability noticeably.
Syllabus content covered
| Code | Syllabus content |
|---|---|
| AHL4.13 | Use of Bayes' theorem for a maximum of three events, building on independent events from SL4.6. |
Official IB source: Mathematics: analysis and approaches subject brief (PDF, ibo.org).
Quick questions
What is Bayes' theorem?
. It lets you reverse a conditional probability - work out when you're given instead.
Why do I need Bayes' theorem instead of just the conditional probability formula?
Because is usually not given directly. You know , so you find , then divide by .
Why can the probability of having a condition be low even after a positive test?
If the condition is rare, the many people without it who test positive can outnumber the few who truly have it, so can be low even for an accurate test.
How can I check that my Bayes' theorem answer is sensible?
It must lie between and , and must equal .
Ready to practise properly?
Practice questions on every section, marked instantly like the real exam.