Skip to content
Cambridge AS & A Level9231

χ²-tests

Further Mathematics 9231 Chapter Notes

Last updated November 2026

ShareWhatsAppPost

χ²-tests notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full χ²-tests notes as text: skim, search, and jump between subtopics.

~18 min read

1. Expected frequencies from a hypothesis

A hypothesis fixes a distribution. The expected frequency of a class is the total frequency multiplied by the probability of that class.

For a continuous variable, the probability of a class is the integral of the density over the class, or a normal probability. If the question gives unbiased estimates of the mean and variance, use them as the parameters of the model.

The last class is open-ended, such as '7 or more'. Find its probability as 1 minus all the others. Then check that the total expected frequency equals the total observed frequency.

E = N × P(class)

sum E = sum O = N

Examiner insight

“A very common error was in dealing with the final column in the given table, corresponding to 7 or more breakages.” “Candidates are advised that they should always check that their total expected frequency is the same as the total observed frequency.”

Worked example 12 marks

A biologist believes that the masses of a particular species of frog are normally distributed. He randomly selects 120 frogs and records the mass, x, of each in grams. He calculates unbiased estimates of the mean and variance as 236.5 g and 134.56 g² respectively. The expected frequencies, calculated using the biologist's model, are in the table. Find the value of c and the value of d. Give your answers correct to two decimal places.

mass, x (g)observed frequencyexpected frequency
x < 21021.34
210 ≤ x < 22097.94
220 ≤ x < 2302025.22
230 ≤ x < 2403939.73
240 ≤ x < 2504031.11
250 ≤ x < 2608c
x ≥ 2602d
  1. 1

    model: X ∼ N(236.5, 11.6²), since √(134.56) = 11.6

  2. 2

    c = 120 × P(250 ≤ X < 260) = 12.10 [1]

  3. 3

    d = 120 × (1 - Phi(2.026)) = 2.57 [1]

2. The goodness of fit test

The null hypothesis H₀ says the distribution fits the data. The test statistic measures how far the observed frequencies O are from the expected frequencies E. A large value is evidence against H₀.

Each expected frequency must be at least 5. Combine neighbouring classes until it is, adding the observed frequencies in the same way.

Show every contribution to the statistic, and keep full accuracy until the end.

chi² = sum ((O - E)²)/E

chi² = sum O²/E - N

Examiner insight

“Many candidates added three columns together, and some candidates did not combine columns at all.” “This is a risky strategy: candidates should realise that a response with no working is only acceptable if the value of the test statistic is correct.”

Worked example 16 marks

A random sample of 200 observations of the continuous random variable X is summarised in the table. Carry out a goodness of fit test, at the 10% significance level, to test whether f is a satisfactory model for the data, where f(x) = 2/x³ for x ≥ 1 and f(x) = 0 otherwise. The expected frequencies are in the table.

intervalobservedexpected
1 ≤ x < 1.597111.11
1.5 ≤ x < 23538.89
2 ≤ x < 2.52318.00
2.5 ≤ x < 3159.78
3 ≤ x < 3.5105.89
3.5 ≤ x < 463.83
x ≥ 41412.50
  1. 1

    H₀: f is a good fit for the data. H₁: f is not a good fit for the data. [1]

  2. 2

    3.83 < 5, so combine the 5th and 6th classes: observed 10 + 6 = 16, expected 5.89 + 3.83 = 9.72 [1]

  3. 3

    chi² = ((97 - 111.11)²)/111.11 + ((35 - 38.89)²)/38.89 + ((23 - 18.00)²)/18.00 + ((15 - 9.78)²)/9.78 + ((16 - 9.72)²)/9.72 + ((14 - 12.50)²)/12.50 [1]

  4. 4

    = 1.792 + 0.389 + 1.389 + 2.786 + 4.057 + 0.180 = 10.6 [1]

  5. 5

    6 classes, so nu = 5 and the critical value is 9.236. 10.6 > 9.236, so reject H₀ [1]

  6. 6

    there is sufficient evidence to suggest that f is not a good fit for the data [1]

3. Degrees of freedom and the critical value

