Statistics & Probability · Grades 11, 12
Bayes' Theorem: Updating Probabilities with Evidence
Quick answer
Bayes' theorem reverses a conditional probability: from how likely the evidence is when a cause is present, it finds how likely the cause is once the evidence is seen. P(A | B) = P(B | A) · P(A) / P(B), where P(B) adds up every way B can happen. Counting a large imaginary group, the natural frequency method, makes the same calculation concrete and shows why a rare condition plus a small error rate produces many false alarms.
What you'll learn
- State and apply Bayes' theorem
- Find a total probability by adding the ways an event can happen
- Use natural frequencies to check a Bayes calculation
- Explain the base-rate effect in medical and quality testing
Reversing a conditional probability
A disease affects of people. A test detects it of the time, and gives a false positive for of healthy people. You test positive. How likely is it that you have the disease?
The test’s accuracy is . The question asks for the reverse, . Conditional probabilities are not symmetric, and Bayes’ theorem converts one into the other:
The denominator adds every way to test positive, the sick and the healthy:
So . Despite the positive result, the chance of having the disease is about .
Why the answer is so low: count a crowd
Picture people.
| Test positive | Test negative | Total | |
|---|---|---|---|
| Have the disease | |||
| Healthy | |||
| Total |
Of the positives, only are sick: . The test’s error rate is small, but it applies to a huge group of healthy people, so the false positives outnumber the true ones. This is the base-rate effect: the rarer the condition, the more a positive result is likely to be a false alarm. The formula and the crowd are the same calculation, and the crowd is often the clearer way to see it.
Worked examples
Common mistakes
Practice problems
-
A condition affects of people. A test catches of cases and falsely flags of healthy people. Find .
Answer
Full solution
.
-
of emails are spam. A word appears in of spam and of other emails. An email contains the word. What is the chance it is spam?
Answer
About
Full solution
.
-
of items are defective. An inspection flags of defective items and of good ones. An item is flagged. What is the chance it is defective?
Answer
About
Full solution
.
-
In the opening example, out of people, how many test negative but are sick?
Answer
Full solution
Of the sick, test positive, so test negative.
-
In Example 1, what is the chance a defective part came from machine A?
Answer
Full solution
, or .
-
Explain why rises if the disease becomes more common, with the same test.
Answer
More true positives come from the larger sick group, and fewer false ones from the smaller healthy group.
Full solution
With prevalence the same test gives , compared with at .
-
In Example 3, a blue ball is drawn instead. What is the chance it came from urn 1?
Answer
Full solution
.
-
A student reads “the test is accurate” and concludes a positive result means a chance of disease. What is wrong?
Answer
That reverses the conditional probability. With prevalence the chance is about .
Full solution
is . The question asks for , which depends on the base rate.
Frequently asked questions
What is Bayes' theorem?
P(A | B) = P(B | A) · P(A) / P(B). It turns the probability of the evidence given a cause into the probability of the cause given the evidence.
How do you find P(B) in the denominator?
Add every way B can happen: P(B) = P(B | A)P(A) + P(B | not A)P(not A). This is the law of total probability.
Why can a positive test mean a low chance of disease?
When a disease is rare, the few true positives are outnumbered by false positives from the many healthy people, even if the test is accurate.
What are prior and posterior probabilities?
The prior is the probability before the evidence, such as the 1% prevalence. The posterior is the updated probability after it, such as P(disease | positive).
What are natural frequencies?
Imagining a concrete group, say 10,000 people, and counting how many fall into each case. It gives the same answer as the formula with whole numbers instead of decimals.
Standards alignment
This lesson covers the following Common Core State Standards for Mathematics.
- CCSS.MATH.CONTENT.HSS.CP.A.3Conditional Probability and the Rules of ProbabilityUnderstand the conditional probability of A given B as P(A and B)/P(B), and interpret independence of A and B as saying that the conditional probability of A given B is the same as the probability of A, and the conditional probability of B given A is the same as the probability of B.
- CCSS.MATH.CONTENT.HSS.CP.B.6Conditional Probability and the Rules of ProbabilityFind the conditional probability of A given B as the fraction of B's outcomes that also belong to A, and interpret the answer in terms of the model.