Teachers' Portal  /  A-Level Further Maths 9231  /  Inference using normal and t-distributions  /  Two-sample t-tests and normal tests
Lesson pack · A-Level Further Maths 9231 · 4.2 · AS & A Level

Two-sample t-tests and normal tests

Two samples, one difference to test. Is the new fertiliser better than the old one?

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Inference using normal and t-distributions
Syllabus reference
Cambridge International AS and A Level Further Mathematics 9231, 4.2
Level
AS & A Level
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 2 of 3 in Inference using normal and t-distributions; follows The t-distribution: one-sample tests and intervals; leads into Paired samples and intervals for a difference
Central model
Fig. 1: choosing a test for a difference of two population means from two independent samples. Known variances with small samples need normal populations; large samples do not, thanks to the Central Limit Theorem
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • Pooling two samples into one variance: If two populations share the same variance \(\sigma^{2}\), each sample gives an estimate of it, and the best single estimate combines both.
  • The 2-sample t-test: When both samples are small and the population variances are unknown, use the \(t\)-distribution.
  • Large samples: the normal test: If the population variances are known, \(\bar X - \bar Y \sim \mathrm{N}\!\left(\mu_x - \mu_y,\ \frac{\sigma_x^{2}}{n_x} + \frac{\sigma_y^{2}}{n_y}\right)\) exactly for normal populations.
Key points to leave on the board
  • Choose: variances known or samples large: normal test; small samples, unknown variances: 2-sample \(t\)-test.
  • Hypotheses: \(\mathrm{H}_0: \mu_x - \mu_y = k\) with \(\mu_x\), \(\mu_y\) defined in context; one or two tails from the wording.
  • Pool for \(t\) only: \(s_p^{2} = \dfrac{(n_x - 1)s_x^{2} + (n_y - 1)s_y^{2}}{n_x + n_y - 2}\).
  • Statistic: subtract \(k\), divide by the standard error; \(t\) has \(n_x + n_y - 2\) degrees of freedom.
  • Conclude in context, without certainty: 'there is (in)sufficient evidence at the ...% level that ...'.
  • Assumptions for \(t\): independent random samples, normal populations, common variance.
The core visual model

One picture every idea returns to

Two independent samples, sizes \(n_x\) and \(n_y\). Small samples, both populations normal with a common variance: pool the variance, \(s_p^{2} = \dfrac{\sum (x - \bar x)^{2} + \sum (y - \bar y)^{2}}{n_x + n_y - 2}\), and use \(t = \dfrac{\bar x - \bar y - k}{\sqrt{s_p^{2}\left(\frac{1}{n_x} + \frac{1}{n_y}\right)}}\) with \(n_x + n_y - 2\) degrees of freedom. Large samples (or known variances): use \(z = \dfrac{\bar x - \bar y - k}{\sqrt{\frac{\sigma_x^{2}}{n_x} + \frac{\sigma_y^{2}}{n_y}}}\) with the normal distribution, replacing \(\sigma^{2}\) by \(s^{2}\) when it is unknown. Here \(k\) is the difference \(\mu_x - \mu_y\) stated in \(\mathrm{H}_0\), usually 0.

Test H₀: μx − μy = k Population variances known? yes no Both samples large? yes no Normal test (z) σx²/nx + σy²/ny normal populations Normal test (z) sx²/nx + sy²/ny Central Limit Theorem 2-sample t-test pooled sp², nx + ny − 2 df normal, common variance
Fig. 1: choosing a test for a difference of two population means from two independent samples. Known variances with small samples need normal populations; large samples do not, thanks to the Central Limit Theorem
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, Two samples, one difference to test.. Is the new fertiliser better than the old one? Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: Pooling two samples into one varianceIf two populations share the same variance \(\sigma^{2}\), each sample gives an estimate of it, and the best single estimate combines both. Project tab 1 of the lab (Distributions lab, t versus normal) and let a student drive it while the class predicts. Model the worked example From raw data on the board, one line at a time. Your turn: A sample of 9 has unbiased variance estimate \(s_x^{2} = 3.2\) and an independent sample of 7 has \(s_y^{2} = 4.5\). Find the pooled estimate of the common variance.Whole class, then pairs
13 to 21 minTeach and check: The 2-sample t-testWhen both samples are small and the population variances are unknown, use the \(t\)-distribution. Model the worked example One-tailed test, not significant on the board, one line at a time.Pairs
21 to 30 minTeach and check: Large samples: the normal testIf the population variances are known, \(\bar X - \bar Y \sim \mathrm{N}\!\left(\mu_x - \mu_y,\ \frac{\sigma_x^{2}}{n_x} + \frac{\sigma_y^{2}}{n_y}\right)\) exactly for normal populations. Model the worked example Large samples, two-tailed on the board, one line at a time. Your turn: Samples of 40 and 50 give \(\bar x - \bar y = 5.8\), \(s_x^{2} = 12\), \(s_y^{2} = 15\). Find the test statistic for \(\mathrm{H}_0: \mu_x - \mu_y = 4\) and state the conclusion against \(\mathrm{H}_1: \mu_x - \mu_y > 4\) at the 1% level.Connect-Extend-Challenge
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 28 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in Large samples: the normal test, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Connect-Extend-Challenge

