The Law of Large Numbers

Category: Probability   Level: 301

heads / flips → 0.5 as flips → ∞

The share of heads swings wildly over a few flips and settles near one half over many. The swings shrink like 1 over the square root of the number of flips.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Flip a coin ten times

Ten flips gave 8 heads. The coin is fair; small samples just swing. One flip is a big deal in a small crowd, so the running share jumps every time.

8 heads / 10 flips = 0.8

Step 1: Flip a coin ten times

Step 2: Plot the running share

Plot the share after each of the first 20 flips. It wanders well away from one half.

share after 20 flips = 0.75

Step 2: Plot the running share

Step 3: Keep flipping

Over 200 flips the line still wobbles, but each new flip moves it less. One flip out of 200 barely nudges the average.

share after 200 flips = 0.570

Step 3: Keep flipping

Step 4: Zoom out to 2000 flips

Over 2000 flips the early swings squeeze against the left edge, and the line hugs one half.

share after 2000 flips = 0.496 ≈ 0.5

Step 4: Zoom out to 2000 flips

Step 5: See the swings shrink

The shaded funnel is one half plus or minus 1/√n, where most runs stay. Four times the flips makes the funnel half as wide.

0.5 ± 1/√(n)

Step 5: See the swings shrink

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render law-of-large-numbers --out /tmp/law-of-large-numbers

Source: svgmath/diagrams/probability.py