๐ŸŽฏ Testing a Normal Mean

A Level Maths Year 2 ยท Hypothesis Testing

Level 3 · Ages 17–18

← Back to topic overview
1 The Distribution of the Sample Mean

Suppose a population is modelled by $X \sim \mathrm{N}(\mu,\ \sigma^2)$ and we take a random sample $X_1, X_2, \ldots, X_n$. The sample mean $\bar{X} = \dfrac{X_1 + X_2 + \cdots + X_n}{n}$ is itself a random variable โ€” a different sample gives a different mean.

Sampling distribution of the mean
If $X \sim \mathrm{N}(\mu,\ \sigma^2)$ then $\bar{X} \sim \mathrm{N}\!\left(\mu,\ \dfrac{\sigma^2}{n}\right)$
standard deviation of $\bar{X}$:   $\dfrac{\sigma}{\sqrt{n}}$
The sample mean has the same centre as the population but is less spread out: averaging cancels out some of the variation. Quadrupling the sample size halves the standard deviation of $\bar{X}$. That is why a larger sample gives a more sensitive test.
Worked Example 1 โ€” Probabilities for $\bar{X}$

The lengths of bolts are $X \sim \mathrm{N}(25,\ 0.8^2)$ mm. A random sample of $16$ bolts is taken. Find $\mathrm{P}(\bar{X} > 25.4)$, and compare with $\mathrm{P}(X > 25.4)$ for a single bolt.

โ‘ $\bar{X} \sim \mathrm{N}\!\left(25,\ \dfrac{0.8^2}{16}\right) = \mathrm{N}(25,\ 0.2^2)$
โ‘ก$\mathrm{P}(\bar{X} > 25.4) = 1 - \Phi\!\left(\dfrac{0.4}{0.2}\right) = 1 - \Phi(2) = 0.0228$
โ‘ขFor one bolt: $1 - \Phi\!\left(\dfrac{0.4}{0.8}\right) = 1 - \Phi(0.5) = 0.309$.
โ‘ฃOne long bolt is common; a sample of $16$ averaging this long is rare.
2 Setting Up the Test

The structure is exactly the one you used for binomial tests in Year 1 (Binomial Hypothesis Tests); only the distribution changes. The standard deviation $\sigma$ is assumed known and unchanged; the test is about the mean.

Test for a normal mean, $\sigma$ known
$\mathrm{H}_0: \mu = \mu_0$  ·  $\mathrm{H}_1: \mu > \mu_0$,  $\mu < \mu_0$  or  $\mu \neq \mu_0$
Under $\mathrm{H}_0$: $\bar{X} \sim \mathrm{N}\!\left(\mu_0,\ \dfrac{\sigma^2}{n}\right)$    test statistic $z = \dfrac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}$
Significance levelOne tail: critical $z$Two tails: critical $z$
$10\%$$1.2816$$\pm 1.6449$
$5\%$$1.6449$$\pm 1.9600$
$2.5\%$$1.9600$$\pm 2.2414$
$1\%$$2.3263$$\pm 2.5758$

There are three equivalent ways to reach a decision โ€” use whichever the question asks for:

Divide by $\sigma/\sqrt{n}$, not $\sigma$. Using the population standard deviation instead of the standard deviation of the mean is the most common error, and it makes almost every result look non-significant.
3 One-Tailed Tests
Worked Example 2 โ€” Testing for an increase

Bolt lengths are normally distributed with standard deviation $0.8$ mm, and should have mean $25$ mm. An engineer suspects the machine now makes bolts that are too long. A random sample of $16$ bolts has mean $25.4$ mm. Test at the $5\%$ level.

โ‘ $\mathrm{H}_0: \mu = 25$, $\mathrm{H}_1: \mu > 25$, where $\mu$ is the mean length of all bolts now produced.
โ‘กUnder $\mathrm{H}_0$: $\bar{X} \sim \mathrm{N}(25,\ 0.2^2)$.
โ‘ข$p$-value: $\mathrm{P}(\bar{X} \geqslant 25.4) = 1 - \Phi(2) = 0.0228$.
โ‘ฃ$0.0228 < 0.05$: reject $\mathrm{H}_0$.
โ‘คThere is sufficient evidence at the $5\%$ level to suggest the mean bolt length has increased.
Critical region version: reject if $\bar{x} \geqslant 25 + 1.6449 \times 0.2 = 25.33$ (2 d.p.). Since $25.4 \geqslant 25.33$, the same conclusion follows.
24.8 25.0 25.2 25.33 xฬ„ = 25.4 5% Distribution of Xฬ„ under Hโ‚€: N(25, 0.2ยฒ); critical region shaded
Worked Example 3 โ€” Testing for a decrease