The number of degrees of freedom nu is counted after combining. For a goodness of fit test, take the number of classes, subtract 1, then subtract one for each parameter estimated from the data. For a contingency table, use the number of rows and columns left.

Read the critical value for nu at the stated significance level. If the statistic is greater, reject H₀. If it is less, do not reject H₀.

nu = (classes) - 1 - (parameters estimated)

nu = (r - 1)(c - 1)

Examiner insight

“Another common error was to use an incorrect tabular value when applying the test, usually coming from an extra degree of freedom.”

Worked example 13 marks

(a) A contingency table has 3 rows and 3 columns. No cells need combining. Find the number of degrees of freedom.

(b) Rows 2 and 3 are then combined. Find the number of degrees of freedom.

(c) A normal distribution, with its mean and variance estimated from the sample, is fitted to data. Five classes remain after combining. Find the number of degrees of freedom.

  1. 1

    (a) nu = (3 - 1)(3 - 1) = 4 [1]

  2. 2

    (b) 2 rows and 3 columns: nu = (2 - 1)(3 - 1) = 2 [1]

  3. 3

    (c) nu = 5 - 1 - 2 = 2 (two parameters estimated) [1]

4. Contingency tables

A contingency table sorts one sample by two features. H₀ says the two features are independent.

The expected frequency of a cell is its row total times its column total, divided by the grand total. Yates' correction is not required.

If an expected frequency is below 5, combine rows or columns until each cell is at least 5. Combine whole rows or whole columns.

E = (row total × column total)/(grand total)

Examiner insight

“The best responses gave the expected values and/or the individual contributions to the chi-squared value.” “Candidates are reminded of the rubric of this paper which states that all necessary working should be shown.”

Worked example 110 marks

Three bus companies, A, B and C, record whether each bus journey is on time, late or cancelled. A reliable bus service is one that is on time. The records from a random sample of buses for each company are in the table.

(a) Test at the 5% significance level whether the reliability of the service is independent of the bus company.

(b) Further evidence indicates that one company may be particularly unreliable compared with the other two companies. Use your calculations in(a) to suggest which company this is likely to be.

company Acompany Bcompany Ctotal
on time7222049
late14111237
cancelled46414
total253936100
  1. 1

    H₀: reliability of service is independent of bus company. H₁: reliability of service is not independent of bus company. [1]

  2. 2

    E = (49 × 25)/100 = 12.25, and so on for each cell [1]

  3. 3

    cancelled and company A has E = 3.50 < 5, so combine rows 2 and 3 (late and cancelled): E = 12.75, 19.89, 18.36 [1]

  4. 4

    chi² = ((7 - 12.25)²)/12.25 + ((22 - 19.11)²)/19.11 + ((20 - 17.64)²)/17.64 + ((18 - 12.75)²)/12.75 + ((17 - 19.89)²)/19.89 + ((16 - 18.36)²)/18.36 [1]

  5. 5

    = 2.25 + 0.437 + 0.316 + 2.162 + 0.420 + 0.303 = 5.888 [1]

  6. 6

    2 rows and 3 columns, so nu = 2 and the critical value is 5.991 [1]

  7. 7

    5.888 < 5.991, so do not reject H₀ [1]

  8. 8

    there is insufficient evidence to suggest that reliability of service is not independent of bus company [1]

  9. 9

    (b) company A [1]

  10. 10

    for company A the observed frequencies are higher than the expected frequencies for late and cancelled, but not for companies B and C [1]

5. Hypotheses and conclusions in context

Write both hypotheses in the words of the question. For a goodness of fit test, name the distribution and the data: the given normal distribution is a good model for the data. For a contingency table, name both features: size of shell is independent of beach location.

A test cannot prove anything. Write the conclusion with a level of uncertainty: there is insufficient evidence to suggest that the model is not a good fit. If H₀ is rejected, write that there is sufficient evidence to suggest the features are not independent.

Examiner insight

“It is expected that both the distribution and the data are mentioned in the hypotheses.” “A hypothesis test cannot be used to prove anything, only to provide some evidence to suggest an association.”

Worked example 17 marks

