Skip to main content
/
probability visualizerstatistics visualizernormal distribution calculatorexpected value calculatorBayes theorem calculatorlaw of large numberscoin flip simulator
//// Educational · Statistics

Probability & Statistics Visualizer

Coin flips, bell curves, lottery math, Bayes' theorem — the core ideas of statistics made visual and interactive.

401(k) Limit 2024$23,000
Roth IRA Limit$7,000
S&P 500 Avg Return~10%/yr

🪙 Coin Flip Simulator — Law of Large Numbers

Flip a coin 10 times — you might get 7 heads. Flip 1,000 times — you'll be very close to 50%. This is the "Law of Large Numbers." More trials = more predictable outcome.

Hit the button to run all 5 simulation sizes at once.

🔔 Normal Distribution — The Bell Curve

Tons of things in nature follow a bell curve: heights, test scores, measurement errors. The curve tells you how likely any value is. About 68% of values fall within 1 standard deviation (σ) of the mean — and 99.7% within 3σ!

Mean (μ)50
Std dev (σ)10
±1σ
68.27%
4060
±2σ
95.45%
3070
±3σ
99.73%
2080

🎰 Expected Value — Should You Play the Lottery?

Expected value (EV) tells you the average outcome if you played many, many times. Almost all lotteries have negative EV — you lose money on average. See it yourself!

Expected value per ticket
$-1.5000
You lose $1.5000 on average per ticket. Over 100 tickets: −$150.00
1

Win probability

1 / 10,000,000

= 0.000010%

2

Expected winnings

$5,000,000 × (1 / 10,000,000)

= $0.5000

3

Expected loss

$2 × (1 − 1/10,000,000)

= −$2.0000

4

Expected value (EV)

$0.5000 − $2.0000

= $-1.5000 per ticket

#ShowYourWork

🧬 Bayes' Theorem — The Medical Test Paradox

A test is 99% accurate. You test positive. What's the chance you actually have the disease? Probably much less than 99%! This is Bayes' theorem — it factors in how rare the disease is. A rare disease + lots of people tested = lots of false positives.

Disease prevalence (%)0.1%
Test sensitivity — true positive rate (%)99%
Test specificity — true negative rate (%)99%
Prior (prevalence)
0.1%
P(disease)
True positive
0.099%
P(+ and disease)
False positive
0.999%
P(+ and no disease)
If test positive…
9.0%
actual disease chance
Key insight: Even with a positive test, there's only a 9.0% chance you have the disease. Most positives are false alarms when the disease is rare.
1

Prior P(disease)

0.1%

= 0.1000%

2

True positive P(+ | disease)

sensitivity × prior = 99% × 0.1%

= 0.0990%

3

False positive P(+ | no disease)

(1 − specificity) × (1 − prior) = 1% × 99.9%

= 0.9990%

4

Total P(positive test)

true positive + false positive

= 1.0980%

5

Posterior P(disease | positive test)

true positive / total positive

= 9.02%

#ShowYourWork

You might also like

You might also like