Resources For Teachers For Tutors For Students & Parents Pricing
Year 12 Specialist (Unit 3 & 4) Statistical inference

Confidence intervals for the mean

20 practice questions 0 video lessons Theory + worked examples

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.

Create a free accountTrack your progress and save your work as you go.
Create free account

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\).

A 95% confidence interval on a number line A number line with a thick bar from 44 to 56. A dot at the centre marks the sample mean x-bar equals 50. Bracket ends sit at the lower endpoint 44 (x-bar minus E) and the upper endpoint 56 (x-bar plus E). A red tick just right of centre marks the true mean mu, which lies inside the interval. μ E E 44 x̄ = 50 56 x̄ − E x̄ + E
A 95% confidence interval \(\bar x \pm E\): the sample mean \(\bar x\) sits at the centre, the endpoints are \(\bar x - E\) and \(\bar x + E\), and the true mean \(\mu\) usually lies inside.
Confidence intervals vary between samples Six horizontal confidence intervals from six samples are stacked above a vertical dashed line marking the true mean mu. Five of the intervals cross the line, so they contain mu; one interval sits entirely to the right and misses it. Most, but not all, intervals contain the population mean. μ (true mean) contains μ contains μ contains μ misses μ contains μ contains μ
Intervals vary between samples. A 95% confidence level means about 95% of intervals built this way contain \(\mu\) — most, but not all, capture the true mean.

The approximate confidence interval for a population mean \(\mu\), from a sample of size \(n\) with mean \(\bar x\) and standard deviation \(s\):

\[ \left(\bar x - z\,\dfrac{s}{\sqrt n},\ \bar x + z\,\dfrac{s}{\sqrt n}\right) \]
(x¯zsn,x¯+zsn)

The margin of error is the half-width of the interval, the quantile \(z\) times the standard error \(\dfrac{s}{\sqrt n}\):

\[ E = z\,\dfrac{s}{\sqrt n},\qquad \text{interval} = \bar x \pm E \]
E=zsn

To make the margin of error at most a chosen \(E\), rearrange and round the sample size up to the next whole number:

\[ n \ge \left(\dfrac{z\,s}{E}\right)^2 \]
n(zsE)2
Confidence level90%95%99%
Quantile \(z\)\(1.645\)\(1.96\)\(2.576\)
More confidence or a smaller margin costs data. Raising the confidence level increases \(z\), so the interval gets wider. To halve the margin of error at a fixed confidence level you must quadruple \(n\), because \(E\propto\dfrac{1}{\sqrt n}\).

How to build a confidence interval for the mean

  1. Find the standard error of the sample mean, \(\dfrac{s}{\sqrt n}\), from the sample standard deviation \(s\) and the sample size \(n\).
  2. Choose the quantile \(z\) for the confidence level: \(1.645\) for 90%, \(1.96\) for 95%, \(2.576\) for 99%.
  3. Compute the margin of error \(E = z\,\dfrac{s}{\sqrt n}\) (the standard error scaled by \(z\)).
  4. 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.
Example 1 — A 95% confidence interval
A sample of \(36\) rechargeable batteries has a mean life of \(\bar x = 240\) hours with sample standard deviation \(s = 18\) hours. Construct a \(95\%\) confidence interval for the mean life \(\mu\). (Use \(z = 1.96\).)
Solution

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.

A 95% confidence interval on a number line A number line with a thick bar from 44 to 56. A dot at the centre marks the sample mean x-bar equals 50. Bracket ends sit at the lower endpoint 44 (x-bar minus E) and the upper endpoint 56 (x-bar plus E). A red tick just right of centre marks the true mean mu, which lies inside the interval. μ E E 44 x̄ = 50 56 x̄ − E x̄ + E
Example 2 — Margin of error at 90%
A sample of \(81\) exam scripts has sample standard deviation \(s = 13.5\) marks. Find the margin of error for a \(90\%\) confidence interval for the mean mark. (Use \(z = 1.645\).)
Solution

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.

Example 3 — Required sample size
The fill volume of a bottling line has standard deviation \(s = 15\) mL. How large a sample is needed so that a \(99\%\) confidence interval for the mean has a margin of error of at most \(5\) mL? (Use \(z = 2.576\).)
Solution

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.

Example 4 — Read off and interpret
A \(95\%\) confidence interval for a population mean is reported as \((18.2,\ 21.8)\). Find the sample mean \(\bar x\) and the margin of error \(E\), and state what \(95\%\) confidence means.
Solution

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

Dividing by \(n\) instead of \(\sqrt n\). The standard error is \(\dfrac{s}{\sqrt n}\), not \(\dfrac{s}{n}\). For \(n=36\) you divide \(s\) by \(6\), not by \(36\).
Using the wrong \(z\). Match the quantile to the confidence level: \(1.645\) for 90%, \(1.96\) for 95%, \(2.576\) for 99%. A bigger confidence level uses a bigger \(z\) and gives a wider interval.
Rounding the sample size down. When you solve \(n \ge \left(\dfrac{z\,s}{E}\right)^2\), always round up to the next whole number — rounding down leaves the margin of error too large.
Misreading the interval as a probability. A 95% interval does not give a 95% probability that \(\mu\) is inside this interval. It means about 95% of intervals built this way, over many samples, contain \(\mu\).

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\).