Companion notes for the StatLens conceptual demo — why the long-run proportion settles, and why the running total does not
Two experiments behind one toggle: tossing a coin and watching the proportion of heads, or rolling a die and watching the average roll. Trials are added in batches of 1, 10, 100 or 1000, and the running value is traced against the number of trials with a dashed line at what the model expects (0.5, or 3.5).
The page carries one option most LLN demos leave out: Also show the running total, which draws heads minus tails from the same tosses. That second trace is the one that refutes the “law of averages”, and it costs nothing to show because it is the same data.
The law of large numbers says the sample proportion (or sample mean) converges to the probability (or expected value) as n grows. It says nothing whatever about the counts. Both facts are true at once and students routinely merge them into a third, false one.
Puts the trial count on a log scale, so trials 1–10 get as much width as 100–1000. On an ordinary axis the wild early stretch — the part where the law is visibly working — is squeezed into a sliver at the left edge. Turn it on after students have watched the early tosses arrive one at a time, so the axis change explains itself.
Draws heads − tails (for dice: the total minus 3.5 per roll) against the same trial count. Expect it to wander, cross zero occasionally, and end somewhere nowhere near zero. Over many runs its typical size grows like √n, which is exactly why the proportion — that quantity divided by n — shrinks toward zero.
?seed=anything to the URL. The generator is seeded, so the identical sequence of tosses comes
back. ?exp=die opens on dice, and ?n=1000 opens with the trials already run.
For seeing the settling, yes. For a guarantee, no — the law is a statement about the limit, and at any finite n the proportion can be off by a bit. Press +1000 a few times and watch the distance figure shrink unevenly: it does not decrease every time, it decreases on the whole.
After one toss the proportion of heads is either 1 or 0 — there is nothing else it can be. That is a real feature of the quantity, not a glitch, and it is worth a sentence: an estimate from n = 1 is as extreme as estimates get.
No, and this is a useful place to point forward. The law says if the probability is 0.5 then the proportion settles near 0.5. Asking whether an observed proportion is consistent with 0.5 is the inference question, and that is what a randomization test does.
Natural home is the probability chapter, before sampling distributions. It pairs well with Sampling Distributions (which shows what happens to the spread of a statistic as n grows) and with Stump the Chump, where students discover that real randomness is clumpier than they expect — the same intuition failure that makes a coin feel “due”.