H₀: μ = μ₀ H₁: μ ≠ μ₀ t

Inference: Normal & t-distributions

Hypothesis tests and confidence intervals for population means — using z when σ² is known, using t when it is not.

🔬 Hypothesis Testing 📏 Confidence Intervals t Student's t-distribution 📊 Two-Sample Tests ★ Cambridge 9231 Lesson 4.2 of 5
4.2 Inference

Hypothesis Testing Framework

A hypothesis test uses sample data to assess a claim about a population parameter. Cambridge 9231 tests inference about population means. Every test follows the same six-step structure.

Six-Step Framework — Every Hypothesis Test
1Hypotheses
State H₀ (null hypothesis) and H₁ (alternative hypothesis) in terms of the population parameter.
H₀ always contains equality: H₀: μ = μ₀.
H₁ determines the tail: one-tailed (μ > μ₀ or μ < μ₀) or two-tailed (μ ≠ μ₀).
2Significance Level
State α — the probability of rejecting H₀ when it is true (Type I error rate).
Common values: α = 0.05 (5%) or α = 0.01 (1%). Cambridge states α in the question.
3Test Statistic
Calculate the test statistic from the sample data.
z = (x̄ − μ₀) / (σ/√n) when σ is known.
t = (x̄ − μ₀) / (s/√n) when σ is unknown (use sample sd s), with ν = n−1 degrees of freedom.
4Critical Value
Find the critical value from tables at significance level α.
For z-test: z_α (one-tail) or z_{α/2} (two-tail) from N(0,1) tables.
For t-test: t_{α, ν} from t-tables with ν = n−1 degrees of freedom.
Cambridge MF19 provides both tables.
5Decision Rule
Compare test statistic with critical value:
|test stat| < critical value → fail to reject H₀
|test stat| ≥ critical value → reject H₀
Alternatively, compare p-value with α: reject H₀ if p-value < α.
6Conclusion
Write a conclusion in context — do not just say "reject H₀."
Example: "There is sufficient evidence at the 5% level to conclude that the mean weight has increased."
⚠ Cambridge requires a contextualised conclusion — always reference the original scenario.

Type I and Type II Errors

H₀ is TRUE
H₀ is FALSE
Fail to reject H₀
Correct decisionProbability = 1 − α
Type II Error (β)Fail to detect a real effect. Probability = β.
Reject H₀
Type I Error (α)Reject H₀ when true. Probability = α (significance level).
Correct decisionPower = 1 − β.
💡 Power of a Test

The power of a test = P(reject H₀ | H₁ is true) = 1 − β. A more powerful test is better at detecting a real effect. Power increases with larger sample size, larger significance level, or larger true difference from H₀.

z-test — σ² Known

Use the z-test when the population variance σ² is known (stated in the question), regardless of sample size. The test statistic follows N(0,1) under H₀.

Test Statistic — z-test for population mean z = (x̄ − μ₀) / (σ / √n) where x̄ is the sample mean, μ₀ is the hypothesised mean, σ is the known population standard deviation, and n is the sample size. Under H₀, z ~ N(0,1).

Critical Values from N(0,1)

Alternative Hypothesis H₁ Tail Type Critical Region (α = 5%) Critical Region (α = 1%)
μ > μ₀ Right tail z > 1.645 z > 2.326
μ < μ₀ Left tail z < −1.645 z < −2.326
μ ≠ μ₀ Two tails |z| > 1.960 |z| > 2.576
⚠️ When σ is NOT given but n is Large

If n ≥ 30 and σ is unknown, you may use the sample standard deviation s as an approximation for σ and proceed with the z-test. Cambridge will either state σ directly, or tell you n is large enough. If neither is stated, use the t-test.

E
z-test — One-Tailed (Right)
A machine fills bags with a mean weight μ grams. It is known that the standard deviation is σ = 8 g. A random sample of 40 bags has mean weight 502.1 g. Test at the 5% level whether the population mean has increased above 500 g.
Step 1
H₀: μ = 500    H₁: μ > 500   (one-tailed, right)
Step 2
α = 0.05
Step 3
z = (502.1 − 500) / (8/√40) = 2.1 / 1.265 = 1.660
Step 4
Critical value: z₀.₀₅ = 1.645 (right-tail)
Step 5
1.660 > 1.645 → Reject H₀
Step 6
There is sufficient evidence at the 5% significance level to conclude that the mean weight of bags has increased above 500 g.

