In simple terms
A friendly intro before the formal notes — no formulas yet.
Observed vs. Expected: The Showdown
The χ²-test is a way to measure the 'surprise' level between what you actually see (observed data) and what you thought you'd see (expected data). If the surprise is big enough, you reject your initial theory.
Imagine a factory claims their bags of assorted chocolates contain 30% milk, 30% dark, and 40% white. You buy a bag, count the chocolates, and find a different distribution. The χ²-test is like a formal complaint process: it calculates a 'discrepancy score'. If the score is higher than a set threshold, you have statistical evidence to be sceptical of the factory's claim.
- 1
First, state your initial belief (the null hypothesis) and calculate the frequencies you'd expect to see if that belief were true.
- 2
Next, use the χ² formula, , to calculate a single test statistic that summarises the total difference between your observed (O) and expected (E) counts.
- 3
Then, determine the 'degrees of freedom' (a measure of how many values can vary) and look up the corresponding critical value in a table for your chosen significance level.
- 4
Finally, compare your calculated χ² statistic with the critical value. If your statistic is larger, you reject your initial belief; otherwise, you don't have enough evidence to reject it.
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.
Tap a symbol — great for exam definitions
Tap a symbol — great for exam definitions
Tap a symbol — great for exam definitions
Full topic notes
Formal explanation with the rigour you need for the exam.
The Chi-Squared (χ²) Distribution
The χ² distribution is a continuous probability distribution. It is a family of distributions, with each one being defined by a parameter called 'degrees of freedom' (ν). The shape of the χ² distribution is skewed to the right, especially for small values of ν. As ν increases, the distribution becomes more symmetrical and resembles a normal distribution. Since the test statistic involves squared differences, the value of χ² is always non-negative.
The χ² Goodness of Fit Test
This test is used to determine how well a sample of observed categorical data fits a specified theoretical distribution. The 'goodness of fit' is assessed by comparing the observed frequencies () in each category with the frequencies we would expect () if the data perfectly followed the theoretical model. A small total difference supports the model, while a large difference suggests the model is a poor fit.
The null hypothesis, , states that the data follows the specified distribution.
The alternative hypothesis, , states that the data does not follow the specified distribution.
The test is always one-tailed, as we are interested in whether the difference between O and E is significantly large. We therefore always look at the upper tail of the χ² distribution.
Calculating Degrees of Freedom (ν) for Goodness of Fit
The number of degrees of freedom is crucial for finding the correct critical value from the tables. It represents the number of independent pieces of information available to calculate the test statistic. The calculation depends on the number of 'restrictions' imposed on the data when calculating the expected frequencies.
There is always at least one restriction: the total of the expected frequencies must equal the total of the observed frequencies ($sum E_i = sum O_i$).
If you need to estimate a parameter of the distribution from the sample data, each estimated parameter counts as an additional restriction. For example, if you calculate the sample mean to use as the value of λ for a Poisson distribution, that is one extra restriction.
The χ² Test for Independence (Contingency Tables)
This test is used to determine whether there is a statistically significant association between two categorical variables. The data is presented in a two-way table called a contingency table. The test compares the observed frequencies in each cell of the table with the frequencies that would be expected if the two variables were independent.
The null hypothesis, , states that the two variables are independent (i.e., there is no association).
The alternative hypothesis, , states that the two variables are not independent (i.e., there is an association).
The logic is the same: if the calculated χ² statistic is large, it suggests the variables are not independent.
Calculations for Contingency Tables
This formula is derived from the probability rule for independent events: . If the variables are independent, the probability of being in a particular cell is the probability of being in that row multiplied by the probability of being in that column. We estimate these probabilities from the data as (Row Total / Grand Total) and (Column Total / Grand Total).
Worked examples
See the formulas applied — reveal one step at a time, like the exam.
A die was rolled 180 times with the following results:
| Score | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Frequency | 25 | 35 | 28 | 32 | 22 | 38 |
Test, at the 5% significance level, whether the die is fair.
- 1
Hypotheses
A survey of 200 sixth form students recorded their year group and preferred subject choice from a selection. The results are shown in the table. Test, at the 5% significance level, whether there is an association between a student's year group and their subject preference.
| Maths | History | Art | Total | |
|---|---|---|---|---|
| Year 12 | 45 | 25 | 20 | 90 |
| --- | --- | --- | --- | --- |
| Year 13 | 55 | 35 | 20 | 110 |
| Total | 100 | 60 | 40 | 200 |
- 1
Hypotheses
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.
What is the purpose of a χ²-test?
To compare observed categorical data with expected data to see if the difference is statistically significant. It tests the 'goodness of fit' of a model or the independence of two variables.
Key takeaways
Review these before you close the topic — retrieval beats re-reading.
- ✓
The null hypothesis, , states that the data follows the specified distribution.
- ✓
The alternative hypothesis, , states that the data does not follow the specified distribution.
- ✓
The test is always one-tailed, as we are interested in whether the difference between O and E is significantly large. We therefore always look at the upper tail of the χ² distribution.
Practice — then mark it
The whole point: a real Cambridge question, marked mark-by-mark.
Practice χ²-test Questions
Practice χ²-test Questions
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 Practice χ²-test Questions on paper, snap a photo, and get examiner-style feedback on exactly where you win and lose marks.