Free Cheatsheet · AI HL · SL 4.11 · AHL 4.18–4.19

IB Math AI HL Hypothesis Testing — Complete Cheatsheet

Every step of a hypothesis test — stating H0 and H1, the chi-squared tests for independence and goodness of fit, and the t- and z-tests for a population mean — for IB Mathematics Applications & Interpretation HL, with the GDC doing the heavy lifting. Built by an IBO-certified Singapore tutor, with a print-ready PDF to download.

Topic: Hypothesis Testing (Statistics & Probability) Syllabus: SL 4.11 · AHL 4.18–4.19 Read time: ~11 minutes Last updated: Jul 2026

Hypothesis testing is the capstone of the Statistics & Probability strand in IB Mathematics Applications & Interpretation HL, and it is AI at its most practical: it is the formal machinery for deciding whether real data show a genuine effect or just random noise. Does a new teaching method actually raise marks? Are voting preference and age group associated? Do accident counts follow a Poisson model? A calculator is always allowed, so the GDC does the heavy lifting — you enter the data and read off the $\chi^2$ or $t$ statistic and the p-value. The marks live in stating the hypotheses, choosing the right test, and writing the in-context conclusion — not in grinding the arithmetic.

This cheatsheet condenses SL 4.11 · AHL 4.18–4.19 onto one page — null and alternative hypotheses, significance levels, expected frequencies, the $\chi^2$ tests for independence and goodness of fit, the $t$-test and $z$-test for a population mean, and the p-value / critical-value decision — and flags the traps that quietly cost marks (degrees of freedom, where expected frequencies come from, the direction of $p<\alpha$, and $\sigma$ versus $s$). The print-ready PDF is at the bottom, free to download.

§1 — Null & alternative hypotheses, significance SL 4.11

Every test weighs a null hypothesis against an alternative, then uses the sample evidence to decide between them.

Null hypothesis:$H_0$ — "no effect": the variables are independent, the data fit the model, or $\mu=\mu_0$.
Alternative:$H_1$ — an effect exists: the variables are associated, the data do not fit, or the mean has changed.
Significance level:$\alpha$ — the risk you accept of rejecting a true $H_0$; usually $\alpha=0.05$ (5%), written as a decimal.
Decision rule:reject $H_0$ when $p<\alpha$; otherwise there is insufficient evidence to reject it.
TrapThe claim you are testing for — a difference, an effect, an association — always goes in $H_1$. $H_0$ is the "nothing interesting" statement and always carries the equality.
NoteA test never proves $H_0$ true. You either reject it, or you fail to reject it (insufficient evidence). A 1% test is stricter than a 5% test — harder to reject $H_0$ — so always use the $\alpha$ the question states.

§2 — Observed & expected frequencies SL 4.11

Every $\chi^2$ test compares the observed counts $O$ with the expected counts $E$ that $H_0$ predicts. Getting $E$ right is the whole game.

From a proportion:$E=n\times p$ — the sample size times the proportion $H_0$ predicts for that category.
From a percentage:turn the % into a fraction over 100 first: $E=n\times\dfrac{\%}{100}$.
Contingency cell:$E=\dfrac{(\text{row total})\times(\text{column total})}{\text{grand total}}$ — for a test of independence.
TrapBuild each expected cell from the totals around the edge of the table — the row total and column total — never from the observed value sitting in the cell.
NoteExpected frequencies need not be whole numbers; keep them exact. If any expected frequency comes out below 5, combine adjacent categories before testing (and recount the number of categories for the degrees of freedom).

§3 — The $\chi^2$ statistic & degrees of freedom SL 4.11

Both $\chi^2$ tests use the same statistic — a running total of how far each observed count sits from its expected count.

Test statistic:$\chi^2_{\text{calc}}=\displaystyle\sum\frac{(O-E)^2}{E}$ — summed over every cell or category.
df (goodness of fit):$\text{df}=k-1$ for $k$ categories.
df (independence):$\text{df}=(r-1)(c-1)$ for an $r\times c$ table.
TrickKeep $O$ and $E$ paired: square each difference, divide by its own $E$, then add. Never divide the grand total by $E$ at the end.
TrapDegrees of freedom depend only on the table's shape, not the sample size — a $2\times3$ table always has $\text{df}=(2-1)(3-1)=2$, whether you tested 40 people or 4000.

