Calculate posterior probability using Bayes' Theorem. Understand how new evidence updates the probability of an event.
Last updated: March 2026
Prior probability (0 to 1)
Likelihood (evidence given A)
Likelihood (evidence given not A)
| Prior Belief | With Strong Evidence (P(B|A)=99%, P(B|¬A)=5%) | With Weak Evidence (P(B|A)=60%, P(B|¬A)=40%) |
|---|---|---|
| 1% (rare event) | ≈ 17% | ≈ 1.5% |
| 50% (uncertain) | ≈ 95% | ≈ 60% |
| 90% (very likely) | ≈ 99.4% | ≈ 95% |
Strong evidence moves belief significantly; weak evidence moves it slightly. The more uncertain you start (50%), the more evidence shifts your belief.
Bayes' Theorem is a mathematical formula that describes how to update probabilities as new evidence becomes available. It bridges our prior belief (before seeing evidence) with our posterior belief (after observing evidence), making it a cornerstone of probability, statistics, machine learning, and decision-making.
The theorem states: Posterior = (Likelihood × Prior) / Evidence. In practical terms, if you start with a belief that something is true (prior), then observe new data (evidence), Bayes' Theorem tells you how much to adjust your belief (posterior). The more reliable the evidence, the bigger the adjustment.
For example, medical testing: if you test positive for a rare disease, Bayes' Theorem calculates the real probability you have it—accounting for the test's accuracy and how rare the disease is. This often reveals that many positive tests are false positives if the disease is truly rare.
Enter the probability of event A occurring before you see any evidence. This is your initial belief (e.g., 0.01 for a 1% chance).
P(B|A): probability of seeing evidence B if A is true. P(B|¬A): probability of seeing evidence B if A is false. These represent how reliable the evidence is.
The result P(A|B) is your updated belief about A after observing evidence B. Compare it to your prior to see how much your belief changed.
A patient tests positive for a rare disease. What's the real probability they have it?
Despite a test that's 99% accurate, the patient's actual risk increased from 0.01% (prior) to only 0.2% (posterior). Why? The disease is so rare that false positives from the healthy population outnumber true positives.
Key lesson: When testing for rare events, most positive results are false when base rates are very low.
When the prior (P(A)) is very low (rare event) and false positive rate (P(B|¬A)) is non-negligible, most positive results are false. This is the base rate fallacy—updating based only on test accuracy, ignoring base rates.
P(B|A) is likelihood: given A, what's the chance of B? P(A|B) is posterior: given B, what's the chance of A? Bayes' Theorem reverses the direction using priors and evidence.
No. All valid probabilities are in [0,1] (or 0–100%). If your calculator shows an error, check that inputs are in this range.
This breaks Bayes' Theorem (division by zero). It means the evidence is impossible given both A and ¬A, which shouldn't happen in reality. Check your inputs.
Large changes mean the evidence is strong and diagnostic. Small changes suggest weak evidence. Example: a 99% accurate test on a common condition produces large posterior shifts; on a rare condition, posterior shifts are minimal.
Yes, but it requires chaining: use posterior from round 1 as the prior for round 2. For many evidence pieces, sequential updating gets complex—use software like Bayesian networks.
Naive Bayes classifiers use Bayes' Theorem to assign data to categories. Bayesian networks represent probabilistic relationships. Many ML algorithms implicitly or explicitly use Bayesian inference.
Named after Rev. Thomas Bayes (1702–1761), who first formulated the theorem. He was an English statistician and theologian. The paper was published posthumously in 1763.
Related Tools
Basic probability calculations.
P(A|B) calculations.
P(A and B) calculations.
Three event probabilities.
Probability-weighted average.
Decision theory.