Bayes Theorem Calculator
Compute posterior probability P(H|E).
About this tool
Enter the prior P(H), the hit rate P(E | H) and the false-alarm rate P(E | not H). A 1% prior with a test that is 95% sensitive and 5% false-positive gives a posterior of 0.161017, only 16%.
How to use
How it works
Bayes' theorem reverses a conditional probability: P(H | E) = P(E | H) P(H) ÷ P(E). The surprise in the first example is that a positive result from a good test is still mostly false when the condition is rare: 0.95 × 0.01 = 0.0095 true positives against 0.05 × 0.99 = 0.0495 false positives.
P(H | E) = P(E | H)P(H) ÷ [P(E | H)P(H) + P(E | ¬H)(1 − P(H))]
Worked example
Screening for a rare condition
- Input
- P(H) = 0.01, P(E|H) = 0.95, P(E|not H) = 0.05
- Output
- 0.161017
- Walkthrough
- 0.0095 ÷ (0.0095 + 0.0495) = 0.0095 ÷ 0.059 = 0.161017.
Limitations
- All three inputs must be probabilities between 0 and 1.
- Assumes a single yes/no hypothesis.
Questions
What is P(H | E) for a 1% prior, 95% hit rate and 5% false-positive rate?
What is the posterior for a 30% prior, 80% hit rate and 10% false-alarm rate?
When does the evidence change nothing?
Features
- Posterior from three inputs
- Instant
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Finding mean, median, and mode
Khan Academy
Core descriptive stats for mean/median/mode tools.
Watch on YouTubeAverage or Central Tendency
Khan Academy
When to prefer mean vs median in tool output.
Watch on YouTube
- Math is Fun
Math is Fun
Clear explainers that pair well with calculator-style tools.
- Geometry Index
Math is Fun
Shape and formula index for geometry calculators.