Probability rules playground
Set the chances of two events and their overlap, choose a rule, and press Play: each term of the formula lights up the part of the Venn diagram and the branches of the tree it stands for. Below, Bayes' rule sorts 10,000 people by condition and test result.
Goes with chapter 2. Conditional probability and Bayes
Two events
A and B are neither independent nor mutually exclusive: P(A ∩ B) = 0.18, while P(A) × P(B) = 0.1944.
The rule to read
P(A ∪ B) = P(A) + P(B) − P(A ∩ B) = 0.54 + 0.36 − 0.18 = 0.72
The steps in words
- P(A) counts every outcome in A.
- P(B) counts every outcome in B, the overlap included.
- The overlap has now been counted twice, so take it away once.
- What remains is A or B or both, each outcome counted once.
Bayes' rule with 10,000 people
A test sorts 10,000 people into four groups: with the condition and positive, without it and positive, with it and negative, without it and negative. Play the grid to see how few of the positives have the condition when it is rare.
- Condition, test positive: 48
- No condition, test positive: 199
- Condition, test negative: 2
- No condition, test negative: 9,751
Of the 247 people who test positive, 48 have the condition: a share of 0.1943.
P(condition | positive) = (0.96 × 0.005) / (0.96 × 0.005 + 0.02 × 0.995) = 0.1943