IB MATHEMATICS: ANALYSIS AND APPROACHES • STATISTICS AND PROBABILITY

Hypothesis Testing & CIs — AHL 4.11 Hypothesis testing and confidence intervals (HL) (intro-to-standard)

Learn how statisticians use sample data to draw reliable conclusions about entire populations.

Historical Context & Motivation

Imagine you are a quality-control manager at a factory that produces light bulbs. The company claims each bulb lasts an average of 1 000 hours, but customers are complaining. You test a sample of 50 bulbs and find their average life is only 970 hours. Is the company's claim wrong, or did you just happen to grab a weaker batch? This is exactly the kind of question that hypothesis testing and confidence intervals were designed to answer. These tools let us move from guesswork to mathematically justified decisions.

The development of these ideas spans several centuries, growing from early probability theory into the sophisticated framework used in science, medicine, economics, and engineering today. Understanding the history helps us appreciate why these methods work and what assumptions sit beneath them.

1710
Arbuthnot's Birth-Ratio Test
John Arbuthnot examined London christening records and argued that the consistent excess of male births over female births was evidence of divine design — one of the earliest known significance tests.
1908
Student's t-Distribution
William Sealy Gosset, publishing under the pen name 'Student' while working at Guinness Brewery, derived the t-distribution for small samples, enabling reliable inference when data are limited.
1925
Fisher Formalises Significance Testing
Ronald Fisher introduced the concept of the p-value and proposed the 5 % significance level as a convenient threshold, shaping modern experimental science.
1933
Neyman–Pearson Framework
Jerzy Neyman and Egon Pearson formalised hypothesis testing with null and alternative hypotheses, Type I and Type II errors, and the concept of statistical power, creating the framework used in AHL 4.11.
1937
Confidence Intervals Introduced
Jerzy Neyman published his theory of confidence intervals, providing a way to estimate population parameters with a stated level of confidence rather than a single point estimate.

The central question these pioneers were tackling remains the same one you will answer in this lesson: how can we use a limited sample to make defensible claims about a much larger population? Whether you are evaluating a new drug, testing a physics theory, or checking factory output, the logic is identical.

Core Principles & Definitions

Before you can run a hypothesis test or build a confidence interval, you need a small toolkit of vocabulary and ideas. Every concept below will appear repeatedly throughout the IB HL Statistics and Probability course, so getting comfortable with them now will pay off later.

1

Null Hypothesis (H₀)

The default claim you assume to be true until evidence suggests otherwise. It usually states 'no change' or 'no difference.' For a population mean, H₀ might be µ = µ₀.
2

Alternative Hypothesis (H₁)

The claim you are trying to find evidence for. It can be one-tailed (µ > µ₀ or µ < µ₀) or two-tailed (µ ≠ µ₀), depending on the research question.
3

Significance Level (α)

The probability threshold for rejecting H₀. Common values are 0.05 (5 %) and 0.01 (1 %). A smaller α means you demand stronger evidence before rejecting H₀.
4

p-value

The probability of obtaining a test statistic at least as extreme as the observed one, assuming H₀ is true. If p ≤ α, you reject H₀; otherwise, you fail to reject it.
5

Confidence Interval (CI)

A range of values, constructed from sample data, that is expected to contain the true population parameter a specified percentage (e.g., 95 %) of the time across repeated sampling.

A few more ideas tie these together. A Type I error occurs when you reject H₀ even though it is actually true — a 'false alarm.' A Type II error occurs when you fail to reject H₀ even though H₁ is actually true — a 'missed finding.' The significance level α is exactly the probability of a Type I error that you are willing to tolerate.

KEY TAKEAWAY
Think of hypothesis testing like a courtroom trial. The null hypothesis is 'innocent until proven guilty.' The sample evidence is the prosecution's case. The significance level sets how convincing the evidence must be before the jury (you) delivers a guilty verdict (rejects H₀). A confidence interval is like saying, 'We believe the truth lies somewhere in this range,' instead of pinpointing a single number.

Visual Explanation — The Logic of a Hypothesis Test

The diagram below shows how a hypothesis test works when we are testing a population mean using a z-test. The bell curve represents the sampling distribution of x̄ under the null hypothesis. The shaded tails are the rejection regions — if our test statistic lands there, we reject H₀.

The violet bell curve shows the sampling distribution of z under H₀. The red shaded tails represent the rejection regions (each tail has area α/2 = 0.025). The cyan dot at z = 1.42 falls inside the non-rejection region, so we would fail to reject H₀ at the 5 % level.

Notice three key features. First, the curve is centred on z = 0 because we assume H₀ is true when we calculate probabilities. Second, the total shaded area equals α = 0.05, split equally between two tails for a two-tailed test. Third, the observed test statistic acts like a pin dropped onto the number line — its position determines our decision. If the pin lands in a red zone, the sample evidence is strong enough to reject H₀.

Mathematical Framework