After the new idea, each student writes three lines: how it connects to what they knew, how it extends their thinking, and what still challenges them. Pairs compare, then the challenges become the plenary.

The full structure, with its PIES check and a worked example for every subject, is on the cooperative-learning page, one of fifteen structures there.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
Do not average the two variances, and do not divide by \(n_x + n_y\) or \(n_x + n_y - 1\).Weight each \(s^{2}\) by its own \(n - 1\), and divide by \(n_x + n_y - 2\). If you are given standard deviations, square them first.
Subtract \(k\) in the numerator: testing 'more than 2 minutes' with \(\bar x - \bar y = 3.4\) on top would wildly overstate the evidence.And the degrees of freedom are \(n_x + n_y - 2\), not \(n_x + n_y - 1\) or \(n - 1\) for one sample.
A normal test with \(s^{2}\) in place of \(\sigma^{2}\) needs LARGE samples.With samples of 6 and 8 and unknown variances you must use the 2-sample \(t\)-test, and then you must state the normal and common-variance assumptions.
Worksheet

Two-sample t-tests and normal tests: worksheet

6 questions, 28 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · recall[2 marks]

A sample of 7 has standard deviation \(s_x = 2.4\) and an independent sample of 9 has \(s_y = 3.1\), both calculated with divisor \(n - 1\). Assuming a common population variance, find its pooled estimate.

Q2 · calculation[3 marks]

Sample \(X\): \(n_x = 8\), \(\sum x = 96\), \(\sum x^{2} = 1188\). Sample \(Y\): \(n_y = 6\), \(\sum y = 60\), \(\sum y^{2} = 630\). Find the pooled estimate of the common population variance.

Q3 · analysis[7 marks]

The lifetimes, in hours, of batteries of brand \(A\) and brand \(B\) are recorded.

Brand \(A\): 8.2, 7.9, 8.6, 8.4, 8.9    Brand \(B\): 7.6, 8.0, 7.4, 7.9, 7.7, 7.8

(a) State two assumptions needed for a 2-sample \(t\)-test.

(b) Test at the 5% level whether brand \(A\) batteries have a greater mean lifetime than brand \(B\).

Q4 · calculation[5 marks]

The daily commuting times, in minutes, of 70 workers in city \(P\) and 80 workers in city \(Q\) give \(\bar x_P = 41.7\), \(s_P^{2} = 18.4\), \(\bar x_Q = 39.9\), \(s_Q^{2} = 22.5\).

(a) Test at the 1% level whether the population mean commuting times differ.

(b) Explain why the test is valid even though the distribution of commuting times is unknown.

Q5 · analysis[5 marks]

Masses of bags filled by machine \(A\) are normal with standard deviation 0.8 g, and by machine \(B\) normal with standard deviation 1.2 g. A sample of 10 bags from \(A\) has mean 25.9 g and a sample of 12 bags from \(B\) has mean 23.6 g. Test at the 5% level whether the mean mass from \(A\) exceeds the mean mass from \(B\) by more than 1.5 g.

Q6 · analysis[6 marks]

A researcher compares reaction times, in hundredths of a second, of two independent groups. Group \(X\): \(n_x = 5\), \(\bar x = 31.2\), \(s_x^{2} = 4.3\). Group \(Y\): \(n_y = 6\), \(\bar y = 28.9\), \(s_y^{2} = 3.6\).

(a) Explain why a normal test is not appropriate, and state the test that should be used with its assumptions.

(b) Carry out the test at the 10% level to decide whether the population means differ.

Answer key and marking notes
Q1 · 2 marks
  • Square the standard deviations: \(s_x^{2} = 5.76\), \(s_y^{2} = 9.61\).
  • \[s_p^{2} = \frac{6(5.76) + 8(9.61)}{7 + 9 - 2} = \frac{34.56 + 76.88}{14} = \frac{111.44}{14} = 7.96\]
