Bayes' theorem tells you how to update a probability after seeing new evidence. If , then
It answers a very specific question: after event has happened, how likely is event now? The idea matters in medical testing, spam filtering, and any situation where evidence can be misleading unless you also account for how common the event was to begin with.
Bayes' theorem formula in plain language
Bayes' theorem combines three ingredients:
- start with what you believed before the evidence,
- ask how compatible the evidence is with that event,
- scale by how common the evidence is overall,
The result, , is called the posterior probability.
What each part of the formula means
In
is the prior. It is your starting probability for before you use the new evidence.
is the likelihood. It tells you how likely the evidence is if is true.
is the probability of the evidence overall. This term matters because some evidence is common even when is false.
is the posterior. It is the updated probability of after learning that happened.
Why the denominator changes the answer
Bayes' theorem does not just reward evidence that fits your hypothesis. It also asks whether that same evidence happens a lot anyway.
That is why the denominator matters. If the evidence is common across many cases, seeing it should not change your belief very much. If the evidence is rare except when is true, it can shift your belief a lot.
Short proof from conditional probability
Assume and where needed. By the definition of conditional probability,
and
From the second equation,
Substitute that into the first equation:
That is Bayes' theorem.
Worked Bayes' theorem example: a positive medical test
Suppose a disease affects of a population. A test is sensitive and has a false-positive rate.
Let
- = the person has the disease
- = the test is positive
Then
We want , the probability that a person actually has the disease given a positive test.
First find the overall probability of a positive result. A positive test can happen in two ways: the person has the disease and tests positive, or the person does not have the disease and still tests positive.
Now apply Bayes' theorem:
So the chance of actually having the disease after one positive test is about , not . The test is strong, but the disease is rare, so most positive results still come from the much larger group without the disease.
This is the main lesson many people miss: even a strong test can produce a modest posterior probability when the condition is rare to begin with.
A useful two-case version of Bayes' theorem
If the evidence can come from two complementary cases, and , then
Using that in Bayes' theorem gives
This form is often the most practical one in two-case problems.
Common Bayes' theorem mistakes
Mixing up and
These probabilities usually are not equal. A positive test can be very likely when a disease is present, while the disease can still be fairly unlikely after a positive test.
Ignoring the base rate
The prior matters. If is very rare, then even strong evidence may not push the posterior as high as intuition expects.
Computing too narrowly
The denominator is not just a leftover term. It is the total probability of the evidence and often requires adding contributions from multiple cases.
Using the formula when
Bayes' theorem in this form requires . If the evidence has probability , the conditional probability is not defined by the basic formula.
When Bayes' theorem is used
Bayes' theorem appears in medical testing, spam filtering, reliability analysis, machine learning, and scientific inference. In each case, the same idea appears: update a belief when new information arrives.
It is especially useful when people tend to overreact to evidence without asking how common the event was in the first place.
Try a similar Bayes' theorem problem
Keep the same medical test, but change the disease rate from to . The sensitivity and false-positive rate stay the same, but the posterior changes a lot. Working that version once is a fast way to feel why the prior matters.
Need help with a problem?
Upload your question and get a verified, step-by-step solution in seconds.
Open GPAI Solver →