Hypothesis Testing

Probability & Statistics

Hypothesis testing gives you a formal way to decide whether sample data provide enough evidence to cast doubt on a claim about a population. In H2 Maths you will almost always be testing a claim about a population mean μ\mu when the population variance σ2\sigma^2 is known, using the zz-test based on the sample mean Xˉ\bar{X}.

What you need to know

Z=xˉμ0σ/n.Z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}.

Worked example 1 — One-tailed z-test (right-tailed)

A manufacturer claims that the mean lifetime of a type of battery is 50 hours. A consumer group suspects the batteries last fewer hours than claimed and tests a random sample of 40 batteries, obtaining a sample mean of 47.6 hours. The population standard deviation is known to be 8 hours. Test the manufacturer’s claim at the 5% level of significance.

Solution.

Hypotheses:

H0:μ=50,H1:μ<50.H_0 : \mu = 50, \qquad H_1 : \mu < 50.

The alternative hypothesis is μ<50\mu < 50 because the consumer group suspects the mean is lower than claimed, giving a left-tailed test.

Test statistic:

Z=xˉμ0σ/n=47.6508/40=2.41.2649=1.897.Z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}} = \frac{47.6 - 50}{8 / \sqrt{40}} = \frac{-2.4}{1.2649} = -1.897.

p-value (from GC, left-tailed): p=P(Z<1.897)=0.0289p = P(Z < -1.897) = 0.0289.

Decision: Since 0.0289<0.05=α0.0289 < 0.05 = \alpha, we reject H0H_0.

Conclusion: There is sufficient evidence at the 5% significance level to conclude that the mean battery lifetime is less than 50 hours. The manufacturer’s claim is not supported by the data.

Worked example 2 — Two-tailed z-test

Using the same battery context, suppose instead a quality-control engineer simply wishes to check whether the mean lifetime has changed from 50 hours. She takes a fresh random sample of 40 batteries with sample mean 52.3 hours (σ=8\sigma = 8 still known). Test at the 5% level.

Solution.

Hypotheses:

H0:μ=50,H1:μ50.H_0 : \mu = 50, \qquad H_1 : \mu \neq 50.

Because the engineer has no prior reason to expect an increase or a decrease, the test is two-tailed.

Test statistic:

Z=52.3508/40=2.31.2649=1.818.Z = \frac{52.3 - 50}{8 / \sqrt{40}} = \frac{2.3}{1.2649} = 1.818.

p-value (from GC, two-tailed): p=2×P(Z>1.818)=2×0.0345=0.0690p = 2 \times P(Z > 1.818) = 2 \times 0.0345 = 0.0690.

Decision: Since 0.0690>0.05=α0.0690 > 0.05 = \alpha, we do not reject H0H_0.

Conclusion: There is insufficient evidence at the 5% significance level to conclude that the mean battery lifetime has changed from 50 hours.

One-tailed vs two-tailed: Note that the same observed xˉ=52.3\bar{x} = 52.3 would give a one-tailed p-value of 0.0345 (significant at 5%) if H1:μ>50H_1 : \mu > 50 were the correct formulation. The choice of tail must be justified by the context before seeing the data, not chosen to make the result significant.

Common mistakes

Ask MathChat about Hypothesis Testing →