Opening your learning space
Starting the app …
Opening your learning space
Starting the app …
Bayes' theorem describes the inversion of conditional probabilities.
Free to browse · flashcards or a multiple-choice quiz · import from Essential
Formula
All values dimensionless, between 0 and 1
| Symbol | Meaning | Unit |
|---|---|---|
| P(A|B) | Conditional probability of A given B (posterior) | dimensionless |
| P(B|A) | Conditional probability of B given A (likelihood) | dimensionless |
| Prior probability of A | dimensionless | |
| Marginal probability of B | dimensionless |
P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}Original schematic by Quanta
Free with a Quanta account. Your download stays ready after registration.
Thomas Bayes (1701 to 1761) developed the theorem, published posthumously in 1763. It is the foundation of Bayesian statistics and machine learning. Counterintuitive: a positive test with a 1% base rate and 99% sensitivity yields only a 50% probability of disease.
Applies to events with ; probabilities must be defined consistently on the same sample space.
Bayes follows by equating the joint probability .
Compute evidence
The evidence is often the decisive denominator.
Why is the base rate important?
P(A) scales the numerator; rare events can remain unlikely despite a good test.
Treating P(A|B) and P(B|A) as equal.
Bayes shows precisely how to convert between the two directions.
Formula cluster
Foundation for statistics, inference and model evaluation.
Medical test: a disease occurs at . The test is 95% sensitive: . False-positive rate 5%: . .
Medical diagnostics, spam filters, machine learning, forensics, risk analysis
Here is how to work through a typical Bayes' Theorem (P(A|B) = P(B|A)·P(A) / P(B)) task step by step:
Task
Why is the base rate important?
Solution path
P(A) scales the numerator; rare events can remain unlikely despite a good test.
Multiply the reverse conditional probability P(B|A) by the base probability P(A) and divide by the total probability P(B): . The denominator P(B) is often computed via the law of total probability as . Example medical test: disease with 1 percent prevalence, 95 percent sensitivity, 5 percent false-positive rate. Then percent. Despite a good test, a positive result is surprisingly often a false alarm, because the disease is rare and the many false positives outweigh the few true hits. Make sure to build the denominator fully from both contributions, otherwise the result is wrong.
The base rate P(A) scales the numerator in Bayes theorem and largely determines the result. If an event is very rare, it often remains unlikely even after a positive test result, because the many false-positive cases from the large healthy group outweigh the few true hits. This is exactly what the medical-test example shows: for a disease with only 1 percent prevalence, the probability of actually being ill is only about 16 percent despite 95 percent sensitivity. Anyone who ignores the base rate dramatically overestimates the significance of a test. This fallacy is called the base rate fallacy and is widespread in medicine and forensics.
P(A|B) and P(B|A) are two different conditional probabilities and must not be treated as equal. P(A|B) is the probability of A given that B has already occurred; P(B|A) is conversely the probability of B given that A has occurred. An example makes the difference clear: the probability of being ill given a positive test differs greatly from the probability of testing positive given that you are ill. This very confusion is a classic fallacy. Bayes theorem shows how to convert correctly between the two directions, namely by including the base rates P(A) and P(B).
Bayes theorem is the tool to turn an initial probability, the prior probability P(A), into an updated posterior probability P(A|B) in the light of new observations. You multiply the prior by the likelihood P(B|A), that is the probability of the observation under the assumption, and normalize with the total probability P(B). The result takes into account both the prior knowledge and the new evidence. If you obtain further data, you can use the posterior again as a prior and repeat the process. This stepwise learning from data is the basis of Bayesian statistics and of many modern methods of machine learning and diagnostics.
You usually determine the denominator P(B), also called the evidence, via the law of total probability. You consider all ways in which the event B can occur and add their probabilities: . The first term captures the cases where B occurs together with A, the second the cases with the complementary event . For a test these are the true positives plus the false positives. This denominator is often the decisive and easily overlooked step. Without it you do not get a valid probability, because otherwise the sum of all possibilities does not equal one.
Quanta exam set
Curated exam set for "Bayes' Theorem":
Question (front)
Which formula describes Bayes' Theorem?
Answer in your set
Question (front)
How do you rearrange Bayes' Theorem for Compute evidence?
Answer in your set
Question (front)
Which common mistake happens with Bayes' Theorem?
Answer in your set
+ 7 more cards: units, variables, derivation, example, exam task
The formula set contains 10 cards. After importing, review them and start practicing; your ratings determine later review intervals.
This list names subject references and further reading. A page or section number appears when it is part of the reference; these are not verbatim quotations.
Create a curated FSRS exam set for P(A|B) = P(B|A)·P(A) / P(B): formula recall, variables, derivation, rearrangement, worked example, common mistakes and exam context.
Curated formula set · LaTeX · FSRS spaced repetition · import from Essential