OCR A-level Mathematics A (H240) · 2.05 Statistical Hypothesis Testing
Mini-Lesson
Hypothesis testing
2 missions. Guess, learn, then check. Your place is saved.
Mission 1A coin lands heads 15 times in 20 throws. Is it biased?
Mission 2Bags should average 500 g. Thirty bags average 497 g. Suspicious?
The specification points and sources are listed under the lesson: see Sources.
Mission 1
A coin lands heads 15 times in 20 throws. Is it biased?
Make a guess: A coin lands heads 15 times in 20 throws. Is it biased?
Hypothesis testing · binomial tests
The language of a hypothesis test
The null hypothesisH0H₀ states a value of the population parameter, e.g. H0:p=0.5H₀colon p = 0.5. The alternative hypothesisH1H₁ says how it may differ: p>0.5p > 0.5 or p<0.5p < 0.5 (1-tail), or p=0.5p ≠ 0.5 (2-tail).
Define pp in context, e.g. "pp is the probability that the coin lands heads".
The test statistic is the sample count, X∼B(n,p)X ~ B(n, p) assuming H0H₀ is true.
The significance level is the cut-off probability for "too unlikely if H0H₀ is true", e.g. 5%.
Quick check
?A dice should show a six with probability 611/6. Jo suspects her dice shows a six less often than this, and rolls it 40 times. Which hypotheses should she test?
Worked exampleHypothesis testing · binomial tests
A 1-tail test using a p-value
Question
A sweet maker says 30% of its sweets are red. Asha thinks the proportion is higher. A random bag of 25 sweets has 12 red. Test Asha's claim at the 5% level.
1
State hypotheses: H0:p=0.3H₀colon p = 0.3, H1:p>0.3H₁colon p > 0.3, where pp is the proportion of red sweets
2
Model under H0H₀: X∼B(25,0.3)X ~ B(25, 0.3), where XX is the number of red sweets
3
Find the probability of 12 or more: P(X≥12)=1−P(X≤11)=1−0.9558=0.0442P(X ≥ 12) = 1 − P(X ≤ 11) = 1 − 0.9558 = 0.0442
4
Compare with the level: 0.0442<0.050.0442 < 0.05, so the result is significant: reject H0H₀
Answer
There is sufficient evidence at the 5% level to reject H0H₀. It is likely that more than 30% of the sweets are red.
⚠️ Watch out
the p-value is P(X≥12)P(X ≥ 12), not P(X=12)=0.0268P(X = 12) = 0.0268. You need the result or anything more extreme.
Hypothesis testing · binomial tests
Critical regions and the actual significance level
The critical region is the set of values that lead you to reject H0H₀; a critical value is its boundary value (a 2-tail test has two). The rest is the acceptance region.
For a 2-tail test at 5%, each tail has probability at most 2.5%. Compare xx with npnp, the expected number of successes, to see which tail it is in.
For discrete counts the actual significance level, P(X in critical region)P(X in critical region), is usually below the stated level.
The significance level is the probability of incorrectly rejectingH0H₀.
Worked exampleHypothesis testing · binomial tests
A 2-tail critical region
Question
X∼B(30,0.4)X ~ B(30, 0.4). Find the critical region for a test of H0:p=0.4H₀colon p = 0.4 against H1:p=0.4H₁colon p ≠ 0.4 at the 5% level, and its actual significance level.
1
Each tail may have at most 0.025
2
Lower tail, using cumulative probabilities: P(X≤6)=0.0172P(X ≤ 6) = 0.0172 but P(X≤7)=0.0435P(X ≤ 7) = 0.0435, so X≤6X ≤ 6
Add the two tails: 0.0172+0.0212=0.03840.0172 + 0.0212 = 0.0384
Answer
critical region X≤6X ≤ 6 or X≥18X ≥ 18; actual significance level 0.0384 (3.84%)
⚠️ Watch out
P(X≥18)P(X ≥ 18) is 1−P(X≤17)1 − P(X ≤ 17). Using 1−P(X≤18)1 − P(X ≤ 18) gives the probability of 19 or more.
Calculate
?A website says 35% of visitors buy something. After a redesign, the manager believes the proportion has increased. She will test H0:p=0.35H₀colon p = 0.35 against H1:p>0.35H₁colon p > 0.35 at the 5% level using a random sample of 30 visitors. Find the critical value.
Calculate
?For the test in the last question, find the actual significance level. Give your answer to 3 significant figures.
Sort it
?Is each conclusion well written?
Tap a statement, then tap the group it belongs in. Then press Check.
Quick check
?A test is carried out at the 5% significance level. What does the 5% represent?
Mission check
?A coin lands heads 15 times in 20 throws. Test at the 5% level whether it is biased.
Under H0:p=0.5H₀colon p = 0.5, X∼B(20,0.5)X ~ B(20, 0.5) and P(X≥15)=0.0207<0.025P(X ≥ 15) = 0.0207 < 0.025, so there is evidence at the 5% level that the coin is biased. How sure? A fair coin gives a result this extreme (15 or more heads, or 5 or fewer) about 4% of the time, so the conclusion could still be wrong.
Mission 2
Bags should average 500 g. Thirty bags average 497 g. Suspicious?
Make a guess: Bags should average 500 g. Thirty bags average 497 g. Suspicious?
Hypothesis testing · correlation and the normal mean
The sample mean as a random variable (A-level only)
Each random sample of size nn gives a different mean, so the sample mean XˉX̄ is a random variable.
If X∼N(μ,σ2)X ~ N(μ, σ²), then
Xˉ∼N(μ,nσ2)X̄ ~ N(μ, σ²/n)
Its standard deviation is nσσ/(√n): averages vary much less than single values.
To test a mean, state H0:μ=μ0H₀colon μ = μ₀ and H1H₁ in terms of μμ, then standardise:
?X∼N(80,152)X ~ N(80, 15²). A random sample of 25 values of XX is taken. What is the distribution of the sample mean XˉX̄?
Worked exampleHypothesis testing · correlation and the normal mean
A test for a normal mean
Question
Journey times on a route are normally distributed with mean 42 minutes and standard deviation 6 minutes. After roadworks, a random sample of 16 journeys has mean 44.1 minutes. Assuming the standard deviation is unchanged, test at the 5% level whether the mean journey time has increased.
1
State hypotheses: H0:μ=42H₀colon μ = 42, H1:μ>42H₁colon μ > 42, where μμ is the mean journey time in minutes
2
Under H0H₀: Xˉ∼N(42,1662)X̄ ~ N(42, 6²/16), so the standard deviation of XˉX̄ is 46=1.56/4 = 1.5
Compare: 0.0808>0.050.0808 > 0.05, so the result is not significant: do not reject H0H₀
Answer
There is insufficient evidence at the 5% level that the mean journey time has increased.
⚠️ Watch out
using σ=6σ = 6 instead of 1666/(√16) gives z=0.35z = 0.35. The test is about the mean of 16 journeys, not one journey.
Calculate
?The volumes of drinks dispensed by a machine are normally distributed with standard deviation 12 ml. To test H0:μ=250H₀colon μ = 250 against H1:μ=250H₁colon μ ≠ 250 at the 5% level, a random sample of 36 drinks is used. Find the upper critical value for xˉx̄. Give your answer to 2 decimal places.
ml
Calculate
?Bags of compost are filled with masses that are normally distributed with standard deviation 0.5 kg. A supplier claims the mean is 20 kg. A random sample of 10 bags has mean 19.7 kg. Find the p-value for a test of H0:μ=20H₀colon μ = 20 against H1:μ<20H₁colon μ < 20. Give your answer to 3 significant figures.
Hypothesis testing · correlation and the normal mean
Testing for correlation (A-level only)
The product moment correlation coefficient (PMCC) rr measures how close points lie to a straight line: −1≤r≤1−1 ≤ r ≤ 1; r=±1r = ± 1 means all on a line.
rr is the sample value; ρρ the population value. Test H0:ρ=0H₀colon ρ = 0 against H1:ρ>0H₁colon ρ > 0, ρ<0ρ < 0 or ρ=0ρ ≠ 0.
Compare ∣r∣|r| with the tabled critical value for nn. Reject H0H₀ if ∣r∣≥|r| ≥ critical value (sign matching H1H₁), or if the p-value is at most the level.
The data are assumed to be from a bivariate normal distribution.
Worked exampleHypothesis testing · correlation and the normal mean
A 1-tail correlation test
Question
On 12 randomly chosen days, a garden records hours of sunshine and number of visitors. The PMCC is r=0.53r = 0.53. The critical value for n=12n = 12 at the 5% level (1-tail) is 0.4973. Test at the 5% level whether there is positive correlation.
1
State hypotheses: H0:ρ=0H₀colon ρ = 0, H1:ρ>0H₁colon ρ > 0, where ρρ is the population PMCC between sunshine and visitors
2
Compare: 0.53>0.49730.53 > 0.4973, so rr is in the critical region
3
Reject H0H₀
Answer
There is evidence at the 5% level of positive correlation between hours of sunshine and number of visitors.
⚠️ Watch out
correlation is not causation. The conclusion is about a linear relationship, not about sunshine causing visits.
Quick check
?For a sample of 20 pairs, r=−0.41r = −0.41. Tables give critical values for n=20n = 20 of 0.3783 (5% 1-tail, 10% 2-tail) and 0.4438 (2.5% 1-tail, 5% 2-tail). Test H0:ρ=0H₀colon ρ = 0 against H1:ρ=0H₁colon ρ ≠ 0 at the 5% level.
Sort it
?Which hypothesis test fits each question?
Tap a statement, then tap the group it belongs in. Then press Check.
Mission check
?Bag masses have standard deviation 8 g. A sample of 30 bags averages 497 g. Is the factory's 500 g mean suspicious at the 5% level?
Under H0:μ=500H₀colon μ = 500, Xˉ∼N(500,3082)X̄ ~ N(500, 8²/30), so the mean of 30 bags has standard deviation only 1.46 g. Then z=−2.05z = −2.05 and P(Xˉ≤497)=0.020<0.05P(X̄ ≤ 497) = 0.020 < 0.05: there is evidence at the 5% level that the mean is less than 500 g. (At the 1% level it would not be significant, since −2.05>−2.326−2.05 > −2.326.)
Recap
Big ideas
State H0H₀ and H1H₁ about the population parameter pp (defined in context); the test statistic X∼B(n,p)X ~ B(n, p) assumes H0H₀.
Reject H0H₀ if the p-value is at most the significance level, or if xx is in the critical region. For a 2-tail test, halve the level for each tail.
Conclude in context and without certainty: "there is evidence at the 5% level that …". The significance level is the probability of incorrectly rejecting H0H₀.
If X∼N(μ,σ2)X ~ N(μ, σ²) then Xˉ∼N(μ,nσ2)X̄ ~ N(μ, σ²/n); test a mean with Z=σ/nXˉ−μ0Z = (X̄ − μ₀)/(σ/√n).
Test correlation with H0:ρ=0H₀colon ρ = 0; compare ∣r∣|r| with the tabled critical value for nn (or use the p-value), choosing the 1-tail or 2-tail column.
Conclude in context, without certainty, and remember that correlation is not causation.
🏆
Mini-lesson complete!
⭐⭐⭐
You've worked through Hypothesis testing for OCR A-level Mathematics A (H240). 🎉
Mission 1A coin lands heads 15 times in 20 throws. Is it biased?
Mission 2Bags should average 500 g. Thirty bags average 497 g. Suspicious?