AI-generated Computed, not drawn Test parameters are illustrative

This probability sandbox was generated by Claude (Anthropic) for the STAT 101 course materials. Every number on it is computed in your browser and recomputed on every knob change: the exact posterior P(disease | +), the total probability of a positive test, the false-discovery fraction, and the four confusion counts. The coin/die run is a real sequence of seeded pseudo-random Bernoulli draws (mulberry32), so the same seed always gives the same run and the convergence you watch is one that actually happened in the loop. Nothing on this page is sketched.

The confusion counts are integers, so they are rounded — diseased = round(prev×N), then true positives and true negatives are rounded and the remainders become the false counts — which makes the four cells sum to N exactly and match the row and column totals. The count-based posterior TP/(TP+FP) therefore differs from the exact continuous posterior by a rounding amount that vanishes as N grows; the page shows both and marks which is exact.

Bayes’ theorem and the total-probability decomposition are standard results. The prevalence, sensitivity and specificity, the coin bias and the seed are illustrative inputs you set; the arithmetic done on them is exact. Seeded generator: mulberry32 (public domain). No number on this page came from a real diagnostic study.

Probability simulator — the law of large numbers, and why a 99% test can still be wrong

Course demo — reached from the Labs & Demos hub; the page itself is English‑only for now. Built for STAT-101 Module 3. Two experiments. Run a seeded coin or die and watch the running frequency settle onto the true probability — while the raw count difference drifts the other way. Then set a medical test’s prevalence, sensitivity and specificity and read the exact P(disease | +): a very accurate test on a rare disease is mostly wrong when it says yes, and the confusion counts show why.

 

 
 

 

 
 

Experiment 1 — law of large numbers

 

0.50

 

 

2000

 

 

Experiment 2 — the medical test

0.010

 

0.99

 

0.99

 

100000

 

 

 — 
 — 
 — 
 — 
 — 
 — 

The confusion counts, and the posterior they imply

 
 

 

1 

 

 

2 

 

 

The arithmetic, in full