KS Maths
Topic 4.13 · AA Higher Level

Bayes' theorem

A 99% accurate test, and you probably do not have it.

The base rate fallacy, shown with a thousand people, and the theorem that gets it right.

Words you need (10 key words in this lesson)

The maths words this lesson uses, in plain English. Open this before you start if English is not your first language.

theorem
A maths rule that has been proved to be true.Pythagoras' theorem is a famous theorem.
positive
Greater than zero.7 is a positive number.
probability
How likely it is that something happens, from 0 to 1.The probability of heads is one half.
add
Put numbers together to find the total.Add 3 and 4 to get 7.
chance
How likely something is to happen.There is a good chance of rain.
conditional probability
The probability of an event given that another event has happened.The probability of rain given that it is cloudy.
negative
Less than zero. A negative number has a minus sign.Minus 4 is a negative number.
base
The number that is multiplied in a power. Also, the bottom side of a shape.In 2 to the power 5, the base is 2.
predict
Say what you think will happen using the data.Predict the score for 5 hours of study.
outcome
One possible result.Heads is one outcome of a coin toss.

Preview You are reading the start of this lesson. The rest opens with a plan. See plans Already paid? Sign in

Warm-up

Four quick ones from earlier work. Try each on paper before you open the answer.

  1. Machine P makes 60% of the items in a factory and 3% of its items are faulty. Machine Q makes the other 40% and 5% of its items are faulty. What is the probability that an item chosen at random is faulty?
    Answer

    0.6 × 0.03 + 0.4 × 0.05 = 0.018 + 0.02 = 0.038. Add the routes: each branch is a product of the two probabilities along it.

  2. A test gives a positive result for 2% of healthy people. What is the probability that a healthy person tests negative?
    Answer

    0.98. Given the same condition (healthy), the two outcomes add to 1. The slip is subtracting from the wrong thing, such as using the sensitivity.

  3. P(A ∩ B) = 0.12 and P(B) = 0.3. Find P(A | B).
    Answer

    0.12 ÷ 0.3 = 0.4. You divide by the probability of the event you were told, here B.

  4. The probabilities of a set of causes that cover every case are 0.35, 0.45 and x. Find x.
    Answer

    x = 1 − 0.35 − 0.45 = 0.2. Causes that cover every case must add to 1; this is the check the lesson uses on the answers.

Words used in this lesson
prevalence (base rate)
how common the condition is in the whole group. For example: if 5 people in 1000 have it, the prevalence is 0.005.
sensitivity
the chance the test is positive for someone who does have the condition. For example: a test that finds 9 out of every 10 sick people has sensitivity 0.9.
specificity
the chance the test is negative for someone who does not have it. For example: a specificity of 0.97 means 3 in 100 healthy people get a false alarm.
false positive
a positive result for someone who does not have the condition. For example: a fire alarm that rings when there is no fire.
partition
events that do not overlap and between them cover every possibility. For example: “it is Monday”, “it is Tuesday” and so on, for the days of the week.
prior and posterior
the probability before you know the result, and after. For example: P(D) is the prior; P(D | +) is the posterior.
total probability
adding every route to an outcome, each route a product. For example: P(late) = P(rain)P(late | rain) + P(dry)P(late | dry).
given that
you are told this has already happened, so only those cases count. For example: “given that the test is positive”.
interpret
say what the number means in the situation, in words. For example: “about 1 in 25 positives are real” is an interpretation.
hence
use the result you have just found. For example: “find P(B), and hence find P(A | B)”.

Predict first. Before you slide: as the prevalence rises from 1 in 1000, the number of people with the condition (and so true positives) rises. What do you expect to happen to the number of false positives: more, fewer, or about the same? Give a reason.

Then check

Now raise the prevalence and watch both counts in the readouts, not just the verdict. Does the false-positive count do what you predicted? If it surprised you, work out why from how many healthy people there are.

Higher Level

A thousand people. A disease, and a test that is right 99% of the time both ways. Every dot that tested positive is coloured. Slide the prevalence and watch which colour there is more of.

one thousand people● tested positive, healthy● tested positive, has it
1true positives
10false positives
9.1%P(disease | positive)

10 of the 11 positives are wrong. There are simply far more healthy people available to get wrong, and 1% of a large number beats 99% of a tiny one.

Why a good test gives a bad answer

There are far more healthy people to get wrong. At 1 in 1000, one person in a thousand has it and the test finds them. The other 999 are healthy, and 1% of 999 is about 10 false alarms. So about 10 of the 11 positives are wrong, and a positive result means roughly a 9% chance, not 99%.

P(D)= 0.001 the base rate, or prevalence P(+ | D)= 0.99 sensitivity P(+ | D′)= 0.01 1 − specificity P(+)= 0.001(0.99) + 0.999(0.01) = 0.01098 P(D | +)= 0.001 × 0.990.01098 = 0.0902

The rest of this lesson is in the full course

Still to come in this lesson:

In the full lesson every figure moves as you drag it, and every answer you type is checked, with a note on what each wrong answer means.

IB Diploma plan: AA HL$99Every Diploma lesson in both courses and both levels, so a change of course never locks you out, and every lesson from Year 7 for the refreshers. $99 for 12 months or $149 for 2 years.

One plan opens every Diploma lesson, AA and AI, SL and HL, for the whole family.

One payment. Nothing renews. Full refund within 30 days. Prices are in US$; Gumroad shows your local currency at checkout. Pay by card on Gumroad, then come back here and type the email you paid with: we email you a sign-in link. For a refund, reply to your Gumroad receipt or email hello@ksmaths.com.

Try a free sample lesson in every unit, and the whole Skill Tree. See this unit.

Already have a revision pack or the Years 7 to 11 plan? Move up and the unused part of what you paid comes off.

Teaching students who need extra support? Student codes for 5, 10 or 30 students.

AA HL Mock Exam Pack, $25BuyPlan $99