Student's t-distribution

When σ² is unknown, we estimate it from the sample using the unbiased sample variance s². The standardised sample mean then follows a t-distribution rather than N(0,1).

Unbiased sample variance s² = (1/(n−1)) Σ(xᵢ − x̄)² = (Σxᵢ² − nx̄²) / (n−1) Dividing by (n−1) rather than n gives an unbiased estimator of σ². This is the s² used in the t-test. Cambridge often gives Σx and Σx² — use the computational formula.
t-statistic t = (x̄ − μ₀) / (s / √n)   ~   t(n−1) Follows the t-distribution with ν = n−1 degrees of freedom. As ν → ∞, t(ν) → N(0,1).

Properties of the t-distribution

Symmetry
Symmetric about 0, like N(0,1). Heavier tails — more probability in the extremes.
Degrees of Freedom ν
ν = n−1 for a one-sample test. Larger ν → lighter tails → closer to N(0,1).
Critical Values
Always larger than the corresponding z critical value. Read from t-tables at ν = n−1 and significance level α.
⛔ Three Assumptions for the t-test
  • The population is normally distributed (or n is large enough by CLT).
  • The observations are independent — a simple random sample.
  • The population variance σ² is unknown — otherwise use z-test.

Reading the t-table (MF19)

Cambridge's MF19 gives critical values for the t-distribution. The table is organised by degrees of freedom ν and by the probability in one or both tails. Common critical values:

ν (d.f.)t at 5% (one-tail) / 10% (two-tail)t at 2.5% (one-tail) / 5% (two-tail)t at 1% (one-tail) / 2% (two-tail)t at 0.5% (one-tail) / 1% (two-tail)
52.0152.5713.3654.032
101.8122.2282.7643.169
151.7532.1312.6022.947
201.7252.0862.5282.845
301.6972.0422.4572.750
1.6451.9602.3262.576

One-Sample t-test

Use the t-test when testing a hypothesis about a population mean and the population variance is unknown. Estimate σ² from the sample using s².

t-test Procedure — σ² Unknown
H₀, H₁State
H₀: μ = μ₀   vs   H₁: μ > μ₀ (or < or ≠)
Calculate
s² = (Σx² − nx̄²) / (n−1)   or use given data.
Cambridge often provides Σx and Σx² — use these directly.
tTest stat
t = (x̄ − μ₀) / (s/√n)
νDegrees of freedom
ν = n − 1
CVCritical value
Read t_{α, n−1} or t_{α/2, n−1} from t-tables (MF19).
Conclusion
Compare |t| with critical value. Write conclusion in context.
E
One-Sample t-test — Two-Tailed
A sample of 12 measurements gives Σx = 84.6 and Σx² = 601.44. Test at the 5% level whether the population mean differs from 7.
H₀, H₁
H₀: μ = 7    H₁: μ ≠ 7   (two-tailed, α = 0.05)
x̄ and s²
x̄ = 84.6/12 = 7.05
s² = (601.44 − 12 × 7.05²) / 11 = (601.44 − 596.07) / 11 = 5.37/11 = 0.4882
s = 0.6987
Test stat
t = (7.05 − 7) / (0.6987/√12) = 0.05 / 0.2018 = 0.248
Critical value
ν = 11, two-tailed 5%: t_{0.025, 11} = 2.201
Decision
|0.248| < 2.201 → Fail to reject H₀
Conclusion
There is insufficient evidence at the 5% level to conclude that the population mean differs from 7.

Confidence Intervals

A confidence interval (CI) gives a range of plausible values for the population parameter μ based on the sample data. A 95% CI means: if the procedure were repeated many times, 95% of the intervals constructed would contain the true μ.

CI for μ — σ² known (z-interval) x̄ ± z_{α/2} · (σ/√n) Use z_{0.025} = 1.960 for 95% CI, z_{0.005} = 2.576 for 99% CI. σ must be the known population standard deviation.
CI for μ — σ² unknown (t-interval) x̄ ± t_{α/2, n−1} · (s/√n) Use s (sample sd) and t critical values with ν = n−1 degrees of freedom. This is wider than the z-interval — the t-distribution has heavier tails, reflecting uncertainty about σ.