Q2 · 3 marks
  • \(S_{xx} = 1188 - \dfrac{96^{2}}{8} = 1188 - 1152 = 36\).
  • \(S_{yy} = 630 - \dfrac{60^{2}}{6} = 630 - 600 = 30\).
  • \(s_p^{2} = \dfrac{36 + 30}{8 + 6 - 2} = \dfrac{66}{12} = 5.5\).
Q3 · 7 marks
  • (a) Both lifetimes are normally distributed; the two populations have a common variance (and the samples are independent and random).
  • (b) \(\mathrm{H}_0: \mu_A = \mu_B\), \(\mathrm{H}_1: \mu_A > \mu_B\), where \(\mu_A\), \(\mu_B\) are the population mean lifetimes.
  • \(\bar x_A = 8.4\), \(\sum (x - \bar x)^{2} = 0.58\); \(\bar x_B = 7.7333\), \(\sum (x - \bar x)^{2} = 0.23333\).
  • \[s_p^{2} = \frac{0.58 + 0.23333}{5 + 6 - 2} = \frac{0.81333}{9} = 0.09037\]
  • \[t = \frac{8.4 - 7.7333}{\sqrt{0.09037\left(\frac{1}{5} + \frac{1}{6}\right)}} = \frac{0.6667}{0.1820} = 3.66\]
  • \(\nu = 9\); one-tailed 5% critical value \(t_{9} = 1.833\). \(3.66 > 1.833\), so reject \(\mathrm{H}_0\).
  • There is sufficient evidence at the 5% level that brand \(A\) batteries have a greater mean lifetime.
Q4 · 5 marks
  • (a) \(\mathrm{H}_0: \mu_P = \mu_Q\), \(\mathrm{H}_1: \mu_P \ne \mu_Q\), where \(\mu_P\), \(\mu_Q\) are the population mean commuting times.
  • \[z = \frac{41.7 - 39.9}{\sqrt{\frac{18.4}{70} + \frac{22.5}{80}}} = \frac{1.8}{\sqrt{0.5441}} = 2.44\]
  • Two-tailed 1% critical values \(\pm 2.576\). \(2.44 < 2.576\), so do not reject \(\mathrm{H}_0\).
  • There is insufficient evidence at the 1% level that the mean commuting times differ.
  • (b) The samples are large, so by the Central Limit Theorem \(\bar X_P - \bar X_Q\) is approximately normal, and \(s^{2}\) is a good estimate of \(\sigma^{2}\).
Q5 · 5 marks
  • \(\mathrm{H}_0: \mu_A - \mu_B = 1.5\), \(\mathrm{H}_1: \mu_A - \mu_B > 1.5\), where \(\mu_A\), \(\mu_B\) are the population mean masses.
  • The variances are known and the populations are normal, so a normal test applies.
  • \[z = \frac{(25.9 - 23.6) - 1.5}{\sqrt{\frac{0.64}{10} + \frac{1.44}{12}}} = \frac{0.8}{\sqrt{0.184}} = 1.865\]
  • One-tailed 5% critical value 1.645. \(1.865 > 1.645\), so reject \(\mathrm{H}_0\).
  • There is sufficient evidence at the 5% level that the mean mass from \(A\) exceeds that from \(B\) by more than 1.5 g.
Q6 · 6 marks
  • (a) The population variances are unknown and the samples are small, so \(s^{2}\) cannot replace \(\sigma^{2}\) in a normal test. Use a 2-sample \(t\)-test, assuming both populations are normal with a common variance.
  • (b) \(\mathrm{H}_0: \mu_x = \mu_y\), \(\mathrm{H}_1: \mu_x \ne \mu_y\), where \(\mu_x\), \(\mu_y\) are the population mean reaction times.
  • \[s_p^{2} = \frac{4(4.3) + 5(3.6)}{9} = \frac{35.2}{9} = 3.911\]
  • \[t = \frac{31.2 - 28.9}{\sqrt{3.911\left(\frac{1}{5} + \frac{1}{6}\right)}} = \frac{2.3}{\sqrt{1.4341}} = 1.921\]
  • \(\nu = 9\); two-tailed 10% critical values \(\pm 1.833\). \(1.921 > 1.833\), so reject \(\mathrm{H}_0\).
  • There is sufficient evidence at the 10% level that the population mean reaction times differ.
Quiz

