Bayes’ Theorem Calculator
Bayes’ theorem updates a prior with evidence: a positive result from a 95 %-sensitive test for a 1 % disease means only 0.161016949153 chance of having it.
e.g. disease prevalence
e.g. test sensitivity
e.g. false-positive rate (1 − specificity)
0.161016949152542
Full answer, then cut to fewer decimals (not rounded):
- 0.161016949152542
- 0.16101694915254
- 0.1610169491525
- 0.161016949152
- 0.16101694915
- 0.1610169491
- 0.161016949
- 0.16101694
- 0.1610169
- 0.161016
- 0.16101
- 0.1610
- 0.161
- 0.16
- 0.1
- P(B) (total probability)
- 0.059
- P(not A | B)
- 0.8389830508
| Hypothesis | Prior | Likelihood | Prior × likelihood | Posterior |
|---|---|---|---|---|
| A | 0.01 | 0.95 | 0.0095 | 0.16101695 |
| not A | 0.99 | 0.05 | 0.0495 | 0.83898305 |
Step-by-step solution
- P(B) = Σ P(Hᵢ)·P(B|Hᵢ) = 0.059
- P(H₁|B) = P(H₁)·P(B|H₁) ÷ P(B) = 0.0095 ÷ 0.059 = 0.16101695
Bayes’ Theorem Formula
P(A|B) = P(A)·P(B|A) ÷ P(B)
P(B) = Σ P(Hᵢ)·P(B|Hᵢ) (total probability)
Worked Example
A disease with 1 % prevalence and a test with 95 % sensitivity and 5 % false positives:
- P(B) = Σ P(Hᵢ)·P(B|Hᵢ) = 0.059
- P(H₁|B) = P(H₁)·P(B|H₁) ÷ P(B) = 0.0095 ÷ 0.059 = 0.16101695
P(not A | B): 0.8389830508
| Hypothesis | Prior | Likelihood | Prior × likelihood | Posterior |
|---|---|---|---|---|
| A | 0.01 | 0.95 | 0.0095 | 0.16101695 |
| not A | 0.99 | 0.05 | 0.0495 | 0.83898305 |
GATE tip
The “three machines produce 50 %, 30 % and 20 % of items with 2 %, 3 % and 5 % defects” question is the classic GATE Bayes problem; use the table mode with those numbers.
More Probability and Complex Variables Calculators
-
Normal Distribution Calculator
z = (x − μ)/σ, P(X < x) = Φ(z)
Φ standard normal cumulative distribution
Example: X normal with μ = 50 and σ = 10, between 40 and 65: P(40 < X < 65) = 0.7745375448.
-
Exponential Distribution Calculator
F(x) = 1 − e^(−λx), f(x) = λe^(−λx)
mean 1/λ, variance 1/λ², median ln 2/λ
Example: Rate λ = 0.5 per hour, probability of an event within 3 hours: P(X ≤ 3) = 0.776869839852.
-
De Moivre’s Theorem Calculator
[r(cos θ + i sin θ)]ⁿ = rⁿ(cos nθ + i sin nθ)
roots: r^(1/n)[cos((θ + 2πk)/n) + i sin((θ + 2πk)/n)]
Example: z = 1 + i with n = 3: zⁿ = z^3 = -2 + 2i.
Frequently asked questions
Why is the posterior so low for a rare disease?
Most positives come from the many healthy people: 5 % of 99 % is far more than 95 % of 1 %, so P(disease | positive) is only about 16 %.
How does the total probability theorem fit in?
It gives the denominator: P(B) = Σ P(Hᵢ)P(B|Hᵢ), the probability of the evidence across all hypotheses.
Sources
Last reviewed: . Factors are stored exactly and computed with 50-digit decimal arithmetic. See how we verify conversion factors.
Cite this page
APA
Scientific Converters. (2026, October 15). Bayes’ Theorem Calculator. Retrieved October 25, 2026, from https://scientificconverters.com/calculators/bayes-theorem-calculator/
IEEE
Scientific Converters, "Bayes’ Theorem Calculator," scientificconverters.com. Accessed: Oct. 25, 2026. [Online]. Available: https://scientificconverters.com/calculators/bayes-theorem-calculator/