Confidence intervals for the mean
Master confidence intervals for the mean in Year 12 Specialist Mathematics for Queensland (QCAA). A confidence interval turns a sample mean \(\bar x\) into an interval estimate for the population mean \(\mu\), using the approximate interval \(\bar x \pm z\dfrac{s}{\sqrt n}\).
You will learn to compute the standard error \(\dfrac{s}{\sqrt n}\), choose the quantile \(z\) for 90%, 95% or 99% confidence, find the margin of error \(E=z\dfrac{s}{\sqrt n}\), solve for the required sample size, and interpret an interval correctly — a core skill in Unit 4 statistical inference.
Theory
A confidence interval for the mean gives a range of plausible values for a population mean \(\mu\), built from a sample. In Year 12 Specialist Mathematics (QCAA, Queensland) you use the approximate interval \(\left(\bar x - z\dfrac{s}{\sqrt n},\ \bar x + z\dfrac{s}{\sqrt n}\right)\), with the standard-normal quantile \(z\) chosen for the confidence level, the margin of error \(E=z\dfrac{s}{\sqrt n}\), and the link between \(E\), confidence and sample size.
A single number from a sample, such as the sample mean \(\bar x\), is a point estimate of the population mean \(\mu\). A confidence interval is an interval estimate: a range around \(\bar x\) that is likely to contain \(\mu\).
The confidence level (90%, 95% or 99%) sets how much of the standard normal distribution the interval covers, which fixes the quantile \(z\): \(z=1.645\) for 90%, \(z=1.96\) for 95% and \(z=2.576\) for 99%. A higher confidence level needs a larger \(z\).
The standard error of the sample mean is \(\dfrac{s}{\sqrt n}\), where \(s\) is the sample standard deviation and \(n\) the sample size; it measures how much \(\bar x\) varies from sample to sample. The margin of error \(E=z\dfrac{s}{\sqrt n}\) is the half-width of the interval, so the interval is \(\bar x \pm E\).
Interpreting a confidence interval matters: the level describes the method, not one interval. If many samples were taken and an interval built from each, about that percentage of them would contain \(\mu\). Intervals vary between samples, and most — but not all — contain \(\mu\).
The approximate confidence interval for a population mean \(\mu\), from a sample of size \(n\) with mean \(\bar x\) and standard deviation \(s\):
The margin of error is the half-width of the interval, the quantile \(z\) times the standard error \(\dfrac{s}{\sqrt n}\):
To make the margin of error at most a chosen \(E\), rearrange and round the sample size up to the next whole number:
| Confidence level | 90% | 95% | 99% |
|---|---|---|---|
| Quantile \(z\) | \(1.645\) | \(1.96\) | \(2.576\) |
How to build a confidence interval for the mean
- Find the standard error of the sample mean, \(\dfrac{s}{\sqrt n}\), from the sample standard deviation \(s\) and the sample size \(n\).
- Choose the quantile \(z\) for the confidence level: \(1.645\) for 90%, \(1.96\) for 95%, \(2.576\) for 99%.
- Compute the margin of error \(E = z\,\dfrac{s}{\sqrt n}\) (the standard error scaled by \(z\)).
- Form the interval \(\bar x \pm E\), i.e. \(\left(\bar x - E,\ \bar x + E\right)\) — or, to meet a required margin, solve \(n \ge \left(\dfrac{z\,s}{E}\right)^2\) and round up.
Find the standard error \(s/\sqrt n\):
| \(\dfrac{s}{\sqrt n}\) | \(=\) | \(\dfrac{18}{\sqrt{36}}\) |
| \(=\) | \(\dfrac{18}{6}\) | |
| \(=\) | \(3\) |
Margin of error \(E = z\,s/\sqrt n\):
| \(E\) | \(=\) | \(1.96 \times 3\) |
| \(=\) | \(5.88\) |
Form the interval \(\bar x \pm E\):
| \(\text{lower}\) | \(=\) | \(240 - 5.88 = 234.12\) |
| \(\text{upper}\) | \(=\) | \(240 + 5.88 = 245.88\) |
The \(95\%\) confidence interval is \((234.12,\ 245.88)\) hours.
Standard error first:
| \(\dfrac{s}{\sqrt n}\) | \(=\) | \(\dfrac{13.5}{\sqrt{81}}\) |
| \(=\) | \(\dfrac{13.5}{9}\) | |
| \(=\) | \(1.5\) |
Scale by \(z\) for \(90\%\):
| \(E\) | \(=\) | \(1.645 \times 1.5\) |
| \(=\) | \(2.4675\) | |
| \(\approx\) | \(2.47\) |
The margin of error is about \(2.47\) marks.
Set \(z\,s/\sqrt n \le E\) and solve for \(n\):
| \(n\) | \(\ge\) | \(\left(\dfrac{z\,s}{E}\right)^2\) |
| \(=\) | \(\left(\dfrac{2.576 \times 15}{5}\right)^2\) | |
| \(=\) | \((2.576 \times 3)^2\) | |
| \(=\) | \((7.728)^2\) | |
| \(=\) | \(59.72\ldots\) |
Round the sample size up to a whole number:
| \(n\) | \(=\) | \(60\) |
A sample of \(60\) bottles is required.
The sample mean is the midpoint of the interval:
| \(\bar x\) | \(=\) | \(\dfrac{18.2 + 21.8}{2}\) |
| \(=\) | \(\dfrac{40}{2}\) | |
| \(=\) | \(20\) |
The margin of error is the half-width:
| \(E\) | \(=\) | \(\dfrac{21.8 - 18.2}{2}\) |
| \(=\) | \(\dfrac{3.6}{2}\) | |
| \(=\) | \(1.8\) |
Interpretation: if many samples were taken and an interval built from each, about \(95\%\) of those intervals would contain \(\mu\) — it is not a \(95\%\) probability for this one interval.
\(\bar x = 20\) and \(E = 1.8\); about \(95\%\) of such intervals contain \(\mu\).
Common pitfalls
Frequently asked questions
What is a confidence interval for the mean?
It is an interval estimate for the population mean \(\mu\), built from a sample as \(\left(\bar x - z\dfrac{s}{\sqrt n},\ \bar x + z\dfrac{s}{\sqrt n}\right)\). The centre is the sample mean \(\bar x\) and the half-width is the margin of error \(E=z\dfrac{s}{\sqrt n}\).
Which z value do I use for 90%, 95% and 99%?
Use the standard normal quantile for that confidence level: \(z=1.645\) for 90%, \(z=1.96\) for 95%, and \(z=2.576\) for 99%. A higher confidence level uses a larger \(z\).
What is the margin of error?
The margin of error is \(E=z\dfrac{s}{\sqrt n}\), the half-width of the confidence interval. The interval is then \(\bar x \pm E\).
How do I find the sample size for a given margin of error?
Solve \(z\dfrac{s}{\sqrt n}\le E\) for \(n\), giving \(n\ge\left(\dfrac{z\,s}{E}\right)^2\), then round the result up to the next whole number.
Why does a higher confidence level give a wider interval?
A higher confidence level uses a larger quantile \(z\), so the margin of error \(E=z\dfrac{s}{\sqrt n}\) grows and the interval \(\bar x \pm E\) becomes wider.
How should I interpret a 95% confidence interval?
It describes the method, not one interval. If many samples were taken and an interval built from each, about 95% of those intervals would contain \(\mu\). Intervals vary between samples, and most but not all contain \(\mu\).