8 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

Independent samples of sizes 6 and 10 have unbiased variance estimates \(s_x^{2} = 5.0\) and \(s_y^{2} = 3.2\). Find the pooled estimate of the common population variance.

  • A\(4.10\)
  • B\(3.88\)
  • C\(3.36\)
  • D\(3.84\)
Q21 mark

A 2-sample t-test with \(\mathrm{H}_1: \mu_x > \mu_y\) uses independent samples of sizes 7 and 5 and the 1% significance level. What is the critical value?

  • A\(2.718\)
  • B\(3.169\)
  • C\(2.764\)
  • D\(2.681\)
Q31 mark

Independent random samples of 60 and 75 are taken from two populations whose distributions and variances are unknown. Which test is appropriate for the difference of the population means?

  • AA 2-sample t-test with a pooled variance
  • BA paired sample t-test on the differences
  • CA z-test with \(\dfrac{s_x^{2}}{n_x} + \dfrac{s_y^{2}}{n_y}\) as the variance
  • DA z-test, valid only if both populations are normal
Q41 mark

Large independent samples give \(n_x = 50\), \(\bar{x} = 41.6\), \(s_x^{2} = 18\) and \(n_y = 40\), \(\bar{y} = 39.8\), \(s_y^{2} = 24\). Find the test statistic for \(\mathrm{H}_0: \mu_x = \mu_y\).

  • A\(z = 1.84\)
  • B\(z = 1.31\)
  • C\(z = 0.278\)
  • D\(z = 1.88\)
Q51 mark

Plants on a new feed (\(X\)) and on the standard feed (\(Y\)) give heights \(x\) cm and \(y\) cm: \(n_x = 8\), \(\sum x = 124.0\), \(\sum x^{2} = 1937.5\); \(n_y = 10\), \(\sum y = 141.0\), \(\sum y^{2} = 2010.9\). Assuming normal populations with a common variance, test at the 5% level whether the new feed gives a greater mean height. Which is correct?

  • A\(t = 1.91 > 1.746\): reject \(\mathrm{H}_0\); evidence that the new feed gives a greater mean height
  • B\(t = 1.91 > 1.746\): reject \(\mathrm{H}_0\); evidence that the mean heights differ
  • C\(t = 0.67 < 1.746\): do not reject \(\mathrm{H}_0\); insufficient evidence that the new feed gives a greater mean
  • D\(t = 1.91 < 2.120\): do not reject \(\mathrm{H}_0\); insufficient evidence that the new feed gives a greater mean
Q61 mark

Masses from machine \(P\) are normal with standard deviation 3.0 g and from machine \(Q\) normal with standard deviation 4.0 g. Samples of 10 from \(P\) and 12 from \(Q\) give means 27.9 g and 22.4 g. Test at the 1% level whether \(\mu_P - \mu_Q > 2\). Which is correct?

  • A\(z = 2.34 > 2.326\): reject \(\mathrm{H}_0\); evidence that the mean difference exceeds 2 g
  • B\(z = 2.34 < 2.576\): do not reject \(\mathrm{H}_0\); insufficient evidence that the difference exceeds 2 g
  • C\(t = 2.34 < 2.528\): do not reject \(\mathrm{H}_0\); insufficient evidence that the difference exceeds 2 g
  • D\(z = 1.66 < 2.326\): do not reject \(\mathrm{H}_0\); insufficient evidence that the difference exceeds 2 g
Q71 mark

Independent samples of 6 from each of two normal populations with a common variance give a pooled estimate \(s_p^{2} = 4\). For \(\mathrm{H}_0: \mu_x = \mu_y\) against \(\mathrm{H}_1: \mu_x > \mu_y\) at the 5% level, find the least value of \(\bar{x} - \bar{y}\) that leads to rejecting \(\mathrm{H}_0\).

  • A\(2.57\)
  • B\(1.90\)
  • C\(2.09\)
  • D\(2.06\)
Q81 mark

Two independent samples from normal populations with a common variance: \(X\): 41, 45, 39, 44, 43, 46; \(Y\): 38, 40, 42, 37, 39. Test at the 1% level whether the population means differ. Which is correct?

  • A\(t = 2.70 > 2.262\): reject \(\mathrm{H}_0\); evidence that the means differ
  • B\(t = 2.70 > 2.576\): reject \(\mathrm{H}_0\); evidence that the means differ
  • C\(t = 2.70 < 3.250\): do not reject \(\mathrm{H}_0\); insufficient evidence that the means differ
  • D\(t = 2.78 > 2.576\): reject \(\mathrm{H}_0\); evidence that the means differ
