Probability formula reference

Bayes’ Theorem

Updates the probability of an event after observing evidence.

Open in editor
LaTeXP(A\mid B)=\frac{P(B\mid A)P(A)}{P(B)}

Variables

  • P(A|B): posterior probability
  • P(B|A): likelihood
  • P(A): prior probability
  • P(B): evidence probability

How to use this formula

Updates the probability of an event after observing evidence.

Important notes

  • P(B) must be greater than zero.
  • The denominator can be expanded with the law of total probability when needed.

Quick example

Bayes’ theorem is commonly used to interpret medical test results.

Applicability, worked calculation, and verification

Domain and applicability

Requires defined prior and conditional probabilities with a nonzero probability for the observed evidence in the denominator.

Units

  • all probabilities are dimensionless values from 0 to 1 or equivalent percentages

Assumptions and domain checks

  • P(B) must be greater than zero.
  • For the Bayes’ Theorem, every denominator must be nonzero, and the numerator and denominator must remain correctly grouped.
  • The event model, conditioning information, independence assumptions, and probability range must match the problem.

Do not use this formula when

  • Do not use Bayes’ Theorem until the sample, event, distribution, independence assumptions, and parameter convention match the problem.

Boundary and special cases

  • For Bayes’ Theorem, check zero, negative, and extreme input values before relying on the result.
  • When using Bayes’ Theorem, confirm that denominators, radicals, logarithms, and domain restrictions remain valid for the chosen values.

Equivalent and alternative forms

  • Keep the canonical LaTeX form P(A\mid B)=\frac{P(B\mid A)P(A)}{P(B)} for copying; rearrange only after preserving equivalence and domain restrictions.

Worked example

Input

P(A)=0.01, P(B|A)=0.90, P(B)=0.05

Output

P(A|B)=0.18

With 1% prevalence, 90% sensitivity, and 5% false-positive rate, P(condition|positive) = 0.009/(0.009 + 0.0495) ≈ 0.1538, or 15.38%.

  1. Compute the true-positive joint probability: 0.01 × 0.90 = 0.009.
  2. Compute the false-positive joint probability: 0.99 × 0.05 = 0.0495.
  3. Add both paths to get P(positive) = 0.0585.
  4. Divide 0.009 by 0.0585 to obtain approximately 0.1538.

Independent verification

In a hypothetical 10,000-person group, about 90 true positives and 495 false positives produce 90/585 = 15.38%, matching the formula.

Common mistakes

  • When copying Bayes’ Theorem, keep the complete numerator and denominator grouped; a missing brace or parenthesis changes the result.
  • Do not assume events are independent or mutually exclusive unless the problem states or proves that condition.

Continue the workflow

Use Bayes’ Theorem in your own work

  1. Check the domainMatch the variables and assumptions to the problem before substituting values.
  2. Copy the exact notationPreserve grouping, signs, and exponents in P(A\mid B)=\frac{P(B\mid A)P(A)}{P(B)}.
  3. Edit or convertOpen the expression in the LaTeX editor, then export it for your document or web page.

Review and verification

Last reviewed: 2026-07-26

Review method: Reviewed the notation, variable definitions, applicability conditions, worked workflow, and verification method for Bayes’ Theorem.

Verified against: OpenStax Introductory Statistics

Automated quality check: Passed the core formula indexing gate.

Formula references

Frequently asked questions

What is the Bayes’ Theorem used for?

Updates the probability of an event after observing evidence.

Can I copy this formula as LaTeX?

Yes. Copy P(A\mid B)=\frac{P(B\mid A)P(A)}{P(B)} or open it in the LaTeX editor.

What should I check before using it?

Confirm that each variable, unit, domain restriction, and assumption matches the problem.

Reuse, attribution, and correction

Share this reference without losing its source

Copy a citation, permanent link, Markdown link, or self-contained embed card. Each reusable format points readers back to the maintained canonical page.

Report an issue

Search the whole reference

Symbols, formulas, guides, tools and commands

Start typing to search.

move · Enter open · Esc close