In the IB HL course, you will primarily encounter hypothesis tests for a population mean µ when the population variance σ² is known (z-test) or unknown (t-test), and you will construct confidence intervals for µ. Below are the key formulas you need to master.

Z-TEST STATISTIC
z = (x̄ − µ₀) / (σ / √n)
x̄ = sample mean, µ₀ = hypothesised population mean (from H₀), σ = known population standard deviation, n = sample size. This statistic follows the standard normal distribution N(0, 1) when H₀ is true.
T-TEST STATISTIC
t = (x̄ − µ₀) / (s / √n)
s = sample standard deviation (used when σ is unknown). This statistic follows a t-distribution with ν = n − 1 degrees of freedom. For large n (roughly n ≥ 30), the t-distribution closely approximates the standard normal.
CONFIDENCE INTERVAL FOR µ (σ KNOWN)
x̄ − z* × (σ / √n) ≤ µ ≤ x̄ + z* × (σ / √n)
z* is the critical value from the standard normal distribution corresponding to the desired confidence level. For a 95 % CI, z* = 1.960; for a 99 % CI, z* = 2.576.
CONFIDENCE INTERVAL FOR µ (σ UNKNOWN)
x̄ − t* × (s / √n) ≤ µ ≤ x̄ + t* × (s / √n)
t* is the critical value from the t-distribution with n − 1 degrees of freedom. This interval is wider than the z-interval because using s instead of σ introduces extra uncertainty.
📝 IB Exam Tip
The IB formula booklet provides critical values for the standard normal distribution. For the t-distribution, you will typically use your GDC (graphing calculator). Always state your hypotheses, significance level, test statistic, p-value (or critical value comparison), and conclusion in context — examiners award marks for each of these steps.

One-Tailed vs Two-Tailed Tests & the Relationship with CIs

A common source of confusion is when to use a one-tailed test versus a two-tailed test. The choice depends entirely on the alternative hypothesis. If H₁ states that µ is simply different from µ₀ (µ ≠ µ₀), you run a two-tailed test. If H₁ states a specific direction — µ > µ₀ or µ < µ₀ — you run a one-tailed test, placing the entire rejection region in one tail.

Top left: a left-tailed test places all α = 0.05 in the left tail (critical value z = −1.645). Top right: a right-tailed test mirrors this in the right tail. Bottom: a two-tailed test splits α into two equal tails of 0.025 each, with critical values ±1.96.

There is an elegant connection between hypothesis tests and confidence intervals. A two-tailed z-test at significance level α will reject H₀: µ = µ₀ if and only if µ₀ falls outside the corresponding (1 − α) × 100 % confidence interval. In other words, constructing a 95 % CI and checking whether µ₀ is inside it gives the same answer as running a two-tailed test at α = 0.05. This duality is worth remembering because IB problems sometimes ask you to use a CI to reach a conclusion about a hypothesis.

⚠️ Watch Out: One-Tailed vs CI
The CI-test duality only works directly with two-tailed tests. For a one-tailed test at α = 0.05, the equivalent CI would need to be a one-sided 90 % interval, which is less commonly used. Stick with the p-value or critical-value method for one-tailed tests.

Worked Example — z-Test and 95 % Confidence Interval

A coffee-shop chain claims that its large cups contain an average of µ = 350 mL of coffee. A consumer group suspects the cups are under-filled. They take a random sample of n = 40 cups and find x̄ = 343 mL. The population standard deviation is known to be σ = 18 mL. Test the claim at the 5 % significance level and construct a 95 % confidence interval for the true mean.

Hypothesis Test & 95 % CI
1
Step 1 — State HypothesesThe consumer group suspects under-filling, so the test is one-tailed (left). H₀: µ = 350. H₁: µ < 350. Significance level α = 0.05.
H₀: µ = 350, H₁: µ < 350, α = 0.05
2
Step 2 — Calculate the Test Statisticz = (x̄ − µ₀) / (σ / √n) = (343 − 350) / (18 / √40) = (−7) / (18 / 6.3246) = −7 / 2.8460 ≈ −2.459.
z ≈ −2.46
3
Step 3 — Find the p-valueSince this is a left-tailed test, p = P(Z ≤ −2.46). Using the standard normal table or GDC, p ≈ 0.0069.
p ≈ 0.0069
4
Step 4 — Make a DecisionSince p = 0.0069 < α = 0.05, we reject H₀. There is sufficient evidence at the 5 % significance level to conclude that the true mean volume is less than 350 mL.
Reject H₀ — evidence supports under-filling.
5
Step 5 — Construct the 95 % Confidence IntervalCI = x̄ ± z* × (σ / √n) = 343 ± 1.960 × 2.846 = 343 ± 5.578. Lower bound: 343 − 5.578 ≈ 337.4. Upper bound: 343 + 5.578 ≈ 348.6.
95 % CI: (337.4, 348.6) mL
6
Step 6 — Interpret the CIThe claimed mean of 350 mL lies outside the 95 % CI (337.4, 348.6). This is consistent with our test result: the two-tailed equivalent would also reject 350. We are 95 % confident that the true mean cup volume lies between roughly 337 and 349 mL.
µ = 350 is not in the CI → consistent with rejecting H₀.