Quiz key
Q1: D

\(s_p^{2} = \dfrac{5(5.0) + 9(3.2)}{6 + 10 - 2} = \dfrac{25 + 28.8}{14} = 3.84\). \(4.10\) is the plain average of the two estimates, ignoring the sample sizes. \(3.36\) has the right numerator but divides by \(n_x + n_y = 16\). \(3.88\) weights by \(n\) instead of \(n - 1\): \(\dfrac{6(5.0) + 10(3.2)}{16}\).

Q2: C

\(\nu = 7 + 5 - 2 = 10\) and the one-tailed 1% value is \(t_{10} = 2.764\). \(2.681\) uses \(\nu = 12\), not subtracting 2. \(2.718\) uses \(\nu = 11\), subtracting only 1. \(3.169\) is the two-tailed 1% value for \(\nu = 10\).

Q3: C

Both samples are large, so by the central limit theorem \(\bar{X} - \bar{Y}\) is approximately normal, with variance estimated by \(\dfrac{s_x^{2}}{n_x} + \dfrac{s_y^{2}}{n_y}\): a z-test. The pooled t-test needs normal populations with a common variance, neither of which is given. A paired test needs matched data, but these samples are independent and of different sizes. Normal populations are not required here because the samples are large.

Q4: A

\(\dfrac{18}{50} + \dfrac{24}{40} = 0.36 + 0.60 = 0.96\), so \(z = \dfrac{1.8}{\sqrt{0.96}} = 1.84\). \(1.88\) forgets the square root, dividing by 0.96. \(1.31\) adds the two standard errors \(0.600 + 0.775\) instead of adding variances. \(0.278\) divides by \(\sqrt{18 + 24}\), leaving out the sample sizes.

Q5: A

\(\bar{x} = 15.5\), \(\bar{y} = 14.1\). \(\sum (x - \bar{x})^{2} = 1937.5 - 124^{2}/8 = 15.5\) and \(\sum (y - \bar{y})^{2} = 2010.9 - 141^{2}/10 = 22.8\), so \(s_p^{2} = \dfrac{38.3}{16} = 2.394\). \(t = \dfrac{1.4}{\sqrt{2.394(1/8 + 1/10)}} = 1.91\). One-tailed 5% with \(\nu = 16\): 1.746, so reject \(\mathrm{H}_0\). The second option uses the two-tailed value 2.120. The third treats 15.5 and 22.8 as variance estimates and weights them by \(n - 1\) again. The fourth reaches the right decision but states a two-tailed conclusion for a one-tailed test.

Q6: A

\(\mathrm{H}_0: \mu_P - \mu_Q = 2\), \(\mathrm{H}_1: \mu_P - \mu_Q > 2\). Standard error \(\sqrt{\dfrac{9}{10} + \dfrac{16}{12}} = 1.494\), so \(z = \dfrac{5.5 - 2}{1.494} = 2.34\). The 1% one-tailed value is 2.326, and \(2.34 > 2.326\): reject \(\mathrm{H}_0\) (just). The second option uses the two-tailed 1% value 2.576. The third adds the standard errors \(3/\sqrt{10} + 4/\sqrt{12}\) instead of the variances. The fourth uses \(t_{20}\), but with known variances the test is a z-test.

Q7: C

Standard error \(\sqrt{4(1/6 + 1/6)} = 1.155\). With \(t_{10} = 1.812\): \(\bar{x} - \bar{y} = 1.812 \times 1.155 = 2.09\). \(1.90\) uses the normal value 1.645. \(2.57\) uses the two-tailed value 2.228. \(2.06\) uses \(\nu = 12\) (\(t = 1.782\)), forgetting to subtract 2.

Q8: C

\(\bar{x} = 43\), \(\bar{y} = 39.2\); \(\sum (x - \bar{x})^{2} = 34\), \(\sum (y - \bar{y})^{2} = 14.8\), so \(s_p^{2} = \dfrac{48.8}{9} = 5.422\). \(t = \dfrac{3.8}{\sqrt{5.422(1/6 + 1/5)}} = 2.70\). Two-tailed 1% with \(\nu = 9\): 3.250, so do not reject \(\mathrm{H}_0\). The second option compares with the normal value 2.576, wrong for small samples. The third uses the 5% value 2.262. The fourth uses the unpooled large-sample statistic and the normal value.

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonThe t-distribution: one-sample tests and intervals