Interpreting a Confidence Interval

⛔ The Most Common Misinterpretation

Wrong: "There is a 95% probability that μ lies in this interval."
Right: "We are 95% confident that this interval contains the true population mean μ." The interval is random (computed from data), not the parameter. Once computed, μ either is or is not in it — there is no probability about it.

Link Between CI and Hypothesis Test

📌 Duality

A two-tailed test at level α is equivalent to checking whether μ₀ lies inside the (1−α)×100% confidence interval. If μ₀ is inside the CI → fail to reject H₀. If μ₀ is outside the CI → reject H₀. Cambridge sometimes asks you to use a CI to draw a conclusion about a test.

E
Confidence Interval — σ² Unknown
From 15 observations: x̄ = 23.4, s = 3.2. Construct a 95% CI for the population mean μ.
Identify
n=15, x̄=23.4, s=3.2, σ unknown → use t-interval. ν=14, 95% CI → t_{0.025, 14} = 2.145
SE
s/√n = 3.2/√15 = 3.2/3.873 = 0.826
Interval
23.4 ± 2.145 × 0.826 = 23.4 ± 1.773
(21.6, 25.2)   [3 s.f.]
Interpret
We are 95% confident that the true population mean lies between 21.6 and 25.2.

Two-Sample Tests

When comparing the means of two independent populations, the test statistic depends on whether the variances are known, unknown but equal, or unknown and unequal.

Which Test to Use — Decision Guide

SituationVariancesTest StatisticDistribution
Two independent samples, σ₁², σ₂² known Known z = (x̄₁−x̄₂) / √(σ₁²/n₁ + σ₂²/n₂) N(0,1)
Two independent samples, σ₁² = σ₂² = σ² unknown Equal, unknown t = (x̄₁−x̄₂) / (sₚ√(1/n₁+1/n₂)) t(n₁+n₂−2)
Paired data (differences dᵢ = xᵢ−yᵢ) t = d̄ / (sᵈ/√n) t(n−1)

Pooled Variance — Equal Variances Case

Pooled sample variance sₚ² sₚ² = [(n₁−1)s₁² + (n₂−1)s₂²] / (n₁+n₂−2) A weighted average of the two sample variances, giving more weight to the larger sample. Use sₚ in the two-sample t-test test statistic.
📌 Paired vs Two-Sample
  • Paired data: Each observation in sample 1 is matched with a specific observation in sample 2 (e.g. before/after measurements on the same subject). Compute dᵢ = xᵢ − yᵢ and apply a one-sample t-test on the differences.
  • Two independent samples: No natural pairing between observations. Use the two-sample t-test with pooled variance (if equal variances assumed).
  • Cambridge will specify which applies — look for keywords: "matched pairs", "same subject", "before and after" → paired. "Two groups", "randomly selected from two populations" → two-sample.
E
Two-Sample t-test — Equal Variances
Sample A: n₁=10, x̄₁=45.2, s₁=3.1. Sample B: n₂=12, x̄₂=43.0, s₂=2.8. Assuming equal population variances, test at 5% whether μ₁ > μ₂.
H₀, H₁
H₀: μ₁ = μ₂    H₁: μ₁ > μ₂   (one-tailed, α = 0.05)
sₚ²
sₚ² = (9×3.1² + 11×2.8²) / 20 = (86.49 + 86.24) / 20 = 8.637   sₚ = 2.939
t statistic
t = (45.2 − 43.0) / (2.939 × √(1/10 + 1/12)) = 2.2 / (2.939 × 0.4282) = 2.2 / 1.259 = 1.748
Critical value
ν = 20, one-tailed 5%: t_{0.05, 20} = 1.725
Decision
1.748 > 1.725 → Reject H₀
Conclusion
There is sufficient evidence at the 5% level that the mean of population A exceeds the mean of population B.
E
Paired t-test
Six patients' blood pressure (mmHg) before and after treatment:
Before: 148, 152, 145, 160, 155, 143
After: 142, 148, 140, 152, 151, 138
Test at 1% whether the treatment reduces blood pressure.
Differences d
d = Before − After: 6, 4, 5, 8, 4, 5
d̄ = 32/6 = 5.333
sᵈ
Σd² = 36+16+25+64+16+25 = 182
sᵈ² = (182 − 6×5.333²)/5 = (182−170.667)/5 = 2.267   sᵈ = 1.506
H₀, H₁
H₀: μᵈ = 0    H₁: μᵈ > 0   (treatment reduces BP → differences positive)
t statistic
t = 5.333 / (1.506/√6) = 5.333 / 0.615 = 8.67
Critical value
ν=5, one-tailed 1%: t_{0.01, 5} = 3.365
Conclusion
8.67 ≫ 3.365 → Strong evidence at 1% level that treatment significantly reduces blood pressure.