Battery lifetimes are normally distributed with mean $220$ hours and standard deviation $15$ hours. A new production method is thought to reduce the mean lifetime. A sample of $25$ new batteries has mean $214.5$ hours. Test at the $2.5\%$ level, assuming the standard deviation is unchanged.

โ‘ $\mathrm{H}_0: \mu = 220$, $\mathrm{H}_1: \mu < 220$.
โ‘กUnder $\mathrm{H}_0$: $\bar{X} \sim \mathrm{N}\!\left(220,\ \dfrac{15^2}{25}\right) = \mathrm{N}(220,\ 3^2)$.
โ‘ข$z = \dfrac{214.5 - 220}{3} = -1.833$; critical value $-1.9600$.
โ‘ฃ$-1.833 > -1.960$: not in the critical region. Do not reject $\mathrm{H}_0$. ($p$-value $= \Phi(-1.833) = 0.0334 > 0.025$.)
โ‘คThere is insufficient evidence at the $2.5\%$ level to suggest the mean lifetime has decreased.
At the $5\%$ level the conclusion would change ($0.0334 < 0.05$). Always state the level in your conclusion.
4 Two-Tailed Tests and Critical Regions
Worked Example 4 โ€” A two-tailed test with a critical region

A machine fills cans with a volume that is normally distributed with standard deviation $4$ ml. The mean is meant to be $330$ ml. A sample of $20$ cans has mean $331.9$ ml. (a) Find the critical region for a two-tailed test at the $5\%$ level. (b) Carry out the test.

โ‘ $\mathrm{H}_0: \mu = 330$, $\mathrm{H}_1: \mu \neq 330$.
โ‘กUnder $\mathrm{H}_0$: $\bar{X} \sim \mathrm{N}\!\left(330,\ \dfrac{16}{20}\right)$, standard deviation $\dfrac{4}{\sqrt{20}} = 0.8944$.
โ‘ข$2.5\%$ in each tail: $z = \pm 1.96$. Boundaries $330 \pm 1.96 \times 0.8944 = 330 \pm 1.753$.
โ‘ฃ(a) Critical region: $\bar{X} \leqslant 328.25$ or $\bar{X} \geqslant 331.75$ (2 d.p.).
โ‘ค(b) $331.9 \geqslant 331.75$: in the critical region. Reject $\mathrm{H}_0$. There is sufficient evidence at the $5\%$ level that the mean volume is not $330$ ml.
$p$-value check: $\mathrm{P}(\bar{X} \geqslant 331.9) = 0.0168 < 0.025$ โœ“ โ€” for a two-tailed test, compare one tail with half the level.
Worked Example 5 โ€” How big a sample?

For the bolts ($\sigma = 0.8$, $\mathrm{H}_0: \mu = 25$, $\mathrm{H}_1: \mu > 25$, $5\%$ level), find the smallest sample size for which a sample mean of $25.3$ would be significant.

โ‘ Need $\dfrac{25.3 - 25}{0.8/\sqrt{n}} \geqslant 1.6449$, i.e. $\sqrt{n} \geqslant \dfrac{1.6449 \times 0.8}{0.3} = 4.386$.
โ‘ก$n \geqslant 19.24$, so the smallest sample size is $n = 20$.
5 Assumptions and Interpretation
AssumptionWhy it matters
The population is normally distributedMakes $\bar{X}$ exactly normal. (For large $n$, $\bar{X}$ is approximately normal anyway.)
$\sigma$ is known and unchangedThe test uses $\sigma/\sqrt{n}$; if a change of process alters the spread as well as the mean, the test is unreliable.
The sample is randomObservations must be independent and representative, e.g. not all from one batch.
Conclusions are about $\mu$, in context, and never certain. Write "there is sufficient evidence to suggest the mean โ€ฆ has increased", not "the mean has increased" or "$\mathrm{H}_0$ is false". Not rejecting $\mathrm{H}_0$ does not prove it true.
6 Quick Reference

Sample mean

