Math for Causal Inference
All simulators

Bayes' Theorem Calculator

A probability tree and a 1,000-person grid: see how prevalence drives the meaning of a positive test.

Day 2: Conditional Probability, Independence & Bayes
V: 0.050Vᶜ: 0.950+ 0.90− 0.10+ 0.10− 0.90True positive0.0450False negative0.0050False positive0.0950True negative0.8550
Posterior P(V | +)
32.1%
Bayes' theorem
P(+)
14.0%
law of total probability
Positives that are false
67.9%
P(Vᶜ | −)
99.4%
negative predictive value
true positivefalse positivefalse negativetrue negative

Each dot is one person in a city of 1,000. The posterior P(V | +) is the share of blue among all dots that tested positive (blue + orange).