A biologist believes that the masses of a particular species of frog are normally distributed. The masses of 120 frogs are summarised in the table, with expected frequencies from his model (mean 236.5 g, variance 134.56 g²). Carry out a goodness of fit test at the 5% significance level to investigate whether a normal distribution is a suitable model for the data.

mass, x (g)observed frequencyexpected frequency
x < 21021.34
210 ≤ x < 22097.94
220 ≤ x < 2302025.22
230 ≤ x < 2403939.73
240 ≤ x < 2504031.11
250 ≤ x < 260812.10
x ≥ 26022.57
  1. 1

    H₀: a normal distribution is a satisfactory model for the masses of this species of frog. H₁: it is not. [1]

  2. 2

    1.34 < 5 and 2.57 < 5: combine the first two classes and the last two. Observed: 11, 20, 39, 40, 10. Expected: 9.28, 25.22, 39.73, 31.11, 14.67 [1]

  3. 3

    chi² = ((11 - 9.28)²)/9.28 + ((20 - 25.22)²)/25.22 + ((39 - 39.73)²)/39.73 + ((40 - 31.11)²)/31.11 + ((10 - 14.67)²)/14.67 [1]

  4. 4

    = 0.319 + 1.080 + 0.013 + 2.540 + 1.487 = 5.44 [1]

  5. 5

    5 classes, mean and variance estimated: nu = 5 - 1 - 2 = 2, critical value 5.991 [1]

  6. 6

    5.44 < 5.991, so do not reject H₀ [1]

  7. 7

    there is insufficient evidence to suggest that the masses of this species of frog are not normally distributed [1]

