Seeded coin flips, 12 rows (model)
Behind this page a Galton board of 12 rows of pegs fills as you scroll. Each peg is a fair coin flip, not a collision simulation (seeded, so every visit sees the same balls), and between pegs each ball falls under gravity. 4,096 balls, 2 to the 12th, fall in doubling batches. The first ball goes left right right right right left left left right left right left and lands in bin 6. For Bayes’ theorem, after 16 balls, the posterior for the chance of bouncing right is 0.4845 plus or minus 0.0358; it narrows with every ball, to 0.4966 plus or minus 0.0023 at 4,096. For the central limit theorem, after 1,024 balls, the pile follows the binomial counts and the normal curve with mean 6 and variance 3. For the law of large numbers, the running mean bin after all 4,096 balls is 5.960, against 6 expected. For regression to the mean, the 146 balls that finished four or more bins out are dropped again from where they passed row 6, halfway down: they finished 4.12 bins out, and their re-runs land 2.23 bins out, about half as far, as Galton’s two-stage board shows. For the p-value, a chi-squared test of the 4,096 against a fair board gives 8.34 on 6 degrees of freedom, p = 0.214; tested after every ball from 128 on, p wanders, and is below 0.05 at 8.6 percent of the looks, though the board is fair. For Simpson’s paradox, two more boards (a model): one leans left, one right, and yellow balls drop one peg to the right of blue ones, so on each board yellow finishes about one bin further right; but most yellow balls go to the left-leaning board, so pooled, yellow finishes 0.49 bins further left. At the end the pegs show Pascal’s triangle, the number of paths to each peg: a Galton board is Pascal’s triangle with gravity, and with 4,096 balls each bin expects exactly its binomial coefficient, 924 in the middle bin, which counted 939.