§4 — The $\chi^2$ test for independence SL 4.11

This tests whether two categorical variables are associated. $H_0$: the variables are independent; $H_1$: they are not. Consider a small survey of $100$ people — drink choice against age group:

Observed $O$LatteEspressoRow total
Under 30302050
30 or over203050
Column total5050100

Each expected value comes from the margins: for the "Under 30, Latte" cell, $E=\dfrac{50\times50}{100}=25$ — and by symmetry all four expected cells are $25$ here.

TrickEnter the observed matrix into your GDC's $\chi^2$-test and it returns $\chi^2_{\text{calc}}$, the p-value and the degrees of freedom in one step. Do the sum by hand only for a "show that" part.
NoteA quick self-check: each row and each column of your expected table must add up to the same totals as the observed table. If they do not, an expected value is wrong.

§5 — The $\chi^2$ goodness-of-fit test SL 4.11

Goodness of fit asks whether observed counts match a claimed model — a fair die, a stated set of proportions, or a distribution. $H_0$: the data fit the model; $H_1$: they do not.

Equally likely:each $E=\dfrac{n}{k}$ — $n$ data split evenly across $k$ categories.
Stated proportions:$E_i=n\times p_i$ — scale each model proportion by the sample size.
Statistic & df:$\chi^2=\displaystyle\sum\frac{(O-E)^2}{E}$, with $\text{df}=k-1$.
TrapA large $\chi^2$ (small p-value) means the data do not fit — you reject $H_0$. Do not read a big statistic as evidence of a good fit; it is the opposite.
NoteThe categories must together cover every outcome and their expected frequencies must total $n$. If a class has an expected count below 5, merge it with a neighbour before you test.

§6 — Fitting a distribution: a Poisson example SL 4.11

A goodness-of-fit test really shines when the model is a probability distribution such as a Poisson. The distribution supplies the expected frequencies — a probability-distribution calculation feeding straight into the hypothesis test.

Model probability:$P(X=k)=\dfrac{e^{-\lambda}\lambda^{k}}{k!}$ — for a Poisson with mean $\lambda$.
Expected frequency:$E_k=n\,P(X=k)$ — scale each probability by the sample size $n$.
Then, as always:$\chi^2=\displaystyle\sum\frac{(O-E)^2}{E}$, compared against $\alpha$.
TrickWork left to right: find each $P(X=k)$ on the GDC (keeping the $e^{-\lambda}$ factor), turn it into a frequency with $E_k=nP(X=k)$, then form $\dfrac{(O-E)^2}{E}$ for each class.
NoteGroup the upper tail into a single "$5$ or more" class so its expected frequency reaches 5, and so the probabilities cover all outcomes and sum to 1. With $k$ classes and a given mean, $\text{df}=k-1$.

§7 — Critical values & the rejection region AHL 4.18

There are two equivalent ways to reach a verdict, and they always agree.

p-value method:reject $H_0 \iff p<\alpha$.
Critical-value method:reject $H_0 \iff \chi^2_{\text{calc}}>\chi^2_{\text{crit}}$.
χ² Do not reject H₀ Reject H₀ χ²crit
The $\chi^2$ distribution is right-skewed, so the test rejects $H_0$ only in the upper tail. If $\chi^2_{\text{calc}}$ exceeds the critical value $\chi^2_{\text{crit}}$ — equivalently the p-value drops below $\alpha$ — the result lands in the shaded rejection region.
Critical value:read $\chi^2_{\text{crit}}$ from tables/GDC using df and $\alpha$; at 5%, $\text{df}=1\to3.841$, $\text{df}=2\to5.991$, $\text{df}=3\to7.815$.
TrapThe $\chi^2$ test is one-tailed on the upper side only — you reject for a large statistic. There is no "too small to be true" rejection here.
NoteRejecting a true $H_0$ is a Type I error (its probability is exactly $\alpha$); failing to reject a false $H_0$ is a Type II error. Lowering $\alpha$ guards against Type I errors but makes Type II errors more likely.

§8 — The $t$-test for a population mean AHL 4.18

To test a claim about a mean $\mu$ when the population standard deviation is unknown, use a $t$-test — the GDC does it from either the raw data or the summary statistics.

