TactivergeLite

Lite / Engineering Complex Systems / Week 28

How sure is your average? The standard error

Ten runs give a mean of 48.3 ms. Ten more give 47.6 ms. Which mean is right, and how far would a third batch wander?

About 40 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

Engineers rarely care about one run; they care about the true average behaviour of a design. The standard error tells you how precisely your sample pins that down, and therefore how many runs you need before a claimed 2% improvement means anything.

Predict

You quadruple the number of runs from 10 to 40. What happens to the standard error of the mean?

  1. It quarters
  2. It halves
  3. It stays the same
  4. It doubles
Guess first, then reveal

SE = s/√n, so four times the runs gives √4 = 2 times smaller SE. Precision improves only with the square root of effort: to halve the uncertainty again you need 160 runs.

Discover

Set σ = 4 and n = 4, then n = 16, then n = 64. Watch the dots (each experiment's mean) huddle closer to the true mean of 50. Read the standard error in the readout each time and check it halves.

What the interactive shows (text version)

The interactive draws 20 experiments, each the mean of n random readings around a true value of 50, and shows each mean as a dot with an interval. With σ = 4 the standard error is 2 for n = 4, 1 for n = 16 and 0.5 for n = 64: the dots cluster twice as tightly each time n is quadrupled.

You can also open the interactive on the full site when you have a faster connection.

Watch (optional)

Watch for: Watch for the moment the video separates 'how spread out are the measurements' from 'how spread out would the means be if we repeated the whole experiment'.

Separates the spread of the data from the uncertainty of its mean, the distinction every benchmark table depends on.

“Standard Deviation vs Standard Error, Clearly Explained!!!” by StatQuest with Josh Starmer (opens YouTube; streaming video uses a lot of data)

The video is optional. Everything you need is in this lesson's text.

Understand

Two different spreads

The standard deviation s describes individual measurements: how much one run differs from another. It does not shrink as you collect more data; it settles towards the true σ. The standard error SE = s/√n describes the mean: how much the average would differ if you repeated the whole experiment. It shrinks as n grows.

The sampling distribution

Imagine running your 10-run experiment thousands of times and plotting each mean. That histogram is the sampling distribution of the mean. Its centre is the true mean μ and its standard deviation is σ/√n. You never see it directly, but the standard error estimates its width from a single experiment.

Why it is close to normal

The central limit theorem says the mean of many independent random contributions tends towards a normal distribution, whatever the shape of each contribution (as long as its variance is finite). For moderate n (often 20–30 or more, fewer for symmetric data) the sampling distribution of the mean is close to normal. This is what justifies the normal approximation used throughout this term.

Precision costs effort

Because SE ∝ 1/√n, each halving of uncertainty needs four times the data. Decide the precision you need before collecting data. If σ ≈ 3 ms and you need to resolve a 1 ms difference, a quick calculation tells you whether 10 runs could ever be enough (they can't).

Explain it another way

Intuitive

One person's height tells you little about a town's average height. Average 100 people and you're close. Average 10,000 and you're very close, but not 100 times closer: only 10 times.

Technical

For independent, identically distributed xᵢ with variance σ²: Var(x̄) = σ²/n, so SD(x̄) = σ/√n. Estimate with SE = s/√n. Independence matters: correlated runs (thermal drift, caching) make the true SE larger than s/√n suggests.

Mathematical

Var(Σxᵢ) = Σ Var(xᵢ) = nσ² for independent xᵢ. Then Var(x̄) = Var(Σxᵢ)/n² = σ²/n. Taking the square root: σ/√n.

Applied

Chip makers characterise a new design over many dies and many runs; quoting the clock speed or power to two decimal places is only honest when the standard error supports two decimal places.

Worked example 1

s = 3.2 ms from n = 16 runs. Find the SE. How many runs would make the SE 0.4 ms?

SE = 3.2/√16 = 0.8 ms. For 0.4 ms: √n = 3.2/0.4 = 8, so n = 64 runs.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

ms

Practice 2. As you collect more and more runs, what happens to the sample SD and to the SE?

readings

Practice 4. Your laptop slowly heats up during a benchmark, so later runs are systematically slower. What does this do to s/√n as an estimate of the mean's uncertainty?

°C

Apply it

Take the 20 timings from the previous lesson. Compute the SE using the first 5 runs, the first 10 and all 20. Plot SE against n on log–log axes and check the slope is about −½.

Reflect

Why might a team that only ever runs a benchmark three times keep 'discovering' improvements that later vanish?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Distributions, spread and the one weird runIs the difference real? Effect sizes and correlation →