$\bar{X} \sim \mathrm{N}\!\left(\mu,\ \dfrac{\sigma^2}{n}\right)$

Test statistic

$z = \dfrac{\bar{x} - \mu_0}{\sigma/\sqrt{n}}$

Hypotheses

About the population mean $\mu$; $\mathrm{H}_0: \mu = \mu_0$.

$5\%$ critical $z$

One tail $1.6449$; two tails $\pm 1.96$.

$1\%$ critical $z$

One tail $2.3263$; two tails $\pm 2.5758$.

Critical region

$\bar{x} \geqslant \mu_0 + z\dfrac{\sigma}{\sqrt{n}}$ (upper tail)

$p$-value

Reject if less than the level (half the level per tail for two-tailed).

Sample size

Solve $\dfrac{\bar{x} - \mu_0}{\sigma/\sqrt{n}} \geqslant z$ for $n$; round up.

Assumptions

Normal population, $\sigma$ known and unchanged, random sample.

7 Practice Questions

Ten questions, from routine to exam-style. Work each one through before opening the solution.

Question 1

$X \sim \mathrm{N}(40,\ 9)$. A random sample of size $16$ is taken. State the distribution of $\bar{X}$ and find $\mathrm{P}(\bar{X} < 39)$.

โ–ถ Show solution

$\bar{X} \sim \mathrm{N}\!\left(40,\ \dfrac{9}{16}\right)$, standard deviation $\dfrac{3}{4} = 0.75$.

$\mathrm{P}(\bar{X} < 39) = \Phi\!\left(\dfrac{-1}{0.75}\right) = \Phi(-1.333) = 0.0912$

Question 2

$X \sim \mathrm{N}(\mu,\ 6^2)$. Test $\mathrm{H}_0: \mu = 50$ against $\mathrm{H}_1: \mu > 50$ at the $5\%$ level, given that a sample of $36$ has mean $51.8$.

โ–ถ Show solution

Under $\mathrm{H}_0$: $\bar{X} \sim \mathrm{N}(50,\ 1^2)$, since $6/\sqrt{36} = 1$.

$\mathrm{P}(\bar{X} \geqslant 51.8) = 1 - \Phi(1.8) = 0.0359 < 0.05$

Reject $\mathrm{H}_0$: sufficient evidence at the $5\%$ level that $\mu > 50$.

Question 3

$X \sim \mathrm{N}(\mu,\ 10^2)$. For a test of $\mathrm{H}_0: \mu = 120$ against $\mathrm{H}_1: \mu < 120$ at the $1\%$ level using a sample of $25$, find the critical region for $\bar{X}$.

โ–ถ Show solution

$\sigma/\sqrt{n} = 10/5 = 2$; critical $z = -2.3263$.

Boundary: $120 - 2.3263 \times 2 = 115.35$.

Critical region: $\bar{X} \leqslant 115.35$ (2 d.p.).

Question 4

$X \sim \mathrm{N}(\mu,\ 5^2)$. A sample of $40$ gives $\bar{x} = 76.4$. Test $\mathrm{H}_0: \mu = 75$ against $\mathrm{H}_1: \mu \neq 75$ at the $5\%$ level.

โ–ถ Show solution

$\sigma/\sqrt{n} = 5/\sqrt{40} = 0.7906$; $z = \dfrac{1.4}{0.7906} = 1.771$.

Two-tailed critical values $\pm 1.96$; $1.771 < 1.96$.

Do not reject $\mathrm{H}_0$: insufficient evidence at the $5\%$ level that $\mu \neq 75$.

Question 5

The masses of bags of sugar are normally distributed with standard deviation $0.5$ kg; the stated mean is $8$ kg. A trading standards officer weighs $12$ bags and finds a mean of $7.74$ kg. Find the $p$-value for a test of whether the mean is less than $8$ kg, and state the conclusion at the $5\%$ level.

โ–ถ Show solution

$\mathrm{H}_0: \mu = 8$, $\mathrm{H}_1: \mu < 8$. Under $\mathrm{H}_0$, $\bar{X} \sim \mathrm{N}\!\left(8,\ \dfrac{0.25}{12}\right)$, standard deviation $0.1443$.

$p = \mathrm{P}(\bar{X} \leqslant 7.74) = \Phi(-1.801) = 0.0358$

