Bayes’ theorem is one of 2 conditional probability formulas in the probability section of this library, and it is used at ap · university level.
Why bayes’ theorem works
Both conditional probabilities are built from the same joint probability, just divided by different denominators. Writing that joint quantity two ways and solving for the one you want reverses the direction of the conditioning, and the prior is what carries the underlying base rate into the answer.
What each symbol means
$P(A)$ is prior and $P(A\mid B)$ posterior probability.
Bayes’ theorem: when it holds
$P(B)>0$; compute $P(B)$ across all relevant cases when not given.
When it stops applying
The conditioning event must have positive probability, and the answer is never better than the prior you feed in. Choosing a base rate from a different population, or guessing one, silently changes the posterior, which is why this formula is only as trustworthy as the numbers put into it.
Bayes’ theorem: a worked example
If $P(A)=.2,P(B\mid A)=.8,P(B)=.4$, then $P(A\mid B)=.4$.
The mistake to avoid
What people do: Ignoring the base rate and reporting the test accuracy as the answer.
Why it goes wrong: With a disease affecting 0.1 percent of people, a test catching 99 percent of cases and a 5 percent false-positive rate, the chance a positive result is genuine is only about 1.9 percent, not 99 percent.
Do this instead: Imagine 100000 people, count the true positives and the false positives separately, and compare the two counts before quoting a percentage.
Bayes’ theorem: step by step
- Name the unknown, and the unit the answer has to come out in.
- Match the symbols to your values. $P(A)$ is prior and $P(A\mid B)$ posterior probability.
- Check the conditions before substituting. $P(B)>0$; compute $P(B)$ across all relevant cases when not given.
- Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most probability slips.
Where this formula fits
- Subject
- Probability formulas — 17 entries in this library
- Topic
- Conditional probability
- Level
- AP · University
Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where bayes’ theorem comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.
- Probability Foundations — the lesson behind this formula: model outcomes, complements, and conditional information.
- Statistics Calculator — check your substitution and the value it produces.
- Study probability — the subject guide that explains the ideas these formulas compress.
- Statistics Practice — questions that make you retrieve the formula instead of recognising it.
- All 17 probability formulas — the full grouped reference, or the complete formula library.
Questions about bayes’ theorem
Where do I get the denominator when the problem does not state it?
Build it with the law of total probability: work out the chance of the evidence inside each separate case and scale each one by how probable that case is. In the disease example that is the true positives plus the false positives.
What do prior and posterior mean?
The prior is what you believed before seeing the evidence and the posterior is what you believe after. The formula is the machinery for moving from one to the other.
Why is the answer so much lower than the test accuracy suggests?
Because healthy people vastly outnumber sick ones. A 5 percent error rate on 99900 healthy people produces far more positives than a 99 percent hit rate on 100 sick ones.
Does testing a second time help?
A great deal, if the second test is independent. Feeding the 1.9 percent back in as the new prior raises the probability to about 28.2 percent after a second positive result.