The t-test
The two-sample t-test compares the means of two populations using a sample from each. Is a new fertiliser better? Are reaction times different after coffee? You write the hypotheses, choose one or two tails, let the GDC find the p-value, and interpret it.
1What you need to know
Tick these off as you go. By the end of the page you should be able to do all of them without notes.
- Write and for a comparison of two means, in symbols and wordsSL 4.11
- Decide between a one-tailed and a two-tailed testSL 4.11
- Carry out a pooled two-sample t-test on the GDCSL 4.11
- Compare the p-value with the significance level and write a conclusion in contextSL 4.11
- State the assumption that both populations are normally distributedSL 4.11
2Notes & worked examples
Each idea is followed by a worked example. Try the question yourself first, then reveal the solution one step at a time.
Two samples will almost never have exactly the same mean, even if the populations do. The t-test asks whether the difference you see is bigger than chance alone would usually produce, taking into account how spread out the data is and how big the samples are. A small p-value means the difference is unlikely to be just chance.
2.1 Hypotheses and tails
| Question | Test | ||
|---|---|---|---|
| Are the means different? | two-tailed | ||
| Is mean 1 greater? | one-tailed | ||
| Is mean 1 less? | one-tailed |
Define what and stand for, in context. always says the means are equal.
The two samples are independent (unpaired). Both populations are normally distributed, with equal (unknown) variances, so use the pooled test. The GDC does all the calculation.
2.2 The test on the GDC
Enter each sample in its own list. menu → Statistics → Stat Tests → 2-Sample t Test, choose Data (or Stats if you are given the means, standard deviations and sizes). Choose List 1 and List 2, the alternative hypothesis (, or ), and Pooled: Yes. The output gives , the p-value (PVal), the degrees of freedom and the sample means and standard deviations.
3Explore it
Two samples of size n are drawn from populations with the difference in means and the spread you choose. See how the p-value falls as the difference grows, the spread shrinks or the samples get bigger.
4Common mistakes & exam tips
Common mistakes
- Writing as . always says the means are equal.
- Using a two-tailed test when the question asks whether one mean is greater (or less).
- Setting Pooled to No. At AI SL, use the pooled test.
- Putting the samples in the opposite lists to your , so the one-tailed p-value is wrong.
- Concluding that is true when you do not reject it.
Exam tips
- Define and in words before writing the hypotheses.
- "Different" means two-tailed; "greater", "higher", "less" or "improved" means one-tailed.
- If asked for an assumption, say that both populations are normally distributed.
- Conclusions should be cautious: "there is evidence that…" or "there is insufficient evidence that…".
5Practice
Fluency questions build the basics. Problem-solving questions make you think about which method to use.
6Exam-style questions
Original questions in the style of the IB Maths AI SL exam, with full markschemes. Your GDC is allowed throughout: use it, but write down what you entered and what it gave you. Give yourself about 1 minute per mark.
A gardener measures the heights (cm) of plants grown with a new fertiliser: 24.1, 26.3, 25.8, 27.0, 24.9, 26.1, 25.5; and without it: 23.8, 24.5, 25.1, 23.2, 24.9, 24.0. A t-test is used to test whether the fertiliser increases the mean height, at the 1% significance level.
- (a)Write down the null and alternative hypotheses.[2]
- (b)Find the p-value.[2]
- (c)State the conclusion of the test, giving a reason.[2]
- (d)State one assumption made about the heights.[1]
| (a) | |
| : | A1 |
| : | A1 |
| (b) | |
| one-tailed pooled 2-sample t-test | (M1) |
| 0.00614 | A1 |
| (c) | |
| R1 | |
| reject : there is evidence that the fertiliser increases the mean height | A1 |
| (d) | |
| heights are normally distributed (in both groups) | A1 |
Two independent groups were timed in a reaction test. Before coffee (s): 0.32, 0.29, 0.35, 0.31, 0.30, 0.33, 0.36, 0.28. After coffee (s): 0.34, 0.31, 0.37, 0.33, 0.35, 0.30, 0.36, 0.38. A test at the 5% level is used to decide whether the mean reaction times differ.
- (a)State whether the test should be one-tailed or two-tailed. Justify your answer.[1]
- (b)Find the p-value.[2]
- (c)State the conclusion in context.[2]
- (d)The test is repeated at the 10% level. State the new conclusion.[1]
| (a) | |
| two-tailed: the question asks whether the means differ, not which is larger | R1 |
| (b) | |
| pooled two-sample t-test | (M1) |
| 0.0975 | A1 |
| (c) | |
| R1 | |
| do not reject : insufficient evidence that the mean reaction times differ | A1 |
| (d) | |
| : reject | A1 |
A school compares two revision methods. For 8 students using method A, the mean mark is 73.25 (standard deviation 4.06); for 7 students using method B, the mean is 66.57 (standard deviation 3.26). A t-test is used to test, at the 5% level, whether method A gives a higher mean mark.
- (a)Write down the hypotheses.[2]
- (b)The p-value is 0.00205. State the conclusion in context.[2]
- (c)Suggest one reason why the conclusion might still be unreliable.[2]
| (a) | |
| : | A1 |
| : | A1 |
| (b) | |
| R1 | |
| reject : evidence that method A gives a higher mean mark | A1 |
| (c) | |
| for example: small samples; the students were not chosen at random; the groups may differ in ability; the marks may not be normally distributed | R2 |
7Check yourself
Six quick questions, marked instantly. Aim for 6/6 before moving on. Fractions like 3/2 are accepted.
8Past-paper practice
Once you're scoring well above, try these real IB Maths AI SL questions. Your school or teacher will have the papers.
| Paper | Question | Focus | Difficulty |
|---|---|---|---|
| May 2023 · TZ1 · Paper 1 | Q4 | Bilingual vs monolingual memory: one-tailed t-test | ★★☆ |
| Nov 2025 · TZ1 · Paper 1 | Q4 | Fuel efficiency: assumption, hypotheses, p-value, conclusion | ★★☆ |
| May 2021 · TZ1 · Paper 1 | Q6 | Goose egg weights: one-tailed t-test, H₀, p-value, conclusion | ★☆☆ |
| May 2026 · TZ2 · Paper 1 | Q8 | Swimmers vs gymnasts: two-tailed t-test in context | ★☆☆ |