Worked Examples

1
CI Used to Conduct a Hypothesis Test
A sample of 20 gave x̄ = 15.8 and s² = 6.25. Construct a 95% CI for μ and hence test H₀: μ = 14 vs H₁: μ ≠ 14 at 5%.
95% CI
ν=19, t_{0.025,19} = 2.093, s = 2.5, SE = 2.5/√20 = 0.559
CI: 15.8 ± 2.093×0.559 = 15.8 ± 1.170
(14.63, 16.97)
Conclusion
μ₀ = 14 lies outside the CI (14 < 14.63) → Reject H₀ at 5%.
Sufficient evidence that μ ≠ 14.
2
Choosing Between z and t
For each scenario, state whether to use a z-test or t-test and why:
(a) n=8, σ known, population normal.   (b) n=8, σ unknown, population normal.
(c) n=60, σ unknown.   (d) n=8, σ unknown, population unknown shape.
(a)
z-test — σ known. Use z = (x̄−μ₀)/(σ/√n) ~ N(0,1).
(b)
t-test — σ unknown, population normal. t = (x̄−μ₀)/(s/√n) ~ t(7).
(c)
z-test (approx) — n large, CLT applies, use s as estimate of σ, z approximately valid.
(d)
Cannot use t-test reliably — small n and unknown population shape. t-test requires normality assumption. Should comment on this limitation.

Practice Questions

Question 1 — One-Sample z-test
[6 marks]
The lengths of bolts produced by a machine are normally distributed with standard deviation 0.4 mm. A sample of 25 bolts has mean length 10.18 mm. The machine is set to produce bolts of mean length 10 mm. Test at the 1% level whether the machine is producing bolts that are too long.
One-tailed (right) z-test. Critical value: z_{0.01} = 2.326. Calculate z = (10.18−10)/(0.4/√25).
✓ Solution
H₀: μ=10, H₁: μ>10 (one-tailed), α=0.01
z = (10.18−10)/(0.4/√25) = 0.18/0.08 = 2.25
Critical value: z_{0.01} = 2.326
2.25 < 2.326 → Fail to reject H₀
Insufficient evidence at 1% level that bolts are too long. (Note: significant at 5% since z>1.645.)
Question 2 — One-Sample t-test
[7 marks]
A sample of 10 observations gives Σx = 43.2 and Σx² = 190.44. Assuming normality, test at 5% whether the population mean differs from 4.5.
x̄ = 43.2/10 = 4.32. s² = (190.44−10×4.32²)/9. Two-tailed t-test, ν=9, critical value = 2.262.
✓ Solution
x̄ = 43.2/10 = 4.32
s² = (190.44 − 10×18.6624)/9 = (190.44−186.624)/9 = 3.816/9 = 0.424
s = 0.651

H₀: μ=4.5, H₁: μ≠4.5, α=0.05
t = (4.32−4.5)/(0.651/√10) = −0.18/0.206 = −0.874
ν=9, two-tailed 5%: t_{0.025,9} = 2.262
|−0.874| < 2.262 → Fail to reject H₀
No significant evidence at 5% that the population mean differs from 4.5.
Question 3 — Confidence Interval
[5 marks]
A random sample of 8 observations from a normal population gives x̄ = 34.5 and s = 4.2.
(i) Construct a 99% confidence interval for the population mean.
(ii) Comment on whether μ = 30 is consistent with the data.
ν=7, 99% CI uses t_{0.005,7} = 3.499.
✓ Solution
(i) SE = 4.2/√8 = 1.485. t_{0.005,7} = 3.499
CI: 34.5 ± 3.499×1.485 = 34.5 ± 5.196
(29.3, 39.7)

