Pick a population, draw a sample of n values, and drop its average into the histogram below. Repeat a thousand times and the averages pile up around the population mean with spread σ/√n, close to a normal curve even when the population is far from normal.
← All labsBased on Chapter 5, A/B Testing, of Polson and Sokolov, Bayes, Artificial Intelligence, and Deep Learning (vsokolov.org/html/_book).
The Mint tests a batch of n = 2,500 coins. Each should weigh 100 grams, with a tolerance of ±1 gram per coin. The Trial allowed the batch average the same ±1 gram, which means the whole box could be off by n × 1 = 2,500 grams. If each coin varies with SD σ = 1 gram, the box total varies with SD σ√n = 50 grams, so an honest box never comes close to that limit. A Master of the Mint can shave gold off every coin and still pass. These are illustrative numbers.
| Mint rule | √n rule | |
|---|---|---|
| Allowed error on the total | – | – |
| Allowed error on the average | – | – |
| P(honest box passes) | – | – |
| P(shaved box passes) | – | – |
| Largest δ that passes 95% of the time | – | – |
| Weighed boxes that passed | – | – |
Each draw has variance σ². The mean of n independent draws has variance σ²/n, so its SD, the standard error, is σ/√n. To halve the standard error you need four times the data.
Across many datasets of size n, x̄ is centered on μ and is close to normal once n is moderate. Skewed populations need a larger n: the skewness of x̄ shrinks like 1/√n. In practice σ is unknown and s replaces it.
A classic exercise asks for 10,000 simulated A/B tests with 5,000 users per arm and 3% conversion. One arm's conversion rate is the mean of 5,000 Bernoulli(0.03) draws. Its histogram is the sampling distribution that the Z-test relies on.