$0.0358 < 0.05$: reject $\mathrm{H}_0$. There is sufficient evidence that the mean mass is less than $8$ kg.

Question 6

$X \sim \mathrm{N}(\mu,\ 12^2)$. Find the critical region for a two-tailed test of $\mathrm{H}_0: \mu = 200$ at the $10\%$ level using a sample of $9$.

โ–ถ Show solution

$\sigma/\sqrt{n} = 12/3 = 4$; $5\%$ in each tail, $z = \pm 1.6449$.

$200 \pm 1.6449 \times 4 = 200 \pm 6.58$

Critical region: $\bar{X} \leqslant 193.42$ or $\bar{X} \geqslant 206.58$.

Question 7

$X \sim \mathrm{N}(\mu,\ 8^2)$. Find the smallest sample size for which a sample mean of $62$ would lead to rejecting $\mathrm{H}_0: \mu = 60$ in favour of $\mathrm{H}_1: \mu > 60$ at the $5\%$ level.

โ–ถ Show solution

Need $\dfrac{2}{8/\sqrt{n}} \geqslant 1.6449$, i.e. $\sqrt{n} \geqslant 4 \times 1.6449 = 6.580$.

$n \geqslant 43.29$, so $n = 44$.

Question 8

A process produces rods whose lengths are normally distributed with standard deviation $2.1$ cm and target mean $30$ cm. Ten rods measure (cm):

$29.1,\ 31.4,\ 30.8,\ 32.2,\ 28.9,\ 31.7,\ 30.5,\ 32.6,\ 31.1,\ 30.9$

Test at the $5\%$ level whether the mean differs from $30$ cm.

โ–ถ Show solution

$\bar{x} = \dfrac{309.2}{10} = 30.92$.

$\mathrm{H}_0: \mu = 30$, $\mathrm{H}_1: \mu \neq 30$. $\sigma/\sqrt{n} = 2.1/\sqrt{10} = 0.6641$.

$z = \dfrac{0.92}{0.6641} = 1.385$; $1.385 < 1.96$.

Do not reject $\mathrm{H}_0$: insufficient evidence at the $5\%$ level that the mean length differs from $30$ cm.

Question 9

For a one-tailed test of $\mathrm{H}_0: \mu = 50$ against $\mathrm{H}_1: \mu > 50$ at the $5\%$ level, with a sample of $25$ from $\mathrm{N}(\mu,\ \sigma^2)$, the critical region is $\bar{X} \geqslant 52.47$. Find $\sigma$.

โ–ถ Show solution

$52.47 = 50 + 1.6449 \times \dfrac{\sigma}{5}$

$\sigma = \dfrac{2.47 \times 5}{1.6449} = 7.51$ (3 s.f.)

Question 10

The time taken to complete a puzzle is normally distributed with mean $18.0$ minutes and standard deviation $4.2$ minutes. After a training course, a random sample of $30$ people has mean time $16.7$ minutes.

(a) State hypotheses to test whether the training reduces the mean time. (b) Find the critical region at the $1\%$ level. (c) Carry out the test. (d) Find the $p$-value and state the conclusion at the $5\%$ level instead. (e) State an assumption you have made about the standard deviation, and explain why the test is still reasonable if the times are not exactly normal.

โ–ถ Show solution

(a) $\mathrm{H}_0: \mu = 18$, $\mathrm{H}_1: \mu < 18$, where $\mu$ is the mean time after training.

(b) $\sigma/\sqrt{n} = 4.2/\sqrt{30} = 0.7668$. Boundary $18 - 2.3263 \times 0.7668 = 16.22$. Critical region $\bar{X} \leqslant 16.22$ (2 d.p.).

(c) $16.7 > 16.22$: not in the critical region. Do not reject $\mathrm{H}_0$; insufficient evidence at the $1\%$ level that training reduces the mean time.

(d) $z = \dfrac{16.7 - 18}{0.7668} = -1.695$; $p = \Phi(-1.695) = 0.0450$. Since $0.0450 < 0.05$, reject $\mathrm{H}_0$ at the $5\%$ level โ€” there is evidence that training reduces the mean time.

(e) The standard deviation is assumed to remain $4.2$ minutes after training. With a sample of $30$, the sample mean is approximately normally distributed even if individual times are not exactly normal, so the test is still reasonable.

Testing a Normal Mean · A Level Maths Year 2 · Created with MathJax