Bayes’ Theorem Calculator
Calculate posterior probability P(A|B), Bayes factors, and multi-hypothesis updates using the law of total probability — with natural frequencies, worked examples, plain-English interpretation, and an APA 7 write-up.
Step-by-step calculation
Plain-English Interpretation
APA 7 Results Sentence
Bayes’ Theorem Formulas & Evidence Scale
Standard (2-event) form:
P(A | B) = [ P(B | A) · P(A) ] / [ P(B | A)·P(A) + P(B | ¬A)·P(¬A) ]
General (multiple-hypothesis) form: For mutually exclusive and exhaustive hypotheses H₁, H₂, …, Hₖ:
P(Hᵢ | E) = [ P(E | Hᵢ) · P(Hᵢ) ] / Σj [ P(E | Hj) · P(Hj) ]
Jeffreys’ Bayes Factor (BF₁₀) Interpretation Scale
| BF₁₀ | Strength of Evidence | Meaning |
|---|---|---|
| > 100 | Extreme | Decisive evidence for A over ¬A |
| 30 – 100 | Very strong | Very strong support for A |
| 10 – 30 | Strong | Strong support for A |
| 3 – 10 | Moderate | Substantial evidence for A |
| 1 – 3 | Anecdotal | Weak / inconclusive evidence |
| 1 | None | Evidence does not change prior odds |
| < 1 | Against A | Invert (BF₀₁ = 1 / BF₁₀) to read support for ¬A |
Worked Examples with Interpretation & APA Write-Up
Example 1 — The Base-Rate Fallacy (Rare Disease Screening)
A rare condition has a prevalence of 1% (P(A) = .01). A screening test has 95% sensitivity (P(B|A) = .95) and a 5% false-positive rate (P(B|¬A) = .05, i.e. 95% specificity).
- P(B) = (.95)(.01) + (.05)(.99) = 0.0095 + 0.0495 = 0.0590.
- P(A|B) = 0.0095 / 0.0590 = 0.1610 (16.10%).
- Why so low? Out of 1,000 people, 10 have the disease (9.5 test positive) while 990 are healthy (49.5 test positive). Even with a 95%-accurate test, false positives outnumber true positives by roughly 5 to 1!
APA 7 write-up
A Bayesian analysis was conducted to update the probability of the rare condition given a positive screening test. Using a prior probability of P(A) = .010, a conditional likelihood of P(B|A) = .950, and a false-positive rate of P(B|¬A) = .050, the marginal probability of the evidence was P(B) = .059. Observing a positive screening test increased the posterior probability of the rare condition to P(A|B) = .161 (16.10%), with a Bayes factor of BF10 = 19.00 (strong evidence in favor of the rare condition); given the absence of a positive screening test, the posterior probability was P(A|¬B) = .001 (0.05%).
Example 2 — Multiple Hypotheses (Factory Quality Control)
Three machines produce microchips: Machine A makes 50% (defect rate 2%), Machine B makes 30% (defect rate 3%), and Machine C makes 20% (defect rate 5%). A randomly chosen chip is defective. Which machine most likely made it?
- Joint probabilities: A = 0.50 × 0.02 = 0.010; B = 0.30 × 0.03 = 0.009; C = 0.20 × 0.05 = 0.010. Total P(Defective) = 0.029.
- Posteriors: P(A|D) = 34.48%, P(B|D) = 31.03%, P(C|D) = 34.48%. Even though Machine C has the highest defect rate, Machine A makes so many more chips that A and C are equally likely sources!