(ii) μ=30 lies inside the CI (29.3 < 30 < 39.7). Therefore μ=30 is consistent with the data at the 1% significance level (two-tailed). We cannot reject H₀: μ=30 at this level.
Question 4 — Paired t-test
[7 marks]
A new fertiliser is tested on 7 plots of land. Yields (kg) before and after application:
Before: 42, 38, 45, 50, 37, 44, 41
After:   45, 40, 49, 54, 38, 46, 45
Test at 5% whether the fertiliser increases yield.
Compute differences d = After − Before. d̄ = Σd/7. Then compute sᵈ² and apply t-test on differences.
✓ Solution
d = After−Before: 3, 2, 4, 4, 1, 2, 4. Σd=20, d̄=20/7=2.857
Σd²=9+4+16+16+1+4+16=66
sᵈ²=(66−7×2.857²)/6=(66−57.143)/6=8.857/6=1.476, sᵈ=1.215

H₀: μᵈ=0, H₁: μᵈ>0 (fertiliser increases yield), α=0.05
t = 2.857/(1.215/√7) = 2.857/0.459 = 6.22
ν=6, one-tailed 5%: t_{0.05,6} = 1.943
6.22 > 1.943 → Reject H₀
Strong evidence at 5% level that the fertiliser significantly increases yield.

Interactive Hypothesis Test Calculator

Enter your sample data and test parameters. The tool computes the test statistic, critical value, and decision — with full working shown.

Statistical Test Calculator
Enter values above and click Run Test.

Formula Sheet — Inference

One-Sample Tests
z-test (σ known)z=(x̄−μ₀)/(σ/√n)
t-test (σ unknown)t=(x̄−μ₀)/(s/√n)
Degrees of freedomν = n−1
(Σx²−nx̄²)/(n−1)
Confidence Intervals
CI (σ known)x̄ ± z_{α/2}·σ/√n
CI (σ unknown)x̄ ± t_{α/2,n−1}·s/√n
95% z critical1.960
99% z critical2.576
Two-Sample Tests
z-test (known σ)(x̄₁−x̄₂)/√(σ₁²/n₁+σ₂²/n₂)
Pooled sₚ²[(n₁−1)s₁²+(n₂−1)s₂²]/(n₁+n₂−2)
t-test (equal σ)(x̄₁−x̄₂)/(sₚ√(1/n₁+1/n₂))
ν (two-sample)n₁+n₂−2
Paired t-test
Differencesdᵢ = x₁ᵢ − x₂ᵢ
d̄ = Σd/nsᵈ² = (Σd²−nd̄²)/(n−1)
t statisticd̄/(sᵈ/√n)
νn−1
Critical Values (z)
One-tail 5%1.645
Two-tail 5%1.960
One-tail 1%2.326
Two-tail 1%2.576
Error Types
Type I errorReject H₀ when true, P = α
Type II errorAccept H₀ when false, P = β
Power1 − β
Reduce both errorsIncrease sample size n
📋 Cambridge Exam Strategy — Inference
  • Always state H₀ and H₁ explicitly using μ notation (not words). Cambridge awards B1 for this even if the rest is wrong.
  • z vs t decision: σ known → z. σ unknown + normality → t. Large n + σ unknown → z approximately. Small n + σ unknown + non-normal → state limitation.
  • s² calculation: Use (Σx² − nx̄²)/(n−1) from given Σx and Σx². Never use n in the denominator — that gives biased variance.
  • Degrees of freedom: One-sample: ν=n−1. Two-sample (pooled): ν=n₁+n₂−2. Paired: ν=n−1 (number of pairs minus 1).
  • Conclusion wording: Say "sufficient/insufficient evidence at the X% level to conclude that [context statement]." Never just say "reject H₀" — always interpret in context.
  • CI and test duality: If asked to test using a CI, check whether μ₀ lies inside or outside. State this explicitly as your decision criterion.
← Lesson 4.1: Continuous Random Variables 9231 P4 · Lesson 4.2 of 5