Tool

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

P(A) = 0.54

P(A) (chance of A)

P(B) = 0.36

P(B) (chance of B)

P(A ∩ B) = 0.18

P(A ∩ B) (chance of both)

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

Playback speed

P(A ∪ B) = P(A) + P(B) − P(A ∩ B) = 0.54 + 0.36 − 0.18 = 0.72

The steps in words

  1. P(A) counts every outcome in A.
  2. P(B) counts every outcome in B, the overlap included.
  3. The overlap has now been counted twice, so take it away once.
  4. 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.

prevalence = 0.005

prevalence

sensitivity = 0.96

sensitivity

specificity = 0.98

specificity
Playback speed

  • 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

An unhandled error has occurred. Reload ๐Ÿ—™

Reconnecting…

Your connection to Introduction to Probability Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects.

The connection could not be restored. The page will reload in a few seconds.