Hypotheses:$H_0:\mu=\mu_0$ against $H_1:\mu\neq\mu_0$ (two-tailed), or $\mu>\mu_0$ / $\mu<\mu_0$ (one-tailed).
Statistic:$t=\dfrac{\bar{x}-\mu_0}{s/\sqrt{n}}$ — but read $t$ and the p-value straight off the GDC's $t$-test.
Decision:reject $H_0 \iff p<\alpha$.
TrapWhether the test is one- or two-tailed is fixed by $H_1$. A two-tailed test ($\neq$) splits $\alpha$ across both tails, so make sure the GDC's tail setting matches your $H_1$ — the wrong setting doubles or halves the p-value.
NoteThe $t$-test assumes the population is (approximately) normal. Use it when $\sigma$ is unknown and estimated by the sample $s$; use the $z$-test in §9 when $\sigma$ is known.

§9 — Known $\sigma$: the $z$-test & confidence interval AHL 4.19

When the population standard deviation $\sigma$ is known, the sample mean is tested with a $z$-statistic, and the same standard error builds a confidence interval.

Test statistic:$z=\dfrac{\bar{x}-\mu_0}{\sigma/\sqrt{n}}$, where $\dfrac{\sigma}{\sqrt{n}}$ is the standard error.
Decision:reject $H_0 \iff p<\alpha$ (equivalently $|z|>z_{\text{crit}}$).
95% CI for $\mu$:$\bar{x}\pm1.96\,\dfrac{\sigma}{\sqrt{n}}$ — use $2.576$ in place of $1.96$ for a 99% interval.
TrapDivide by $\sqrt{n}$, not $n$. The standard error shrinks only with the square root of the sample size, so quadrupling $n$ merely halves it.
NoteConfidence intervals and two-tailed tests are two views of one calculation: a value $\mu_0$ lying outside the 95% CI is exactly a value that a two-tailed test at $\alpha=0.05$ would reject.

§10 — Exam attack plan All sections

Question cueWhat to doWatch for
"State the hypotheses"$H_0$ = no effect / independent / $\mu=\mu_0$; put the claim in $H_1$$H_0$ always carries the equality
"Test for independence"$E=\dfrac{\text{row}\times\text{col}}{\text{grand}}$; $\text{df}=(r-1)(c-1)$; GDC for $\chi^2$, $p$Use the margins for $E$, not the observed cell
"Goodness of fit"$E=np_i$ (or $n/k$); $\text{df}=k-1$; $\chi^2=\sum\frac{(O-E)^2}{E}$Big $\chi^2$ / small $p$ = does not fit
"Show the expected frequency is …"$\dfrac{\text{row total}\times\text{column total}}{\text{grand total}}$Read the totals off the edge of the table
"$t$-test for a mean ($\sigma$ unknown)"GDC $t$-test; reject if $p<\alpha$Match one- / two-tailed to $H_1$
"$z$-test / $\sigma$ known"$z=\dfrac{\bar{x}-\mu_0}{\sigma/\sqrt{n}}$; reject if $p<\alpha$Divide by $\sqrt{n}$, not $n$
"Reach a conclusion"Compare $p$ with $\alpha$ (or $\chi^2_{\text{calc}}$ with $\chi^2_{\text{crit}}$)Reject if $p<\alpha$; then state it in context
"Confidence interval for $\mu$"$\bar{x}\pm1.96\,\sigma/\sqrt{n}$$1.96$ for 95%, $2.576$ for 99%

Worked Example — $\chi^2$ Test for Independence

Question (AI HL Paper 2 style — 9 marks)

A tutor surveys $200$ students, recording their year group and preferred study method. The results are:

ObservedNotesVideosPracticeTotal
Year 1228223080
Year 13223860120
Total506090200

Test, at the $5\%$ significance level, whether preferred study method is independent of year group.
(a) State the null and alternative hypotheses.
(b) Show that the expected frequency of Year 12 students who prefer Notes is $20$.
(c) Write down the number of degrees of freedom.
(d) Find the $\chi^2$ statistic and the p-value.
(e) State, with a reason, your conclusion.

