Bayes Theorem Calculator
The Bayes theorem calculator shows how likely an assumption A really is after a test or piece of evidence B. Example: with a 1% base rate, 90% sensitivity and 9% false alarms, a positive result is a true hit in only 9.17% of cases.
Example: Base rate P(A) 1 % · Sensitivity P(B|A) 90 % · False positive rate P(B|¬A) 9 % → Probability of A after a positive result: P(A|B) = 9.17%. Source: Wikipedia – Bayes’ theorem. Updated: .
How it is calculated
Bayes' theorem calculates how likely an assumption A is after evidence B has been observed. It combines three numbers: how common A is without a test (base rate), how well the test detects A (sensitivity) and how often it fires wrongly (false positive rate).
The formula
P(A|B) = P(B|A) · P(A) / P(B), where P(B) = P(B|A) · P(A) + P(B|¬A) · P(¬A). The numerator holds the true hits, the denominator all positive results.
Example: a rare disease
1% of people have the disease, the test detects it in 90% of cases and fires wrongly for 9% of healthy people. Of 10,000 people, 100 are ill and 90 of them test positive. Of the 9,900 healthy people, 891 test positive. That is 981 positive tests in total, but only 90 come from ill people: 90 / 981 = 9.17%. Despite good test values, a positive result is mostly a false alarm because the disease is so rare.
A typical mistake
Many people confuse P(B|A) ("test positive if ill") with P(A|B) ("ill if test positive"). They are different numbers, and the base rate decides how far apart they are. Natural frequencies like those above make the difference easier to see.
Likelihood ratio
LR+ = sensitivity / false positive rate tells by what factor a positive result raises the odds of A. In the example LR+ = 10: the odds rise from 1 : 99 to 10 : 99.
Frequently asked questions
What does Bayes' theorem say?
It calculates how likely A is when B has been observed, from the base rate of A and the hit rates of B when A is true and when it is not.
Why is a positive test for a rare disease often a false alarm?
Because there are far more healthy than ill people: even a small false positive rate produces more false than true hits among the many healthy people.
What is the difference between sensitivity and positive predictive value?
Sensitivity P(B|A) is the hit rate among affected people. The positive predictive value P(A|B) tells how sure you can be of being affected after a positive test; it depends on the base rate.
What does the negative predictive value mean?
It shows how sure you can be of not being affected after a negative result. For rare conditions it is usually very high.
What is Bayes' theorem used for outside medicine?
For example in spam filters, quality control, alarm systems or forensic evidence – wherever an error-prone indicator points to a rare cause.
Sources and legal basis
- Wikipedia – Bayes’ theorem
- Gigerenzer, G., Hoffrage, U. (1995): How to improve Bayesian reasoning without instruction: Frequency formats. Psychological Review 102
- Wikipedia – Likelihood ratios in diagnostic testing
As of: · Editorial policy
Related tools
- Probability calculatorProbability calculator: favourable over possible outcomes, two events, repeated trials (binomial) and drawing without replacement, like a lottery.
- Normal Distribution CalculatorNormal distribution calculator: probability of at most, at least or between two values, z-score and percentile (inverse), with steps and the 68-95-99.7 rule.
- Poisson Distribution CalculatorPoisson distribution calculator: probability of exactly, at most, at least or between k events at average rate λ, with the steps and a table of values.
- Combination CalculatorCombination calculator for nCr and nPr, with or without repetition: exact results even for huge numbers, the formula, working and all four cases side by side.
- Standard deviation calculatorStandard deviation calculator for a list or frequency table: switch between sample (s) and population (σ), see every step in a table, plus a box plot.
- Percentage CalculatorFree percentage calculator: find X% of a number, what percent one number is of another, percentage change, increase and discount – with formula and steps.
- Online CalculatorCalculator online, free and instant: type or tap and see the answer as you go – order of operations, brackets, percent, square root, steps and a history list.
- SGPA calculator (grades and credits)SGPA calculator for Indian universities: enter each course with its grade and credits to get your semester grade point average by the UGC formula, step by step.
- School Year Calculator (England, Scotland, Northern Ireland)School year calculator for the UK: enter a date of birth and see the year group and key stage for any school year – England, Scotland and Northern Ireland.