Recap

  • Expected frequency = total frequency × probability of the class. The totals of O and E must match.
  • The last class is open-ended: its probability is 1 minus all the others.
  • Combine classes (or rows, or columns) until every expected frequency is at least 5. Count nu after combining.
  • chi² = sum ((O - E)²)/E. Reject H₀ when the statistic is greater than the critical value.
  • Goodness of fit: nu = classes − 1 − parameters estimated. Contingency table: nu = (r - 1)(c - 1).
  • Contingency table: E = row total × column total ÷ grand total.
  • Write hypotheses in context. Never write that the test proves anything.

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. A die is rolled 120 times. The hypothesis is that it is fair. Find the expected frequency of each score.1 mark
    Answer
    1. 120 × 1/6 = 20.

    Trap: Writing the probability 1/6 instead of a frequency.

  2. A coin is tossed 3 times, and this is repeated 80 times. The number of heads is recorded each time. The hypothesis is that the number of heads is B(3, 0.5). Find the expected frequency for each number of heads.3 marks
    Answer
    1. P(0) = P(3) = 1/8 and P(1) = P(2) = 3/8.
    2. Expected frequencies: 10, 30, 30, 10.
    3. Check: the total is 80.

    Trap: Leaving out the binomial coefficient 3 gives 10, 10, 10, 10, which totals 40, not 80.

  3. A fully specified distribution gives expected frequencies 14.2, 9.6, 3.1, 2.4 and 10.7 for five classes in order. Combine classes so that every expected frequency is at least 5. Write down the new expected frequencies and the number of degrees of freedom.3 marks
    Answer
    1. 3.1 < 5 and 2.4 < 5, so combine them: 3.1 + 2.4 = 5.5.
    2. New expected frequencies: 14.2, 9.6, 5.5, 10.7.
    3. 4 classes and no parameters estimated: nu = 4 - 1 = 3.

    Trap: Counting nu from the original five classes gives 4, an extra degree of freedom.

  4. A four-sided spinner is spun 80 times. The scores 1, 2, 3 and 4 occur 14, 22, 24 and 20 times. Test, at the 5% significance level, whether the spinner is fair. The critical value for the test is 7.815.5 marks
    Answer
    1. H₀: the spinner is fair. H₁: the spinner is not fair. Each expected frequency is 80 ÷ 4 = 20 [1].
    2. chi² = ((-6)² + 2² + 4² + 0²)/20 = 56/20 = 2.8 [2].
    3. 2.8 < 7.815, so do not reject H₀ [1].
    4. There is insufficient evidence to suggest that the spinner is not fair [1].

    Trap: Concluding that the spinner is fair. The test only fails to find evidence that it is not.

  5. 100 students are asked how they travel to school. Of the 40 students in Year 10, 20 walk and 20 take the bus. Of the 60 students in Year 11, 10 walk and 50 take the bus. In a test of whether travel to school is independent of year group, find the expected frequency for each cell and the number of degrees of freedom.3 marks
    Answer
    1. Expected: (40 × 30)/100 = 12, (40 × 70)/100 = 28, (60 × 30)/100 = 18, (60 × 70)/100 = 42 [2].
    2. nu = (2 - 1)(2 - 1) = 1 [1].

    Trap: Forgetting to divide by the grand total gives expected frequencies of 1200, 2800 and so on.

  6. A test of whether choice of sport is independent of gender gives a test statistic of 2.1. The critical value at the 5% significance level is 5.991. Write the hypotheses and the conclusion of the test in context.4 marks
    Answer
    1. H₀: choice of sport is independent of gender. H₁: choice of sport is not independent of gender [1].
    2. 2.1 < 5.991, so do not reject H₀ [1].
    3. There is insufficient evidence to suggest that choice of sport is not independent of gender [2].

    Trap: Writing ‘independent’ and ‘not independent’ with no context, or ‘this proves they are independent’.

  7. The number of calls to a help desk in an hour is modelled by a Poisson distribution with mean 2. Over 100 hours, 0, 1, 2, 3 and 4 or more calls occurred 17, 24, 28, 17 and 14 times. Test, at the 5% significance level, whether the model is suitable. The critical value for 4 degrees of freedom is 9.488.8 marks
    Answer
    1. P(0) = e⁻² = 0.1353, P(1) = 0.2707, P(2) = 0.2707, P(3) = 0.1804.
    2. P(4 or more) = 1 - 0.8571 = 0.1429.
    3. Expected: 13.53, 27.07, 27.07, 18.04, 14.29, all at least 5, total 100 [3].
    4. chi² = 0.888 + 0.347 + 0.032 + 0.061 + 0.006 = 1.33 [2].
    5. 5 classes and the mean is given: nu = 4. 1.33 < 9.488, so do not reject H₀ [2].
    6. There is insufficient evidence to suggest that the Poisson model is not suitable [1].

    Trap: Using P(X = 4) = 0.0902 for the last class gives expected frequencies that total 95, not 100.

  8. A Poisson distribution, with its mean estimated from the sample, is fitted to some data. Four classes remain after combining. The test statistic is 6.2. At the 5% significance level, the critical values are 5.991 for 2 degrees of freedom and 7.815 for 3 degrees of freedom. State the conclusion of the test.4 marks
    Answer
    1. One parameter is estimated: nu = 4 - 1 - 1 = 2 [1].
    2. The critical value is 5.991 [1].
    3. 6.2 > 5.991, so reject H₀ [1].
    4. There is sufficient evidence to suggest that the Poisson distribution is not a good model for the data [1].

    Trap: Ignoring the estimated mean gives nu = 3 and 7.815, which reverses the conclusion.

  9. A factory runs three shifts. A random sample of 200 products is inspected and graded as no fault, minor fault or major fault. Test, at the 5% significance level, whether the grade of a product is independent of the shift that made it. At the 5% level, the critical values are 5.991 for 2 degrees of freedom and 9.488 for 4 degrees of freedom. | | shift 1 | shift 2 | shift 3 | total | | --- | --- | --- | --- | --- | | no fault | 45 | 55 | 30 | 130 | | minor fault | 12 | 20 | 23 | 55 | | major fault | 3 | 5 | 7 | 15 | | total | 60 | 80 | 60 | 200 |10 marks
    Answer
    1. H₀: grade of product is independent of shift. H₁: grade of product is not independent of shift [1].
    2. Expected for major fault: (15 × 60)/200 = 4.5, 6, 4.5. Expected for minor fault: 16.5, 22, 16.5. Expected for no fault: 39, 52, 39 [2].
    3. 4.5 < 5, so combine the minor and major fault rows [1]. Expected: 21, 28, 21. Observed: 15, 25, 30.
    4. chi² = ((45 - 39)²)/39 + ((55 - 52)²)/52 + ((30 - 39)²)/39 + ((15 - 21)²)/21 + ((25 - 28)²)/28 + ((30 - 21)²)/21 [1].
    5. = 0.923 + 0.173 + 2.077 + 1.714 + 0.321 + 3.857 = 9.07 [1].
    6. nu = (2 - 1)(3 - 1) = 2 [1]. The 5% critical value is 5.991 [1].
    7. 9.07 > 5.991, so reject H₀ [1]. There is sufficient evidence to suggest that grade of product is not independent of shift [1].

    Trap: Not combining gives nu = 4 and chi² = 9.20 < 9.488, which reverses the conclusion.

  10. The distance, x km, of each of 64 deliveries from a depot is recorded. It is claimed that X has probability density function f(x) = kx for 0 ≤ x ≤ 4, and 0 otherwise, where k is a constant. The distances fall in the intervals 0 ≤ x < 1, 1 ≤ x < 2, 2 ≤ x < 3 and 3 ≤ x ≤ 4 with frequencies 3, 15, 18 and 28. Find k, then test the claim at the 5% significance level. The critical value for 2 degrees of freedom is 5.991.10 marks
    Answer
    1. int₀⁴ kx dx = 8k = 1, so k = 1/8 [1].
    2. P(a ≤ X < b) = int_a^(b) x/8 dx = (b² - a²)/16 [1].
    3. Probabilities: 1/16, 3/16, 5/16, 7/16. Expected: 4, 12, 20, 28 [2].
    4. 4 < 5, so combine the first two classes: observed 18, expected 16. Classes: (18, 16), (18, 20), (28, 28) [1].
    5. chi² = 2²/16 + ((-2)²)/20 + 0 = 0.25 + 0.2 = 0.45 [2].
    6. 3 classes, and k comes from the total probability, not from the data: nu = 3 - 1 = 2. 0.45 < 5.991, so do not reject H₀ [2].
    7. There is insufficient evidence to suggest that f is not a good model for the data [1].

    Trap: Leaving the first class uncombined although its expected frequency is 4, as many candidates did with small classes, which gives 4 classes and nu = 3.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