Solution

  1. (a) $H_0$: study method is independent of year group; $H_1$: study method is not independent of (is associated with) year group. (A1)(A1)
  2. (b) $E=\dfrac{(\text{row total})\times(\text{column total})}{\text{grand total}}=\dfrac{80\times50}{200}=20$. (M1)(A1) (Built from the margins $80$ and $50$, never from the observed $28$.)
  3. (c) A $2\times3$ table gives $\text{df}=(2-1)(3-1)=2$. (A1)
  4. (d) Entering the $2\times3$ observed matrix into the GDC's $\chi^2$-test gives $\chi^2_{\text{calc}}=7.28$ (3 s.f.) and $p=0.0263$ (3 s.f.). (M1)(A1) (By hand, $\chi^2=\tfrac{(28-20)^2}{20}+\tfrac{(22-24)^2}{24}+\tfrac{(30-36)^2}{36}+\tfrac{(22-30)^2}{30}+\tfrac{(38-36)^2}{36}+\tfrac{(60-54)^2}{54}=7.28$.)
  5. (e) Since $p=0.0263<0.05$ — equivalently $\chi^2_{\text{calc}}=7.28>\chi^2_{\text{crit}}=5.991$ — we reject $H_0$. (M1)(A1) There is significant evidence that preferred study method depends on year group.

Examiner's note: the two marks students throw away here are the hypotheses (write them in words, with the equality-flavoured statement as $H_0$) and the conclusion in context — "reject $H_0$" alone is not enough; you must say what that means for the study. Quote $\chi^2$ and $p$ to 3 s.f., and remember the p-value and critical-value routes always agree.

Common Student Questions

Which hypothesis gets the "equals", $H_0$ or $H_1$?
$H_0$ always carries the equality — it is the "no effect" statement: the variables are independent, the data fit the model, or $\mu=\mu_0$. $H_1$ is whatever you are actually testing for: an association, a lack of fit, or a changed mean ($\mu\neq\mu_0$, or $\mu>\mu_0$ / $\mu<\mu_0$ for a one-tailed test). A good rule of thumb: put the interesting claim in $H_1$, and let $H_0$ be the dull default you would only abandon under strong evidence.
Do I use the p-value or the critical value to decide?
Either — they always give the same verdict. The p-value route is fastest with a GDC: reject $H_0$ when $p<\alpha$. The critical-value route compares statistics: reject when $\chi^2_{\text{calc}}>\chi^2_{\text{crit}}$ (or $|z|>z_{\text{crit}}$). Use whichever the question hands you — if it quotes a critical value, compare statistics; otherwise read $p$ from the calculator and compare it with $\alpha$. A small p-value means the result would be surprising if $H_0$ were true, which is why it counts as evidence against $H_0$.
How do I find the degrees of freedom?
For a goodness-of-fit test, $\text{df}=k-1$, where $k$ is the number of categories. For a test of independence on an $r\times c$ contingency table, $\text{df}=(r-1)(c-1)$ — so a $2\times2$ table has $\text{df}=1$, a $2\times3$ table has $\text{df}=2$, and a $3\times3$ table has $\text{df}=4$. The degrees of freedom depend only on the shape of the table, never on how many data you collected. The GDC reports df automatically, but you are often asked to write it down, so know the formula.
When do I use a $t$-test rather than a $z$-test?
It comes down to the population standard deviation. If $\sigma$ is known, use a $z$-test with $z=\dfrac{\bar{x}-\mu_0}{\sigma/\sqrt{n}}$. If $\sigma$ is unknown — the usual real-world case — estimate it with the sample standard deviation $s$ and use a $t$-test. Both assume the population is roughly normal, and both reach a verdict the same way: reject $H_0$ when $p<\alpha$. Do not forget to set the GDC to a one- or two-tailed test to match your $H_1$.
My expected frequency is less than 5 — does that matter?
Yes. The $\chi^2$ approximation is only reliable when every expected frequency is at least 5. If a category (or a tail of a distribution) has an expected count below 5, combine it with an adjacent category until the merged expected frequency reaches 5, then recount the number of categories $k$ for the degrees of freedom. Note it is the expected frequencies, not the observed ones, that must clear 5 — a common mix-up.

Get the printable PDF cheatsheet — free

The same cheatsheet on one A4 page — formulas, methods and traps. No sign-in needed.