School/□ Systems Engineer/Week 29
What a 95% confidence interval really promises
Your interval is 47.2 to 49.0 ms. Is there a 95% chance the true mean is in there?
About 45 min · 3 goals · Checked by automated tests
1.Why should I care?
An interval is the most honest way to report a measured quantity: it says what you know and how well. This lesson builds the interval, then tests what '95%' means by running thousands of experiments in the browser.
- ◇ Construct a normal-approximation confidence interval for a mean: x̄ ± z·s/√n.
- ◇ Interpret confidence as the long-run coverage of the method, not a probability about one interval.
- ◇ Explain when the normal approximation fails and what to do instead.
2.Discover
Keep 95% and n = 30. Press 'Draw 20 more experiments' ten times and watch the running tally approach 95%. Then set n = 3 and reset: the tally falls short. Finally switch to 99% and watch the bars lengthen.
Loading the interactive…
Can't use the interactive? Read a description instead
The simulator draws 20 experiments of n readings from a normal distribution with true mean 50 and builds a confidence interval from each, drawn as a horizontal bar. Bars that miss the true mean are marked 'miss'. Over many batches, about 95% of 95% intervals contain 50 when n is 30; with n = 3 coverage drops to roughly 80%, because z = 1.96 is too small when σ is estimated from so few points.
3.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1 · a fresh version every time
You repeat a measurement n = 49 times. The sample standard deviation is s = 0.8 W. Using the normal approximation (z = 1.96 for 95%), what is the half-width of the 95% confidence interval for the mean, in W? (3 significant figures.)
4.Predict
You draw 20 experiments and build a 95% interval from each. How many intervals will miss the true mean?
Guess first. Being wrong here is how the surprise works.
5.Understand
The recipe
- Compute x̄ and s from n independent measurements. 2. SE = s/√n. 3. Half-width h = z·SE. 4. Report x̄ ± h with the confidence level, n and the method. Example: 48.1 ± 0.9 ms (95% CI, n = 30, normal approximation).
The correct interpretation
If you repeated the whole experiment many times, about 95% of the intervals built this way would contain the true mean. Once your interval is computed, μ either is in it or isn't; you just don't know which. Saying 'there is a 95% probability μ lies between 47.2 and 49.0' is a common shortcut, but strictly it is a different (Bayesian) statement.
When the approximation breaks
The z-interval assumes independent data, a roughly normal sampling distribution and enough data to trust s. It under-covers for small n (use t), for strongly skewed data with small n (use more data, a transformation, or the bootstrap), and badly for correlated data such as drifting benchmarks. Systematic error is never captured: a mis-calibrated timer shifts every interval.
Width, level and effort
Higher confidence widens the interval (99% is about 31% wider than 95%). Quadrupling n halves it. Choose the level before you look at the data, and plan n from the half-width you need: n ≈ (z·σ/h)².
Explain it another way
Throwing a hoop at a hidden peg: the method lands the hoop over the peg 95 times out of 100. After one throw you can't see whether this hoop caught it.
Normal-approximation (Wald) CI for a mean: x̄ ± z_{1−α/2}·s/√n. Exact for known σ and normal data; asymptotically correct otherwise. The t-interval replaces z with t_{n−1, 1−α/2}.
Coverage probability = P(μ ∈ [x̄ − z·s/√n, x̄ + z·s/√n]). With σ known it is exactly 1 − α. With s it is P(|T| ≤ z) where T ~ t_{n−1}, which is below 1 − α; for n = 3 and z = 1.96 it is about 81%.
Spacecraft navigation teams quote 'error ellipses' for a probe's predicted position: multi-dimensional confidence regions that decide whether a trajectory correction manoeuvre is needed.
Derivation: Building the interval from the sampling distribution
For large n, the sample mean is approximately normal: x̄ ~ N(μ, σ²/n).
Standardise: Z = (x̄ − μ)/(σ/√n) ~ N(0, 1). For a standard normal, P(−1.96 ≤ Z ≤ 1.96) = 0.95.
Substitute: P(−1.96 ≤ (x̄ − μ)/(σ/√n) ≤ 1.96) = 0.95.
Rearrange the inequality for μ: P(x̄ − 1.96·σ/√n ≤ μ ≤ x̄ + 1.96·σ/√n) = 0.95. The random quantity is x̄, so this is a statement about the interval, not about μ.
σ is unknown, so replace it with s. For small n this extra uncertainty matters: use Student's t value (for example t = 2.26 instead of 1.96 when n = 10) or the interval will be too narrow.
Result (normal approximation): x̄ ± z·s/√n, with z = 1.645 (90%), 1.96 (95%) or 2.576 (99%).
Worked example 1
n = 36 runs, x̄ = 52.4 ms, s = 4.8 ms. Give the 95% CI.
SE = 4.8/6 = 0.8 ms. h = 1.96 × 0.8 = 1.57 ms. CI: 52.4 ± 1.6 ms, i.e. 50.8 to 54.0 ms.
Worked example 2
How many runs would give a half-width of 0.5 ms with the same s?
n = (1.96 × 4.8/0.5)² = (18.8)² ≈ 354 runs. Precision is expensive.
Common mix-ups
- A 95% CI contains 95% of the measurements.
✓ It describes uncertainty in the mean, which is about √n times narrower than the spread of individual measurements. - A narrower interval is always better.
✓ Only if it is honest. Ignoring drift, using z for tiny n or dropping inconvenient runs gives narrow, wrong intervals.
6.Watch
→ Watch how the interval is built from many resampled means before any formula appears; it is the same idea as the simulator.
Builds the idea of a confidence interval from resampling before any formula, so the 95% stops sounding like magic.
6 min 41 s · captions on YouTube · source
Nothing loads from YouTube until you press play.
The video is optional: everything you need is also in the lesson text and the interactive.
7.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2
Which statement correctly interprets a 95% confidence interval?
Practice 3 · a fresh version every time
A sensor's readings have standard deviation σ ≈ 4 units. How many repeated readings n do you need so that the 95% confidence interval for the mean has a half-width of at most 1.5 units? Use z = 1.96 and round n up to a whole number.
Practice 4
With n = 4 runs, you build x̄ ± 1.96·s/√n. What is the main risk?
Practice 5
x̄ = 20.0 °C, s = 1.0 °C, n = 25. What is the half-width of the 99% interval (z = 2.576), in °C?
8.Apply it
For your own 20 timings, build 90%, 95% and 99% intervals. Then build the 95% interval from the first 5 runs only, with z and with t (2.78 for n = 5). Which intervals overlap?
9.Reflect
10.Go further
Research mode: limits and open questions
Many fields now ask authors to report intervals instead of just p-values, because an interval shows the plausible size of an effect, not only whether it is distinguishable from zero.
Concepts: Confidence intervals · Measurement error and uncertainty