Mathematics · Formula

Bayes' theorem

Reverses a conditional probability, updating a prior belief with new evidence.

Mathematics librarySymbols definedWorked example
Formula
P(A | B) = P(B | A) P(A) / P(B)

Reverses a conditional probability, updating a prior belief with new evidence.

What the symbols mean

  • P(A) — the prior probability of A
  • P(B | A) — the likelihood of the evidence given A
  • P(B) — the total probability of the evidence

What it means

Bayes' theorem is the foundation of medical testing and Bayesian inference: the posterior P(A | B) combines the prior with how strongly the evidence points to A.

Worked example

Example

With 1% prevalence, 99% sensitivity and 5% false positives: P(B) = 0.0099 + 0.0495 = 0.0594, so P(A | B) = 0.0099/0.0594 ≈ 16.7%.

Related formulas

These relationships often appear alongside the bayes' theorem in the same problems.

Frequently asked questions

What is the bayes' theorem formula?

The relationship is P(A | B) = P(B | A) P(A) / P(B). Reverses a conditional probability, updating a prior belief with new evidence.

When should I use the bayes' theorem formula?

Bayes' theorem is the foundation of medical testing and Bayesian inference: the posterior P(A | B) combines the prior with how strongly the evidence points to A.

How do I avoid unit mistakes?

Write each quantity with its unit before substituting, convert to the units the formula expects, and check that the result's unit matches the quantity you are solving for. Angles must be in radians for calculus-based expressions unless the page says degrees.

Sources and standards

The equation form, symbols and expected units on this page are checked against the reference works below.

How these are used: sources and standards.

Reviewed November 2026 · Educational reference. See the disclaimer and methodology.