Data & ComputingProbabilityA-Level
AQAIBAbiturAPBaccalauréat GénéralBachilleratoCambridgeCAPS

Bayes' Theorem Calculator

Probability based on prior knowledge.

Use the free calculatorCheck the variablesOpen the advanced solver
This is the free calculator preview. Advanced walkthroughs stay in the app.
Result
Ready
Posterior P(A|B)

Formula first

Overview

Bayes' Theorem is a mathematical formula used to determine the conditional probability of an event based on prior knowledge of conditions that might be related to the event. It describes how to update the initial probability of a hypothesis as more evidence or information becomes available.

Symbols

Variables

P(A|B) = Posterior P(A|B), P(B|A) = Likelihood P(B|A), P(A) = Prior P(A), P(B) = Evidence P(B)

Posterior P(A|B)
Likelihood P(B|A)
Prior P(A)
Evidence P(B)

Apply it well

When To Use

When to use: Use this theorem when you need to calculate the probability of a cause given an observed effect, or when updating beliefs based on new data. It is essential in diagnostic testing, machine learning classification, and statistical inference where 'prior' probabilities are known.

Why it matters: It serves as the foundation for Bayesian statistics, which allows for dynamic learning from data. Its applications range from filtering spam emails and diagnosing rare diseases to refining autonomous vehicle navigation systems.

Avoid these traps

Common Mistakes

  • Swapping P(A|B) and P(B|A).
  • Forgetting to divide by P(B).

One free problem

Practice Problem

In a clinical trial, a disease affects 1% of the population. A diagnostic test is 99% accurate for those who have the disease. If the total probability of any individual testing positive is 1.98%, what is the probability that an individual actually has the disease given a positive test result?

Prior P(A)0.01
Likelihood P(B|A)0.99
Evidence P(B)0.0198

Solve for:

Hint: Multiply the probability of testing positive while sick by the probability of being sick, then divide by the total probability of testing positive.

The full worked solution stays in the interactive walkthrough.

References

Sources

  1. Wikipedia: Bayes' theorem
  2. A First Course in Probability by Sheldon Ross
  3. Wikipedia: Probability
  4. Sheldon Ross A First Course in Probability
  5. IUPAC Gold Book: Probability
  6. Edexcel A-Level Mathematics — Statistics (Probability)