In simple terms
A friendly intro before the formal notes — no formulas yet.
Data on Trial
A hypothesis test is a trial for a claim about data. You start by assuming nothing interesting is going on (the null hypothesis), then ask how surprising your data would be if that assumption were true. If the data is surprising enough, you reject the assumption.
Think of a courtroom. The accused is presumed innocent, and it is the evidence that must overturn that presumption. In a test the null hypothesis plays the innocent party: 'the two variables are independent', or 'the two means are equal'. The p-value measures how easily the evidence could have arisen by pure chance if were true. A tiny p-value is damning evidence, so you convict, that is, you reject . A large p-value leaves reasonable doubt, so you do not reject. Crucially, 'not guilty' is not the same as 'innocent': failing to reject never proves it true.
- 1
State the hypotheses. is the 'no effect / no association' claim; is what you are trying to detect. Fix a significance level, usually 5% (0.05), before you look at the result.
- 2
Choose the test. Categorical counts in a table point to a test; numerical averages point to a t-test. Identify which one before touching the calculator.
- 3
Read the statistic and p-value from the GDC. The calculator returns the test statistic ( or ), the degrees of freedom where relevant, and the p-value.
- 4
Decide and conclude in context. If significance level, reject ; otherwise do not. Then translate that into a sentence about the actual situation, never leave it as bare symbols.
Explore the concept
Use the live diagram and synced steps — play it or tap a step card to walk through.
Key formulas
Tap any symbol to reveal exactly what it means and its units.
Full topic notes
Formal explanation with the rigour you need for the exam.
The logic of a statistical test
Every hypothesis test, whatever its name, runs on the same five-step logic. You state a null hypothesis , the cautious 'nothing is going on' claim, and an alternative hypothesis , the effect you hope to detect. You fix a significance level, the bar the evidence must clear, before you look at the data. You compute a test statistic from the data, which the GDC converts into a p-value: the probability of data at least this extreme if were true. Finally you apply the decision rule and state the outcome in context.
The critical-value method is an exactly equivalent route to the same decision, used when a question quotes a critical value instead of expecting you to read a p-value. Each test statistic has a distribution under , and the critical value marks the point beyond which results are counted as surprising. If lands beyond the critical value you reject ; this is precisely the same as the p-value falling below the significance level. Keep both methods to hand, because IB questions use either.
Null hypothesis (): the 'no effect / no association / no difference' claim, assumed true until the evidence overturns it.
Alternative hypothesis (): the claim you are testing for. It may be two-tailed () or one-tailed ( or ).
Significance level: the threshold for rejecting , chosen in advance, typically 0.05. It is also the risk of rejecting a true .
Test statistic and p-value: the GDC returns the statistic ( or ) and the p-value, the strength of evidence against .
Decision rule: reject if p-value significance level; otherwise do not reject . Then say what that means about the real situation.
The $\chi^2$ test for independence
Use the test for independence when you have two categorical variables cross-tabulated in a contingency table and want to know whether they are related. For example: is a shopper's age group associated with their preferred payment method? The test compares the observed counts with the expected counts, that is, the counts you would predict if the two variables were completely independent. The bigger the gap between observed and expected, the larger , and the stronger the evidence of an association.
Hypotheses for a test of independence: \n : the two variables are independent. \n : the two variables are not independent (they are associated).
The expected frequency of any cell comes from its margins. Under independence the proportion in a column should be the same in every row, which gives the compact rule below. The degrees of freedom count how many cells are free to vary once the totals are fixed, which for an table is . You then either compare with the critical value or read the p-value from the GDC.
Expected frequency of a cell: . \n Degrees of freedom: for an table. \n Decision: reject if critical value, equivalently if p-value significance level.
The $\chi^2$ goodness-of-fit test
The goodness-of-fit test handles a single categorical variable rather than a relationship between two. You have observed frequencies across several categories and a hypothesised distribution, and you ask whether the data is consistent with it. For instance, a manufacturer claims its sweets come in equal numbers of four colours; a sample lets you test that claim. The mechanics mirror the independence test: expected frequencies come from the claimed distribution, the GDC returns and a p-value, and the same decision rule applies. Here the degrees of freedom are (number of categories) , reduced by a further 1 for each parameter you had to estimate from the data.
The t-test for comparing two means
When the data is numerical and you want to compare the averages of two independent groups, use a two-sample t-test. 'Independent' means membership of one group has no bearing on the other, for example the exam marks of a class taught with a new method versus a separate class taught traditionally. The null hypothesis is that the two population means are equal; the alternative is that they differ, in either direction for a two-tailed test or in a stated direction for a one-tailed test. As always on Paper 2 the GDC carries the load: enter the two data lists, set the alternative, and read off and the p-value.
Hypotheses for a two-sample t-test: \n : (the two population means are equal). \n : (two-tailed), or / (one-tailed).
Common mistakes examiners penalise
Miscounting degrees of freedom — for an table it is , using only the category rows and columns, never the totals. A table has , not 6.
Reversing the decision — reject when critical value (equivalently p-value significance level), not the other way round. A large means strong evidence of association.
Getting the expected-frequency formula wrong — it is , a product over the grand total, not a sum and not the grand total over the product.
Stopping at 'reject ' — the final accuracy mark is for a conclusion in context, e.g. 'significant evidence of an association between the variables', not bare symbols.
Writing 'accept ' — when the p-value is at or above the significance level, say 'insufficient evidence to reject '; a test never proves true.
Choosing the wrong tail — 'different / changed' is two-tailed; 'increased / decreased / reduced / longer' is one-tailed. The wrong tail gives the wrong p-value and can flip the decision.
Ignoring expected frequencies below 5 — state that this affects the test's validity, and combine categories with adjusted degrees of freedom if instructed.
Model answer — marked the way our engine marks it
On Paper 2 the marks are analytic: each is tied to a specific line of working. A method mark (M) rewards a correct approach; an accuracy mark (A) rewards a correct value and, where it follows an M, depends on that method being present. Follow-through (FT) means an earlier slip need not cost the later marks that depend on it, provided the later step is done correctly on your own figure. A reasoning mark (R) rewards a correct comparison or decision. The engine also accepts any equivalent form and any correctly rounded value. All of that protection exists only if the method is written down. The example below shows every mark earned by a specific line.
Where this leads
Hypothesis testing is the decision-making layer that sits on top of the rest of the statistics course. The contingency tables and p-values here build directly on the probability and distributions you have already met, and the same logic, a cautious null, a test statistic, a p-value, a decision in context, reappears whenever you judge whether a correlation, a regression slope or a difference of means is real or just noise. Master the shared five-step logic, keep the two decision methods and the two tail choices straight, and every hypothesis-test question on Paper 2 becomes a variation on a routine you already know how to write.
Worked examples
See the formulas applied — reveal one step at a time, like the exam.
A store surveyed 200 customers, recording each customer's age group (Under 30, 30 or over) and preferred payment method (Cash, Card, Mobile). The observed frequencies are shown below. \n \n | | Cash | Card | Mobile | Total | \n |---|---|---|---|---| \n | Under 30 | 20 | 40 | 40 | 100 | \n | 30 or over | 30 | 50 | 20 | 100 | \n | Total | 50 | 90 | 60 | 200 | \n \n (a) Find the expected frequency of customers under 30 who prefer cash. \n (b) Write down the degrees of freedom. \n (c) Perform a test for independence at the 5% significance level, stating , the p-value and your conclusion in context. [7]
- 1
(a) Expected frequency. Using for the (Under 30, Cash) cell:\n [M1 for the formula] [A1]\n\n**(b) Degrees of freedom.** The table has rows and columns of data, so\n [A1]\n\n**(c) The test.**\nHypotheses: : age group and preferred payment method are independent; : they are not independent. [M1]\nA test for independence is used at the 5% significance level.\nEnter the matrix of observed frequencies into the GDC and run the 2-way test:\n (3 s.f.), p-value (3 s.f.). [A1 for ] [A1 for p-value]\nDecision: since p-value , reject . [R1]\nConclusion in context: there is significant evidence of an association between a customer's age group and their preferred payment method. [A1]\n\nThe test statistic and p-value come straight from the calculator; the marks are for the hypotheses, the correct read-off, the comparison and the contextual sentence.
A die is rolled 120 times to test whether it is fair. The observed frequencies of the six faces are 15, 24, 18, 13, 27, 23. Test at the 5% significance level whether the die is fair. [5]
- 1
Hypotheses. : the die is fair (each face equally likely); : the die is not fair. [M1]\n\nExpected frequencies. If the die is fair each face is expected times, so the expected list is . [A1]\n\nRun the test. A goodness-of-fit test at the 5% level. Enter the observed frequencies in one list and the expected frequencies in another, then run the GDC goodness-of-fit test with :\n (3 s.f.), p-value (3 s.f.). [A1]\n\nDecision and conclusion. Since p-value , do not reject . [R1]\nThere is insufficient evidence to conclude that the die is unfair. [A1]\n\nA large p-value like means results this uneven arise easily from a fair die, so the data does not convict it.
Two brands of battery are tested. A sample of brand A lasts, in hours: 8.1, 8.4, 7.9, 8.6, 8.2, 8.0, 8.5. A sample of brand B lasts, in hours: 7.6, 7.9, 8.1, 7.4, 7.8, 8.0. Test, at the 5% significance level, whether brand A lasts longer on average than brand B. [6]
- 1
Hypotheses. Let and be the mean lifetimes. The phrase 'lasts longer' fixes a direction, so this is one-tailed:\n: ; : . [M1]\n\nTest and setup. A two-sample t-test at the 5% level. Enter brand A in List 1 and brand B in List 2, select the two-sample t-test, and set the alternative to . [M1 for correct one-tailed setup]\n\nGDC output.\n (3 s.f.), p-value (3 s.f.). [A1 for ] [A1 for p-value]\n\nDecision and conclusion. Since p-value , reject . [R1]\nThere is significant evidence that brand A batteries last longer on average than brand B batteries. [A1]\n\nHad the question merely asked whether the two brands 'differ', the alternative would be (two-tailed) and the p-value would roughly double, so the tail choice genuinely matters.
A test for independence on a contingency table gives at the 5% level. State the degrees of freedom, and given the critical value is 5.991, state the conclusion. [4]
- 1
Model answer — full working.\n\nDegrees of freedom. The table has rows and columns, so\n\n\nCompare with the critical value. At the 5% level the critical value is , and\n\n\nConclusion. Since exceeds the critical value, reject . There is significant evidence of an association between the two variables, that is, the variables are not independent.\n\n---\nHow our marking engine awards the 4 marks:\n\n- M1 — method for df. Awarded for using , shown as . It is the formula, applied to the categories rather than the totals, that earns this mark.\n- A1 — value of df. Awarded for . This accuracy mark follows the M1 and is FT: a candidate who wrote the formula and simplified their own bracket correctly keeps it.\n- M1 — compare calc with critical. Awarded for the comparison , i.e. testing against the critical value. The engine checks the correct direction of the inequality is being used to decide.\n- A1 — conclusion in context. Awarded for 'reject : there is significant evidence of an association / the variables are not independent'. This is FT on the candidate's own comparison: a student who compared correctly and drew the matching conclusion keeps it even after an earlier slip.\n\n**'Accept equivalent forms.'** The engine accepts the conclusion whether phrased as 'the variables are associated', 'they are not independent', or 'there is significant evidence of an association', and accepts 'since ' or 'since critical value' as the comparison. Once a correct conclusion appears, later restatements do not lose marks.\n\nBottom line: of the 4 marks, two are method marks that survive an arithmetic slip, and the accuracy marks are shielded by follow-through. A student who writes only 'reject ' with no df and no comparison risks losing 3 of the 4 marks; a student who shows the df formula, the comparison and a contextual conclusion keeps the method regardless of a slip.
How it all connects
The big idea sits in the middle — tap a linked idea to explore the link.
Tap a linked idea to see how it connects back to the main topic — that connection is what examiners reward.
Glossary
Try to recall each definition before you reveal it.
Quick check
Answer in your head first — then tap to check. No pressure.
Revision flashcards
Flip the card. Test yourself before the exam.
Null hypothesis
The default 'no effect' or 'no difference' claim, assumed true until the evidence overturns it. For independence: ': the two variables are independent'. For two means: ': '.
Key takeaways
Review these before you close the topic — retrieval beats re-reading.
- ✓
Null hypothesis (): the 'no effect / no association / no difference' claim, assumed true until the evidence overturns it.
- ✓
Alternative hypothesis (): the claim you are testing for. It may be two-tailed () or one-tailed ( or ).
- ✓
Significance level: the threshold for rejecting , chosen in advance, typically 0.05. It is also the risk of rejecting a true .
- ✓
Test statistic and p-value: the GDC returns the statistic ( or ) and the p-value, the strength of evidence against .
- ✓
Decision rule: reject if p-value significance level; otherwise do not reject . Then say what that means about the real situation.
Practice — then mark it
The whole point: a real Cambridge question, marked mark-by-mark.
Get a Paper 2 hypothesis test marked: state the hypotheses, quote the statistic and p-value, and conclude in context with full working
Get a Paper 2 hypothesis test marked: state the hypotheses, quote the statistic and p-value, and conclude in context with full working
Extra simulations & links
PhET, GeoGebra and other curated tools — open in a new tab.
Frequently asked
Checkpoint
One marked question is worth ten re-reads — close the loop before you move on.
Reading it isn’t knowing it — prove it.
Before you move on: do Get a Paper 2 hypothesis test marked: state the hypotheses, quote the statistic and p-value, and conclude in context with full working on paper, snap a photo, and get examiner-style feedback on exactly where you win and lose marks.