Home › IB Maths AI SL › Questions by topic › Chi-Squared Tests

IB Maths AI SL · Unit 4: Statistics and Probability

Chi-Squared Tests (IB Maths AI SL): notes, exam questions and worked examples

Updated October 2026 · By Pete Bromfield

A χ2 test compares observed frequencies with the frequencies you would expect if the null hypothesis were true. Use the test for independence on a contingency table and the goodness of fit test for one list of frequencies. Find the p-value on your GDC: if it is less than the significance level, reject H0, and write the conclusion in context.

Practise chi-squared tests questions →

Free account: 5 more practice questions on chi-squared tests with instant feedback, and full worked answers on the free questions. Free, no card. Join free →

Try it first

1 of 8

  1. Question 1 of 8
  2. Question 2 of 8
  3. Question 3 of 8
  4. Question 4 of 8
  5. Question 5 of 8
  6. Question 6 of 8
  7. Question 7 of 8
  8. Question 8 of 8

Start with one question on the chi-squared test. Stuck? Take a hint. No sign-in needed.

A χ2 test for independence uses a contingency table with 3 rows and 4 columns. How many degrees of freedom are there?
Choose your answer · keys 1–4

Chi-Squared Tests notes

Hypotheses

For independence, H0: the two variables are independent; H1: they are not independent. For goodness of fit, H0: the data follow the stated distribution (for example, uniform). Write them in the words of the question.

Expected frequencies

For a contingency table, expected = row total×column totalgrand total. With row total 69, column total 67 and grand total 150, the expected frequency is 30.82. For a uniform goodness of fit test, every expected frequency is the total divided by the number of categories. In exams every expected frequency will be greater than 5. If one is 5 or less (for example in your IA), the test is less reliable: combine categories so that each expected frequency is greater than 5.

Degrees of freedom

Independence: (r−1)(c−1) for r rows and c columns, so a 3 by 4 table has 6. Goodness of fit: number of categories minus 1.

The test statistic and the decision

χcalc2=∑(fo−fe)2fe is in the booklet, but the GDC computes it with the p-value. Reject H0 if the p-value is less than the significance level (or if χcalc2 is greater than the critical value). Otherwise there is not enough evidence to reject H0.

Writing the conclusion

Give the comparison and the meaning: "0.0736>0.05, so do not reject H0: there is insufficient evidence that meal choice depends on age group." Never say the test proves H0. The two-sample t-test compares means instead.

Key formulas

χ2 statistic In the booklet
χcalc2=∑(fo−fe)2fe
Expected frequency (independence) Learn it
fe=row total×column totalgrand total
Degrees of freedom Learn it
independence: (r−1)(c−1);goodness of fit: classes−1
Test decision: reject H0 if p-value < significance level (or χcalc2> critical value) Learn it

The IB formula booklet is provided in every exam paper. In the booklet = printed there, so know where to find it; Learn it = not in the booklet, so learn it by heart. All AI SL formulas →

Chi-Squared Tests worked examples

Worked example 1: Chi-squared expected frequency · easy

150 diners rate meals. 69 are Children; 67 ordered Shrimp. Under H0, find the expected frequency of Children who ordered Shrimp.

Solution

5 steps · 1 to fill in
Examiner tip: Never round expected frequencies during working — keep exact decimals so the final χ2 statistic stays accurate.

Worked example 2: Chi-squared conclusion at 5% · medium

χ2 test at 5% gives χcalc2=8.54, p=0.0736. State H0 and write the conclusion.

Solution

5 steps · 1 to fill in
Examiner tip: "Accept H1" is poor mathematical phrasing. Always say "Reject H0" or "Do not reject H0".

Worked example 3: Chi-squared goodness of fit · hard

147 calls tracked over 7 days: 22,18,17,25,25,19,21. Test if calls are uniform. State df and find p using a GDC.

Solution

5 steps
Examiner tip: GOF tests don't give you a contingency table — you must build the expected frequency list from the stated model (uniform, binomial, normal, etc.).

Chi-Squared Tests exam-style questions

3 questions from our AI SL bank, written in the style of IB papers, easiest first. One has its full worked solution open here. Open the worked answer, or check your answer in the practice area.

Question 1 · easy · 3 marks · Paper 1

Abhinav carries out a χ2 test for independence at the 1% significance level to determine whether a person’s gender is associated with their chosen professional field: Engineering, Medicine, or Law.

  1. State the null hypothesis, H0, for this test.

  2. State the alternative hypothesis, H1, for this test.

Question 2 · medium · 4 marks · Paper 2

A χ2 test of independence is performed on a contingency table with 3 rows and 3 columns at the 5% significance level. The calculated χ2 value is 9.45, and the software outputs a p-value of 0.0508.

  1. Calculate the number of degrees of freedom.
  2. State, with a reason, whether the null hypothesis should be rejected.

Full worked solution Free, no sign-in

  1. df=(r−1)(c−1)=(3−1)(3−1) (M1)
    =4 A1
  2. Since p=0.0508>0.05 (significance level), R1
    we do not reject the null hypothesis. There is insufficient evidence of dependence. A1

Every question here has a full worked solution. See them all →

Question 3 · hard · 3 marks · Paper 1

A χ2 test for independence is conducted on a contingency table that has 3 rows and 4 columns.

  1. Calculate the number of degrees of freedom for this test.
  2. If the significance level is 5% and the critical value is 12.59, state the condition under which the null hypothesis would be rejected using the test statistic χcalc2.

Free account — sign in to download Topic PDF: 7 questions with worked answers · 5 pages · 157 KB

All 30 chi-squared tests questions →

Where students lose marks on chi-squared tests

Examiner's noteχ² and t-tests: hypotheses, the comparison and the conclusion in context

Where marks are lost: Recurring in every session: hypotheses that leave out the variables or the population means, "dependent" instead of "not independent", a two-tailed alternative for a one-tailed test, the pooled/unpooled setting mixed up, a p-value misread from E-notation (so greater than 1) or given to 1 s.f., no comparison with the significance level (which loses the mark), a correct comparison followed by the wrong decision, and a generic conclusion where one in context was asked for. Expected frequencies were also left at the wrong accuracy.

What examiners look for: Use a fixed layout: H₀ and H₁ in symbols with the population parameter (μ₁ = μ₂; μ₁ > μ₂) or in words naming both variables for χ²; the p-value; "p < 0.05, so reject H₀" (or not); then one sentence in context.

Examiners flagged this in 3 exam series (May 2024, November 2024, November 2025). Summarised in our own words from IB subject reports, IB Programme Resource Centre. Read the full note →

Chi-Squared Tests on your calculator

A GDC is allowed on every AI paper. Keystrokes for the Casio fx-CG50, TI-84 Plus CE and TI-Nspire, with a checked worked example:

Chi-Squared Tests FAQ

How do I calculate degrees of freedom for a chi-squared test?

For a test for independence, (rows − 1) × (columns − 1). For a goodness of fit test, the number of categories minus 1.

Do I reject H0 if the p-value is less than 0.05?

At the 5% significance level, yes: a p-value below 0.05 means reject H0. If it is above, there is not enough evidence to reject H0. Always finish with a sentence in the context of the question.

How many IB Maths AI SL statistical testing questions are there?

There are 30 exam-style statistical testing questions in the AI SL question bank (Paper 1: 15 · Paper 2: 15), graded 9 easy, 9 medium, 8 hard, 4 very hard. Every question has a full IB-style mark scheme (M, A and R marks).

Is statistical testing on Paper 1 or Paper 2?

Both. In the bank, Paper 1: 15 · Paper 2: 15. Practise with your GDC — AI papers expect calculator methods throughout.

Next steps

More AI SL Unit 4: Correlation & Regression · Descriptive Statistics · Probability · Normal & Binomial Distributions · Sampling Techniques · Venn Diagrams & Hard Probability

Teaching this topic? Free ready-to-teach lessons (slides and teacher notes): Chi-squared test for independence · Chi-squared goodness-of-fit test.

Keep revising AI SL: AI SL revision notes · IB Maths AI SL past papers · AI SL common exam mistakes · AI SL syllabus checklist · AI SL statistics and probability knowledge organiser

What else is free here

Save your answers and track your progressA free account remembers the questions you have done on every topic and brings you back to this page.

Join free

Already have an account? Sign in

← All IB Maths AI SL topics