‘it is a good fit model’ or ‘the distribution is a good fit’the given distribution is a good model for the data
‘independent’ and ‘not independent’, with no contextsize of shell is independent of beach location
The evidence proves that the shell size is dependent on the beach location.There is sufficient evidence to suggest that shell size is not independent of beach location.
‘f is a good fit’ as the conclusion of the testthere is insufficient evidence to suggest that f is not a good fit

Frequently asked questions

How do I find expected frequencies for a goodness of fit test?
The expected frequency of a class is the total frequency multiplied by the probability of that class. For a continuous variable, the probability of a class can be a normal probability. The last class, such as 7 or more, takes 1 minus all the other probabilities. Check that the total expected frequency equals the total observed frequency.
What do I do when an expected frequency is less than 5 in a chi-squared test?
Each expected frequency must be at least 5. Combine neighbouring classes until it is, adding the observed frequencies in the same way. Count the degrees of freedom after combining. In a contingency table, combine whole rows or whole columns.
How do I find the degrees of freedom for a chi-squared goodness of fit test?
Take the number of classes, subtract 1, then subtract one for each parameter estimated from the data. For example, a normal distribution with its mean and variance estimated from the sample, and five classes remaining, has 2 degrees of freedom. For a contingency table use nu = (r - 1)(c - 1).
How do I write the hypotheses for a goodness of fit test?
Name both the distribution and the data. For example, H₀: a normal distribution is a satisfactory model for the masses of this species of frog, and H₁: it is not. Write the conclusion as insufficient evidence to suggest the model is not a good fit. A test cannot prove anything.
How do I calculate expected frequencies in a contingency table?
The expected frequency of a cell is its row total times its column total, divided by the grand total. Yates' correction is not required. For example, with a grand total of 100, a row total of 49 and a column total of 25, the expected frequency is 12.25.
What is the common mistake when concluding a chi-squared test of independence?
The evidence proves that the shell size is dependent on the beach location. A test cannot prove anything. Write that there is sufficient evidence to suggest that shell size is not independent of beach location, in context.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters