Statistics & probability · AI SL & HL
t-tests for population means
Compare two independent population means with an unpaired two-sample t-test using technology. Separate labelled sections explain HL and background methods.
Course focus: AI SL: technology-based unpaired two-sample t-tests, using the stated population assumptions and context (SL 4.11). One-sample tests are HL (AHL 4.18). Paired-difference methods here are optional background, not an AI SL requirement.
Before you start: Sample mean and standard deviation, normal models and p-values.
Build it from the beginning
A two-sample t-test asks whether population means differ, using samples that naturally vary. Start with the population claim, not the sample result. For the AI SL unpaired test, the groups must be independent and the stated assumptions must be checked before using the calculator.
A first walkthrough
Set up an unpaired two-sample test for whether two teaching groups have different population mean scores.
- Let \(\mu_1\) and \(\mu_2\) be their population means.
- Use \(H_0:\mu_1=\mu_2\) and \(H_1:\mu_1\ne\mu_2\).
- Enter both independent samples or the required summaries into the appropriate two-sample tool, selecting the required alternative and stated variance assumption.
The foundations behind the method
HL extensionUnderstand what the symbols mean
Testing means requires a model for sampling variation. Individual measurements can be widely spread while their average is estimated more precisely. A t procedure uses sample spread to estimate that precision. Before calculating, identify the population parameter, the sample design and whether observations are paired or independent.
How the ideas connect
The standard error belongs to the estimator, not the raw data. Pairing changes the estimator to an average difference, and independence allows the variances of separate sample means to add. These structural choices come before a calculator command; choosing the wrong design cannot be repaired by reporting more decimal places.
Start with the idea
Build your understanding
Design
Matched before-and-after measurements produce paired differences, while unrelated groups require independent-sample treatment.
Uncertainty
A statistic standardizes a discrepancy by sampling precision. Its sign supplies direction; its tail probability supplies the evidence measure.
Compare the approaches
Choose by the information in the question, rather than the formula you recognise first.
Paired test
When it helpsUse when measurements form genuine matched pairs.
Check before using itTest the list of paired differences, not two unrelated sorted rank lists.
Independent two-sample test
When it helpsUse for separate independent groups.
Check before using itState the pooling assumption or unequal-variance option and choose the alternative direction consistently.
Your method plan
- State the population hypotheses and identify the sampling design.
- Check assumptions and enter raw or summary data with the correct test settings.
- Report the p-value and a contextual decision at the preselected level.
Learn the methods
Learn step by step
1. The parameter is a population mean
A sample mean varies from sample to sample. A test asks whether its discrepancy from a proposed population mean, or from another sample’s mean, is unusually large relative to that sampling variation. Hypotheses concern population parameters, not the already observed sample mean. Decide whether the alternative is two-sided or directional before calculating a p-value. A one-sample calculation can provide background understanding; follow the test requested in the task.
2. Independent samples or paired differences
Optional backgroundTwo independent groups and two measurements on the same individuals are different designs. In an independent-sample test, separate group means and uncertainties are compared. In a paired test, calculate each matched difference and test the mean of those differences. Pairing can remove common individual variation, but only when it is part of the design. Do not pair unrelated values by sorting them or their accidental row position.
Worked example: Build the paired-difference input
Four paired after-minus-before differences are 1,2,3,4. Find their mean and estimated standard error.
- The difference mean is 2.5.
- Squared deviations sum to 5; sample variance uses denominator 3, giving 5/3.
- The estimated standard error is \(\sqrt{5/3}/\sqrt4=\sqrt{5/12}\approx0.645497\).
- For a zero-mean null, the statistic is \(2.5/\sqrt{5/12}\approx3.87298\) with 3 degrees of freedom under a suitable normal difference model. Assess that model before making an inferential conclusion.
3. Assumptions belong to the design
Observations within and between independent samples should be independent; paired differences should be independent across pairs. Small-sample t procedures need an approximately normal population or difference distribution without severe outliers. Larger samples can be more robust, but independence remains important. A pooled two-sample procedure additionally assumes equal population variances; Welch’s procedure does not. Use the stated method and calculator option rather than leaving a pooling choice unexplained.
4. One-sample statistic as a conceptual bridge
HL extensionWhen estimating the population standard deviation with sample s, the standard error of the mean is \(s/\sqrt n\). Divide the observed mean discrepancy by this estimated error to form a t statistic. Its reference distribution has n−1 degrees of freedom for the one-sample normal model. The t distribution is heavier-tailed than the standard normal, reflecting uncertainty from estimating spread. In an AI task, numerical technology may perform this calculation; its input setup still needs to be correct.
A p-value is a tail probability under the null model
- Standard normal density
One-sample mean statistic
HL extensionWhy this formula works
The numerator is the observed mean’s discrepancy from the null mean. The denominator estimates the variation of sample means, not the variation of individual measurements. Under a normal sampling model with unknown spread, estimating the spread produces a t rather than standard-normal reference distribution.
\(t=\frac{\bar x-\mu_0}{s/\sqrt n}\), with \(\nu=n-1\).
Quick example
With \(\bar x=22,\mu_0=20,s=4,n=16\), the standard error is 1 and the statistic is 2 with 15 degrees of freedom.
Worked example: A directional mean test
A random sample has n=16, mean 22 and sample s=4. Test \(H_0:\mu=20\) against \(H_1:\mu>20\), with suitable normality assumptions.
- The statistic is \((22-20)/(4/4)=2\), with 15 degrees of freedom.
- The upper-tail t p-value is about 0.031973.
- At 5%, reject the null and state evidence that the population mean exceeds 20.
- A two-sided alternative would have a different p-value, about 0.063945; the alternative must not be changed after observing the direction.
5. Two-sample technology and output
For independent groups, specify their mean difference, sample sizes and sample standard deviations, or supply the two raw data lists. Choose the alternative direction in the same order as the subtraction. Record whether a pooled or unequal-variance procedure is used. Read the statistic, degrees of freedom and p-value, but do not confuse the statistic’s sign with significance. A negative statistic can be highly significant for a left-tail or two-sided test.
Welch mean-comparison statistic
Why this formula works
Independent sample means contribute separate variances to their difference. Their estimated variances add even though the means are subtracted; squared scale factors remove the minus sign. Welch’s procedure also estimates an appropriate effective degrees of freedom, which technology should retain rather than replacing with an arbitrary integer.
\(t=\frac{\bar x_1-\bar x_2-\Delta_0}{\sqrt{s_1^2/n_1+s_2^2/n_2}}\).
Quick example
For means 14 and 12, s=2 in both groups and n=10 in each, the estimated standard error is \(\sqrt{0.8}\), so t is about 2.23607.
Worked example: Independent-group comparison
Two independent samples each have n=10 and s=2, with means 14 and 12. Use an unequal-variance two-sided comparison.
- The standard error is \(\sqrt{4/10+4/10}=\sqrt{0.8}\).
- The statistic is \(2/\sqrt{0.8}\approx2.23607\). Here Welch degrees of freedom are 18 because the inputs are symmetric.
- The two-sided p-value is about 0.03825, below 0.05.
- There is evidence of a population mean difference under the stated sampling assumptions. This does not establish that group membership causes the difference.
6. Write the conclusion carefully
If the p-value meets the preselected level, reject the null and state evidence for the specified population mean difference. Otherwise state insufficient evidence to reject. A non-significant result does not prove two means identical. Statistical significance does not measure educational, clinical or practical importance; inspect the difference and uncertainty too. Report the sampled population and any assumption concerns. Do not treat the p-value as the probability that the null hypothesis is true.
Quick formula reference
For revision once you understand the methods above. Check the conditions before using a formula.
One-sample mean statistic
HL extension\(t=\frac{\bar x-\mu_0}{s/\sqrt n}\), with \(\nu=n-1\).
Return to the explanation →Welch mean-comparison statistic
\(t=\frac{\bar x_1-\bar x_2-\Delta_0}{\sqrt{s_1^2/n_1+s_2^2/n_2}}\).
Return to the explanation →Learn to diagnose an error
Spot the mistake
HL extensionThe statement below is incorrect. Identify the missing condition or reasoning before opening the explanation.
Because two groups have the same sample mean, their population means have been proved equal.
Explain and repair the mistake
Sample agreement does not prove population equality. Conversely, a non-significant test means insufficient evidence of the specified difference at its level, not proof of no effect. The design, sample size and uncertainty determine what can be inferred.
Connect and apply
Put the ideas together
A more demanding application of this guide’s methods. This is a learning stage; any additional HL content is labelled separately.
A before-and-after design
HL extensionFive participants are measured before and after an intervention. What variable should a paired mean test use?
- Match each participant’s before and after values.
- Choose a subtraction order and calculate one difference per participant.
- Test whether the population mean difference equals zero, with the appropriate alternative.
- Assess assumptions for the differences, including independence across participants; do not count ten measurements as ten independent participants.
Does pairing alone establish the intervention caused any difference?
Check your reasoning
No. Causal interpretation depends on the research design, potential confounders and comparison conditions. A paired test addresses a statistical mean change under assumptions, not every possible cause.
Common mistakes and how to avoid them
- Sample agreement does not prove population equality. Conversely, a non-significant test means insufficient evidence of the specified difference at its level, not proof of no effect. The design, sample size and uncertainty determine what can be inferred.
- Test the list of paired differences, not two unrelated sorted rank lists.
- State the pooling assumption or unequal-variance option and choose the alternative direction consistently.
Practise independently
Build confidence, then apply it
Try each question before opening its hint or solution. If a method is new, return to the walkthrough, then try again. These learning stages describe the practice sequence; additional HL content is labelled separately.
- 1
Build confidence
The p-value is 0.02 at the 5% level. State the conclusion.
Need a starting point?
Compare p with 0.05 and refer to population means.
Show the worked solution
- Reject \(H_0\) because 0.02 is below 0.05.
- There is evidence that the population mean scores differ; the test alone does not identify why.
- 2
Apply and explain
The same students take a before-and-after test. Is an unpaired test an appropriate default?
Need a starting point?
Ask whether the two sets of observations are independent.
Show the worked solution
- No: measurements from the same student are paired.
- Do not feed them into an independent-samples test without addressing the dependence.
- 3
Check your understanding
HL extensionIn a paired test, what is the sample size if eight people are each measured before and after?
Show the worked solution
The sample of differences has size 8, not 16 independent participants. Calculate one matched difference for each person, and assess independence across those differences.
- 4
Use the method
HL extensionSixteen independent observations have sample standard deviation 8. What is the estimated standard error of their mean?
Show the worked solution
It is 8/√16=2. The standard deviation 8 describes individual spread; the standard error 2 estimates sample-mean variation. This formula assumes the independent sampling structure.
Finished? Use the linked question bank below to practise selecting the method without a guide telling you which rule to use.
Using these methods in exam questions
AI Paper 1
GDC requiredShort-response questions still need mathematical setup and interpretation. Choose the correct tool, enter the model or data carefully, and check units and rounding.
AI Paper 2
GDC requiredExtended-response questions connect several steps. Keep intermediate values at full precision and explain how each result answers the context.
For this topic: Define the variable or events, write the probability statement or hypotheses, then calculate. Name the distribution and its parameters; interpret the result using the original population or context.
Paper 3: build a connected argument
Both AA HL and AI HL Paper 3 contain two extended problem-solving questions. A question develops a theme, so keep useful earlier results, test small cases and explain any proposed general rule. A calculator pattern can suggest a result; your mathematical reasoning must support it.
- Identify what the first part establishes and record the conditions under which it holds.
- When a later part introduces a new definition or model, connect it to methods you already know rather than assuming a new formula must have been memorised.
- Check the conclusion against an earlier numerical case and explain its meaning or limitation.
For the first-assessment-2021 courses. IB assessment reference ↗
Find a specific method or formula
Now practise the method
If you opened this guide from a question, return to that tab and try the method without looking at the example. Your answer stays in the question tab.
Practise this subtopic →Want a broader practice session? Explore IB Maths AI SL practice questions →Explore IB Maths AI HL practice questions →Try free IB Maths exam-style questions and worked solutions →
Original Arc Practice teaching notes for Maths AI. Core and HL sections are distinguished above. These notes follow the first-assessment-2021 course and are not an official IB publication or a complete syllabus checklist. IB course reference. Report a correction.