Lab · c12.s03.L1

The law of large numbers

A running average settles near the mean, and the typical gap shrinks like sigma over the square root of the number of draws.

Question: Why does an average settle down?

The law of large numbersFour runs, told apart by dash pattern and marker, plot the running average of independent coin flips and then of die rolls against a logarithmic axis of draws. Each path starts jagged and far from the true mean, marked by a horizontal reference line, then flattens onto it as the number of draws grows. Behind the paths a shaded funnel narrows steadily like sigma over the square root of n, so four times the draws halve its width.The law of large numbersdraws, logarithmic scalerunning average00.5111010010004000mean 0.5Fair coin · mean 0.5 · sd 0.5 · variance 0.25n = 100 · run 1 avg 0.41 · gap 0.09 · funnel ± 0.05n = 400 · run 1 avg 0.47 · gap 0.03 · funnel ± 0.025n = 1600 · run 1 avg 0.496875 · gap 0.003125 · funnel ± 0.0125
Re-simulated Re-simulated: 300 stored points per path from data/scripts/c12.s03.L1.py under seed 121203. The frames reveal the running averages of the fair coin (mean 0.5, sd 0.5) and the fair die (mean 3.5, sd 1.707825) along a logarithmic axis to 4000 draws; the shaded funnel is computed from sigma over the square root of n, not measured from a source. Multiplying the draws by four halves the funnel width.
Lab controls
Fair coin

Left and Right move between the two options; Home selects Fair coin, End selects Fair die. The two options form a radio group.

1000 draws

Left/Right and Up/Down change by 10; Page Up/Down change by 100; Home sets 10 and End sets 4000. The value is shown in text and updates with every key.

3 paths

Left/Right and Up/Down change by 1; Page Up/Down change by 1; Home sets 1 and End sets 4.

On

Space toggles the funnel, and the state is announced as checked or unchecked.

Frame 1 of 13: Before the first drawThe axes are ready: 4000 draws on a logarithmic scale, the running average on the vertical axis, and a reference line at the mean 0.5. The shaded funnel is the typical gap sigma over the square root of n; for the fair coin sd is 0.5.

Before the first draw. The axes are ready: 4000 draws on a logarithmic scale, the running average on the vertical axis, and a reference line at the mean 0.5. The shaded funnel is the typical gap sigma over the square root of n; for the fair coin sd is 0.5.

Keyboard: Space plays or pauses, Left and Right step, Home goes to the first frame, End goes to the last frame.

Text description of this lab

Four runs, told apart by dash pattern and marker, plot the running average of independent coin flips and then of die rolls against a logarithmic axis of draws. Each path starts jagged and far from the true mean, marked by a horizontal reference line, then flattens onto it as the number of draws grows. Behind the paths a shaded funnel narrows steadily like sigma over the square root of n, so four times the draws halve its width.

Return to the section that hosts this lab

Caption status: re-simulated. Every lab declares one of published, re-simulated, schematic, synthetic or interpolated.