solvedwithstats
Sampling

Sampling-Distribution Simulator

Inference works because sample means behave. This simulator lets you watch them do it: pick a population — even a skewed, flat or two-humped one — draw thousands of samples, and the means pile into a bell centred exactly on the population mean, with a spread set by one quantity, the standard error. Or switch to the Law of Large Numbers and watch a single running average settle down.

How it works

Every run is seeded (the mulberry32 generator), so the run you see is reproducible — same seed, same samples, same histogram — and the same runs the site's tests verify. The histogram counts how many sample means landed where. The curve over it is not fitted: it is the theoretical sampling distribution, a normal curve with mean equal to the population mean μ and standard deviation equal to the standard error σ/√n, drawn from the population's own parameters before any sampling happens. The Law of Large Numbers view tracks one cumulative average: its typical distance from μ after n draws is that same σ/√n, shrinking as the draws accumulate.