James Ashton MathsFREE MATHEMATICS. OPEN TO EVERYONE.
HomeIB DiplomaA levelAbout

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.

SL 4.11Paper 1Paper 2GDC allowed≈ 45 min to work through
Before you start: hypotheses, p-values and significance levels (χ² tests) and the normal distribution (Normal distribution).

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 H0 and H1 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.

The big idea

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

QuestionH0H1Test
Are the means different?μ1=μ2μ1≠μ2two-tailed
Is mean 1 greater?μ1=μ2μ1>μ2one-tailed
Is mean 1 less?μ1=μ2μ1<μ2one-tailed

Define what μ1 and μ2 stand for, in context. H0 always says the means are equal.

Conditions at AI SL Not in booklet: learn it

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

Worked example 1Paper 2
A teacher compares test scores for two classes. Class A: 72, 68, 75, 80, 71, 77, 69, 74. Class B: 65, 70, 62, 68, 66, 71, 64. Test at the 5% level whether class A’s mean score is higher.
μA, μB = mean scores of all students taught like class A and class B. H0: μA=μB; H1: μA>μB
One-tailed test (the question says "higher").
GDC 2-Sample t Test, Pooled: Yes, alternative μ1>μ2: t=3.48, p-value =0.00205
Put class A in list 1 so that the alternative matches your H₁.
0.00205<0.05: reject H0. There is evidence that the mean score of class A is higher.
Worked example 2Paper 2
Reaction times (s) are recorded before coffee: 0.32, 0.29, 0.35, 0.31, 0.30, 0.33, 0.36, 0.28, and for a different group after coffee: 0.34, 0.31, 0.37, 0.33, 0.35, 0.30, 0.36, 0.38. Test at the 5% level whether the mean reaction times are different.
H0: μbefore=μafter; H1: μbefore≠μafter (two-tailed)
GDC: t=−1.78, p-value =0.0975
0.0975>0.05: do not reject H0. There is insufficient evidence that coffee changes the mean reaction time.
Two different groups of people: the samples are unpaired, as AI SL requires.
Worked example 3 (faded)Paper 1
A one-tailed t-test at the 10% level gives a p-value of 0.072. State the decision.
0.072 is less than 0.10, so reject H0.  ← you work this out
On your TI-Nspire Calculator tricks →

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 t, 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 H0 as μ1>μ2. H0 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 H1, so the one-tailed p-value is wrong.
  • Concluding that H0 is true when you do not reject it.

Exam tips

  • Define μ1 and μ2 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.

FluencyP1
Write H0 and H1 to test whether a new diet reduces mean weight compared with the old diet.
H0: μnew=μold; H1: μnew<μold
FluencyP2
One or two tails: "Is there a difference in mean height between the two schools?"
Two-tailed
FluencyP3
A two-tailed test at 5% gives a p-value of 0.031. State the decision.
Reject H0.
FluencyP4
State one assumption needed for the t-test.
Both populations are normally distributed.
Problem solvingP5
Plant heights (cm) with fertiliser: 24.1, 26.3, 25.8, 27.0, 24.9, 26.1, 25.5; without: 23.8, 24.5, 25.1, 23.2, 24.9, 24.0. Test at 1% whether fertiliser increases the mean height.
t=2.99, p =0.00614<0.01: reject H0; evidence that the fertiliser increases mean height.
Problem solvingP6
Explain why a p-value of 0.06 leads to different decisions at the 5% and 10% levels.
0.06>0.05 (do not reject) but 0.06<0.10 (reject).

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.

Question 1Paper 1[7 marks]

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)
H0: μF=μNA1
H1: μF>μNA1
(b)
one-tailed pooled 2-sample t-test(M1)
0.00614A1
(c)
0.00614<0.01R1
reject H0: there is evidence that the fertiliser increases the mean heightA1
(d)
heights are normally distributed (in both groups)A1
Question 2Paper 1[6 marks]

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 largerR1
(b)
pooled two-sample t-test(M1)
0.0975A1
(c)
0.0975>0.05R1
do not reject H0: insufficient evidence that the mean reaction times differA1
(d)
0.0975<0.10: reject H0A1
Question 3Paper 2[6 marks]

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)
H0: μA=μBA1
H1: μA>μBA1
(b)
0.00205<0.05R1
reject H0: evidence that method A gives a higher mean markA1
(c)
for example: small samples; the students were not chosen at random; the groups may differ in ability; the marks may not be normally distributedR2

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.

PaperQuestionFocusDifficulty
May 2023 · TZ1 · Paper 1Q4Bilingual vs monolingual memory: one-tailed t-test★★☆
Nov 2025 · TZ1 · Paper 1Q4Fuel efficiency: assumption, hypotheses, p-value, conclusion★★☆
May 2021 · TZ1 · Paper 1Q6Goose egg weights: one-tailed t-test, H₀, p-value, conclusion★☆☆
May 2026 · TZ2 · Paper 1Q8Swimmers vs gymnasts: two-tailed t-test in context★☆☆
Spotted a mistake on this page?Tell me and I'll fix it. The button opens an email with this page already named, or write to jamesashtonmaths@gmail.com.
Report a mistake