Bayes' theorem word problems: medical tests, spam and witnesses
A test that is 95% accurate can still give mostly false alarms when the illness is rare. Bayes' theorem turns P(positive | ill) round into P(ill | positive) by weighing every way a positive result can happen.
Imagine 10 000 people: count the ill positives and the well positives, then divide.
Two positive tests: apply the rule twice, the first answer becoming the new P(ill).
The same rule finds the box, coin or die most likely to have given a result.
Watch out: The false positive rate is P(+ | well), not P(well | +).
Practise this step
5 questions from this step only, in 8 minutes: new numbers and
stories every time, of exactly the types worked out below. Marked at the end, with every question
worked out.
9 types of question. Try each one yourself before you open
the hint or the solution.
Example 1 · level 8
A town tests all of its 40,000 people for an illness that 2% of them have. The test is positive for 98% of the people who have the illness and for 3% of those who do not. What fraction of the positive results, as a decimal, belongs to people who do not have the illness?
Hint
Count the people: first ill and not ill, then the positives in each group.
Positive: 98% × 800 = 784 ill and 3% × 39,200 = 1176 not ill, 1960 in all
1176/1960 = 0.6
Answer: 0.6
Example 2 · level 9
Box A holds 8 balls, of which 4 are red; box B holds 10 balls, 7 of them red; box C holds 5 balls, 4 of them red. One of the boxes is picked at random, and a ball is taken from it at random. The ball is red. What is the probability that it came from box A?
Hint
Each box is picked with probability one third, so the third cancels: compare the shares of red.
Worked solution
Red from each box: 4/8 = 0.5, 7/10 = 0.7, 4/5 = 0.8
Together: 0.5 + 0.7 + 0.8 = 2
Box A given red: 0.5/2 = 0.25
Answer: 0.25
Example 3 · level 9
A disease affects 4% of the people in a country. A test for it is positive for 91% of the people who have the disease, and also for 10% of the people who do not. A person tests positive. What is the probability, as a percentage to one decimal place, that this person has the disease?
Hint
Two kinds of people test positive: the ill ones the test finds, and the healthy ones it wrongly flags.
Worked solution
Ill and positive: 0.04 × 0.91 = 0.0364
Healthy and positive: 0.96 × 0.1 = 0.096
Ill given positive: 100 × 0.0364/(0.0364 + 0.096) ≈ 27.5%
Answer: 27.5%
Example 4 · level 9
Of the emails that reach an inbox, a share of 0.15 is spam. The word "prize" appears in spam with probability 0.34, and in other emails with probability 0.09. An email contains the word "prize". What is the probability that it is spam?
Hint
Find how often the word appears at all; spam with the word is one part of it.
Worked solution
Spam with the word: 0.15 × 0.34 = 0.051
Other email with the word: 0.85 × 0.09 = 0.0765
Spam given the word: 0.051/(0.051 + 0.0765) = 0.051/0.1275 = 0.4
Answer: 0.4
Example 5 · level 9
In a city, 13% of the taxis are green and the rest are blue. A witness to an accident says the taxi was green. Tested in the same light, the witness names the colour of a taxi correctly 87% of the time. What is the probability that the taxi was green?
Hint
The witness says green for green taxis named right and for blue taxis named wrong.
Worked solution
Green and said green: 13% × 87% = 0.1131
Blue and said green: 87% × 13% = 0.1131
Green given said green: 0.1131/(0.1131 + 0.1131) = 0.1131/0.2262 = 0.5
Answer: 0.5
Example 6 · level 10
A box holds 7 fair dice and 2 loaded ones; a loaded die shows a six with probability 0.3. A die is taken at random and rolled twice, and it shows a six both times. What is the probability, as a percentage to one decimal place, that the die is loaded?
Hint
Weigh each kind of die by how many there are and by its chance of two sixes; a fair die gives two sixes once in 36.
Worked solution
Loaded and two sixes, as a weight: 2 × 0.3² = 2 × 0.09 = 0.18
Fair and two sixes: 7/36
Loaded given two sixes: 100 × 0.18/(0.18 + 7/36) ≈ 48.1%
Answer: 48.1%
Example 7 · level 10
A disease affects 7% of the people who come to a clinic. A test for it is positive for 95% of the people who have the disease, and also for 10% of the people who do not. A patient tests negative. What is the probability, as a percentage to one decimal place, that this patient has the disease after all?
Hint
A negative result comes from the ill people the test misses and from the healthy people it clears.
Worked solution
Ill and negative: 0.07 × 0.05 = 0.0035
Healthy and negative: 0.93 × 0.9 = 0.837
Ill given negative: 100 × 0.0035/(0.0035 + 0.837) ≈ 0.4%
Answer: 0.4%
Example 8 · level 10
A bag holds 12 fair coins and 2 coins with heads on both sides. A coin is taken at random and tossed 2 times; it lands heads every time. What is the probability that it is a two-headed coin?
Hint
A fair coin gives all heads with probability one half to the power of the number of tosses; a two-headed coin always does. Weigh each by how many coins there are.
Worked solution
All heads, as a weight: 2 × 1 for two-headed coins and 12 × 1/4 for fair ones
Times 4: 2 × 4 = 8 against 12
8/(8 + 12) = 8/20 = 0.4
Answer: 0.4
Example 9 · level 10
A disease affects 6% of the people in a country. A test for it is positive for 98% of the people who have the disease, and also for 4% of the people who do not. A person tests positive, and a second test, independent of the first, is positive too. What is the probability, as a percentage to one decimal place, that this person has the disease?
Hint
For two independent positives, multiply each kind of person's chance of a positive twice.
Worked solution
Ill and two positives: 0.06 × 0.98 × 0.98 = 0.057624
Healthy and two positives: 0.94 × 0.04 × 0.04 = 0.001504
Ill given two positives: 100 × 0.057624/(0.057624 + 0.001504) ≈ 97.5%
Answer: 97.5%
Ready for the quiz?
Check yourself on this step: 5 questions, 8 minutes.