Strengths, Limitations & Common Misconceptions

Strengths and limitations of hypothesis tests and confidence intervals
AspectStrengthsLimitations / Pitfalls
ObjectivityProvides a structured, repeatable decision procedure rather than subjective judgement.The choice of α is still somewhat arbitrary; 5 % is a convention, not a law of nature.
Quantified uncertaintyConfidence intervals give a range, acknowledging that point estimates alone can be misleading.A 95 % CI does NOT mean there is a 95 % probability the true parameter is inside this specific interval. It means 95 % of such intervals, across repeated sampling, would contain the parameter.
Sample size sensitivityLarge samples produce narrow CIs and high power, making small effects detectable.With a very large n, even trivially small deviations from µ₀ become 'statistically significant,' even if they have no practical importance.
AssumptionsThe z-test relies on a known σ and normally distributed data (or large n by CLT), which are reasonable in many real-world settings.If data are heavily skewed and n is small, the normal approximation breaks down, leading to unreliable p-values and CIs.
⚠️ COMMON MISCONCEPTION
Failing to reject H₀ does not mean H₀ is true. It simply means the sample did not provide strong enough evidence against it — much like a 'not guilty' verdict in court does not prove innocence, only that the prosecution's case was insufficient. Similarly, a p-value is not the probability that H₀ is true; it is the probability of seeing data as extreme as yours, given that H₀ is true.

Connection to Advanced Topics

The z-test and t-test for means are your entry point into a much larger family of hypothesis tests. As you progress in the IB HL course and beyond, you will encounter chi-squared tests for independence, tests for proportions, paired t-tests, and analysis of variance (ANOVA). The logical structure — state hypotheses, compute a test statistic, find a p-value, make a decision — remains exactly the same.

This lesson's scope vs advanced extensions
FeatureIntro / Standard (This Lesson)Advanced Extensions
Parameter testedPopulation mean µProportions p, variances σ², regression slopes β
Distribution usedStandard normal (z) or t-distributionChi-squared χ², F-distribution, non-parametric tests
Number of groupsOne sample vs one hypothesised valueTwo-sample tests, paired tests, multi-group ANOVA
Confidence intervalsFor µ using z* or t*For differences of means, proportions, odds ratios, prediction intervals

One particularly important extension is the concept of statistical power — the probability that a test correctly rejects H₀ when H₁ is true. Power depends on α, n, and the true effect size. In research design, scientists choose n large enough to achieve a desired power (commonly 0.80), ensuring their study has a realistic chance of detecting the effect they are looking for.

Practice Problems

PROBLEM 1CONCEPTUAL
In your own words, explain the difference between a Type I error and a Type II error. Give a real-world example of each in the context of a medical drug trial.
PROBLEM 2BASIC CALCULATION
A teacher claims the mean score on a standardised test for her students is µ = 72. A random sample of n = 36 students gives x̄ = 75 with a known population standard deviation σ = 12. Calculate the z-test statistic for a two-tailed test.
PROBLEM 3INTERMEDIATE
A factory produces bolts with a nominal length of 5.00 cm. A quality inspector takes a sample of n = 25 bolts and obtains x̄ = 5.03 cm with s = 0.08 cm. The population standard deviation is not known. (a) Perform a two-tailed t-test at α = 0.05. (b) Construct a 95 % confidence interval for the true mean length.
PROBLEM 4APPLIED
An energy-drink company claims their cans contain an average of 250 mg of caffeine. A health agency tests n = 50 cans and finds x̄ = 259 mg with σ = 20 mg (assumed known). Test whether the true mean exceeds 250 mg at the 1 % significance level, and explain the practical implications of your finding.
PROBLEM 5CRITICAL THINKING
A researcher tests H₀: µ = 100 against H₁: µ ≠ 100 using a sample of n = 10 000 and obtains z = 2.05 (p ≈ 0.040). She rejects H₀ at the 5 % level. However, the sample mean was x̄ = 100.3. Discuss whether this result is practically significant, and explain how the large sample size affects interpretation.

Lesson Summary

In this lesson you learned to perform hypothesis tests for a population mean by stating a null hypothesis (H₀) and an alternative hypothesis (H₁), computing a z- or t-test statistic, comparing it to a critical value or finding the p-value, and writing a conclusion in context. You also learned that a confidence interval provides a range of plausible values for the true mean, with wider intervals reflecting greater uncertainty.

Key ideas to retain: the significance level α sets the maximum acceptable probability of a Type I error; a two-tailed test at α corresponds to a (1 − α) × 100 % confidence interval; and statistical significance does not automatically imply practical significance. Always report your results in the context of the original problem, and remember that failing to reject H₀ is not the same as proving H₀ true.

Varsity Tutors • IB Mathematics: Analysis and Approaches • Hypothesis Testing & CIs — AHL 4.11