Probability & Uncertainty

Averages Get Bell-Shaped

Pick a lumpy, lopsided source of random numbers. Average a few at a time and watch a smooth bell curve appear.

Start with 1 number per average and collect some. Then slide it up and watch the lumps melt into a bell!

The weird source

Averages of 1 draws

your averagesperfect bell curve

Challenges

Shrink the spread: collect 500 averages of at least 5 numbers. The bell gets half as wide as the source.
Tame the skew: pick Skewed, use 60+ numbers per average and collect 1,000 averages. The lopsidedness drops under 0.4.
Fill the valley: pick Two humps, use 10+ numbers, and 500 averages. The averages pile up in the middle where the source has nothing!
Pull yourself up: switch to Bootstrap and take a sample of 10 or more.
Keep the promise: with 30+ numbers, press Try 200 times. A 95% interval should catch the truth 85% to 99% of the time.

What just happened?

For grown-ups: what's really going on

The central limit theorem: for independent draws with finite mean μ and variance σ², the sample mean of n draws is approximately Normal(μ, σ² / n) for large n, whatever the source. The spread of the averages (the standard error) is σ / √n, the same 1/√n as in the Monte Carlo lesson.

  • "Lopsided" is the sample skewness. A skewed source with skewness γ gives averages with skewness about γ / √n, so the lopsidedness shrinks as n grows. Heavy-tailed sources (infinite variance) break the theorem.
  • The formula interval is x̄ ± 1.96 · s / √n. Its claim is about the procedure: over many samples about 95% of such intervals contain μ. It does not say "95% chance for this one interval". At small n with a skewed source it under-covers slightly, because s is itself noisy.
  • The bootstrap (Efron, 1979) resamples the observed sample with replacement 1,000 times (here 300 in the 200-trial test), and takes the 2.5th and 97.5th percentiles of the resampled means (percentile interval). It needs no formula, which helps for medians, ratios and other messy statistics.
  • The bell curve overlay is the CLT prediction using the source's true mean and sd, measured from a fixed sample of 60,000 draws.

Further reading: Efron and Tibshirani, An Introduction to the Bootstrap · Seeing Theory (Brown University), Central Limit Theorem.