Answers · The mathematics underneath
Why does cutting the error in half require four times as many samples?
In shortThe error shrinks in proportion to one over the square root of the sample count, so halving it needs four times the samples.
Halving the error needs four times as many samples. The typical error of a simulated average is the spread of one draw divided by the square root of the number of draws, so the sample count sits under a square root and precision is bought at a quadratic price.
Take a quantity whose single computed draw has spread and take draws. The standard error is . To halve it to , solve : the square root of must be , so . That is four times the original count, not twice. Doubling the draws would give , a reduction of about 29 per cent, not 50 per cent.
The linear guess
The natural guess is that error falls in proportion to the number of draws: double the samples, halve the error. That would be true if errors added up, but they do not. Each draw contributes a deviation from the true value, and independent deviations partly cancel. The variance of a sum of independent draws is , so the variance of their average is . The spread is the square root of that variance, , which is why the count enters as a square root. Four times as many draws give twice as much cancellation in the standard deviation, not four times.
| draws | standard error | draws relative to row above |
|---|---|---|
| 100 | 0.1 | baseline |
| 400 | 0.05 | 4 |
| 1,600 | 0.025 | 4 |
| 6,400 | 0.0125 | 4 |
One more reliable decimal digit means reducing the error by a factor of ten, so the sample count rises by . From , where the error is , three digits needs error and therefore : one hundred times as many draws. At a million draws per second that is one second, while four digits needs seconds and five digits needs seconds, about two hours and forty-seven minutes. The arithmetic is unforgiving because each digit multiplies the previous cost by a hundred, not by ten.
For an estimated probability the same square root appears with a known spread. A single draw is one on success and zero otherwise, its variance is , and the standard error of the estimate after draws is . At , aiming for a standard error of needs ; aiming for needs , again four times. Planning at is the safe choice because is largest there, so every other probability needs no more draws for the same error.
Where the square root stops helping
The rule assumes independent draws and a spread that stays put as grows. Correlated samples, or a simulation whose values become more variable as it runs, break the calculation, and the error bar computed from the samples will be too small. It also assumes the average is the thing being estimated; a maximum or a quantile has a different rate. When the quantity is a probability, a very small changes the practical arithmetic: the precision is governed by the number of successes, not the number of draws, so a one-in-a-million event can need hundreds of millions of draws before the estimate means anything. The cheap alternative is to reduce instead of raising : halving the spread of one draw does exactly what quadrupling the sample count does, and that is often the only way to make a precise run feasible.
Worth keeping
- Standard error is the spread of one draw divided by the square root of the number of draws.
- Halving a standard error requires four times the samples; gaining one decimal digit requires one hundred times.
- For an estimated probability the standard error is the square root of p(1-p)/n, largest at p equal to one half.
Where this goes next
This question is one step of Answering With Random Samples, a course that works through its subject from the beginning. The page that teaches this part of it is How Far Off Is It, and it reads the whole way through whether or not you have an account.
What an account changes is the practice: problems standing under every idea, marked with a reason rather than a tick, in a copy of the course that is yours.
Read that pageThe whole courseOther questions people ask about this
- When should I give up on finding an exact formula and simulate instead?Give up on an exact formula when the quantity can be written as an average of something drawable, since simulation then gives an estimate with a measurable error.
- Why does the average of many random samples get closer to the true value as I take more samples?Because the average of independent draws is centred on the true value at every sample size, and its typical distance from that value shrinks like one over the square root of the number of draws.
- How do I estimate the error of a statistic when I don't have a formula for it?Resample your own data many times, recompute the statistic each time, and use the spread of those results as the error bar.
- What is the difference between variance and standard deviation?They measure the same spread: variance is the average squared distance from the mean, standard deviation is its square root, so you report the standard deviation and calculate with the variance.
- How do you make a vague claim precise enough to tell whether it's true?Fix what is being talked about, what is asserted, which cases are covered and the cut-off, then name an observation that would prove it false.
- How do you find the parabola that best fits a function near a point?Match the function's height, slope and bending at the chosen point; those three conditions single out exactly one parabola.