impera Open Impera

A levels Mathematics · Statistics

Hypothesis testing

1The language of hypothesis tests

A hypothesis test uses sample data to decide whether there is evidence against a claim about a population parameter.

  • The null hypothesis $H_0$ is the claim assumed true, such as $p = 0.3$.
  • The alternative hypothesis $H_1$ is what you suspect instead: $p > 0.3$ or $p < 0.3$ (one-tailed), or $p \neq 0.3$ (two-tailed).
  • The significance level (often 5%) is the threshold probability for rejecting $H_0$.
  • The test statistic is the value calculated from the sample.

If the result would be very unlikely under $H_0$ (probability below the significance level), reject $H_0$. Otherwise, there is insufficient evidence to reject it.

Check yourself

Which hypothesis is assumed true at the start?

  • Both

  • The null hypothesis

  • Neither

  • The alternative hypothesis

Show the answer

The null hypothesis

H₀ is tested against the data.

2A binomial hypothesis test

Worked example

Testing a claim

  1. A spinner should land on red with probability 0.25. In 20 spins it lands on red 9 times. Test at 5% whether red is more likely.
  2. $H_0: p = 0.25$, $H_1: p > 0.25$. Under $H_0$, $X \sim B(20, 0.25)$.
  3. $P(X \geq 9) = 1 - P(X \leq 8) = 0.0409$.
  4. $0.0409 < 0.05$, so reject $H_0$.
  5. Conclusion: there is evidence at the 5% level that the spinner lands on red more often than 0.25.

Always calculate the probability of the observed value or more extreme, not just the exact value.

Check yourself

Why do you calculate P(X ≥ 9) rather than P(X = 9)?

  • P(X = 9) is always zero for a binomial distribution

  • It is easier to calculate on a calculator

  • You need the probability of the result or something more extreme

  • Because the alternative hypothesis H₁ is two-tailed

Show the answer

You need the probability of the result or something more extreme

Any single value can be unlikely.

3Critical regions

The critical region is the set of values of the test statistic that lead to rejecting $H_0$. The boundary is the critical value.

The actual significance level is the probability of landing in the critical region when $H_0$ is true; for discrete data it is usually a little below the nominal level.

Worked example

A lower-tail critical region

  1. $H_0: p = 0.4$, $H_1: p < 0.4$, with $n = 20$, at 5%.
  2. $P(X \leq 3) = 0.0160$ and $P(X \leq 4) = 0.0510$.
  3. $0.0510 > 0.05$, so the critical region is $X \leq 3$.
  4. Actual significance level: $0.0160$, or 1.6%.

Testing H₁: p < 0.4 at 5%. Adding 4 would push the tail to 5.1%, so the critical region stops at 3.

Check yourself

The critical region is X ≥ 9 with P(X ≥ 9) = 0.041. What is the actual significance level?

  • 95.9%

  • 4.1%

  • 9%

  • 5%

Show the answer

4.1%

The probability of rejecting H₀ when it is true.

4Two-tailed tests

In a two-tailed test, the significance level is split between the two tails.

Worked example

Is a coin fair?

  1. A coin is tossed 15 times. Test at 5% whether it is biased. $H_0: p = 0.5$, $H_1: p \neq 0.5$.
  2. Each tail gets 2.5%.
  3. Lower tail: $P(X \leq 3) = 0.0176$, $P(X \leq 4) = 0.0592$, so $X \leq 3$.
  4. Upper tail: by symmetry, $X \geq 12$.
  5. Critical region: $X \leq 3$ or $X \geq 12$. Actual level: $2 \times 0.0176 = 3.5\%$.

If the coin gives 11 heads, 11 is not in the critical region: there is insufficient evidence that the coin is biased.

Check yourself

In a two-tailed test at 10%, what is the probability in each tail?

  • 5%

  • 10%

  • 20%

  • 2.5%

Show the answer

5%

Split the level equally.

5Testing a normal mean

For a normal population with known $\sigma$, the sample mean of $n$ observations has distribution

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

Worked example

Testing a mean

  1. Bags of flour should have mean mass 1000 g, with $\sigma = 12$ g. A sample of 25 bags has mean 995 g. Test at 5% whether the mean is less than 1000 g.
  2. $H_0: \mu = 1000$, $H_1: \mu < 1000$. Under $H_0$, $\bar{X} \sim N\left(1000, \frac{144}{25}\right)$, so the standard deviation of $\bar{X}$ is 2.4.
  3. $z = \frac{995 - 1000}{2.4} = -2.083$.
  4. $P(Z < -2.083) = 0.0186 < 0.05$, so reject $H_0$.
  5. There is evidence that the mean mass of bags is less than 1000 g.

Larger samples make $\bar{X}$ less variable, so smaller differences become significant.

Check yourself

What is the standard deviation of X̄ for samples of 16 from N(μ, 8²)?

  • 2

  • 4

  • 8

  • 0.5

Show the answer

2

σ/√n = 8/4.

6Writing conclusions

A good conclusion:

  • compares the probability (or test statistic) with the significance level, or checks if it is in the critical region;
  • states whether to reject $H_0$;
  • gives the result in context, using non-definite language.

Good: "There is sufficient evidence at the 5% level to suggest that the proportion of faulty items has increased."

Poor: "This proves the machine is broken."

A hypothesis test never proves $H_0$ or $H_1$. Not rejecting $H_0$ does not mean $H_0$ is true; it only means there is not enough evidence against it.

Check yourself

What does "do not reject H₀" mean?

  • H₀ has been proved to be true

  • H₁ has been proved to be false

  • There is not enough evidence against H₀

  • The test failed and must be repeated

Show the answer

There is not enough evidence against H₀

Absence of evidence is not proof.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera