HL AI · Statistics and Probability

Chi-squared test and confidence intervals (IB Math AI HL)

Updated October 2026

Quick answer: For a χ² test for independence, the expected frequency in each cell is row total × column total ÷ grand total, the degrees of freedom are (rows − 1)(columns − 1), and you reject H₀ if the p-value is less than the significance level.

HL AI extends SL AI's chi-squared with confidence intervals for the population mean. Practise the t-distribution CDF on your GDC.

Practise Chi-squared test and confidence intervals with AI marking

Open the full HL AI engine — every question in this unit is worked through with instant AI-graded feedback on your handwritten workings.

Practise HL AI Statistics and Probability →

Key ideas

Worked example

200 students were asked whether they prefer tea or coffee. DP1: 40 tea, 60 coffee. DP2: 25 tea, 75 coffee. Test at the 5% level whether preference is independent of year group.

  1. H₀: preference is independent of year group. H₁: it is not.
  2. Expected: tea = 65 × 100 ÷ 200 = 32.5 for each year, coffee = 135 × 100 ÷ 200 = 67.5 for each year. All are above 5.
  3. df = (2 − 1)(2 − 1) = 1.
  4. GDC: χ²calc = 5.13 (3 s.f.) and p = 0.0235.
  5. 0.0235 < 0.05, so reject H₀: there is evidence that drink preference depends on year group.

Answer: χ² = 5.13, p = 0.0235: reject H₀ at the 5% level.

Exam-style HL AI questions on this topic

Key formulas for chi-squared test and confidence intervals

Chi-squared test statistic
χ²_calc = Σ ((fₒ − fₑ)²)/(fₑ)
Confidence interval for a mean (large n)
x̄ ± z^(*) · σ/(√n)

In the notation of the IB formula booklet. All HL AI formulas · see them used in worked examples

Try it now

1 of 5

  1. Question 1 of 5
  2. Question 2 of 5
  3. Question 3 of 5
  4. Question 4 of 5
  5. Question 5 of 5

5 quick questions on the chi-squared test. No sign-in needed.

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

Do it on your GDC

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

Maths IA ideas that use chi-squared test and confidence intervals

Related in Statistics and Probability

Revise Chi-squared test and confidence intervals for the exam

Stretch yourself: original probability problems at Senior level (ages 16 to 18), with hints and full solutions: Problem S104 · Problem S32 · Problem S105 · Problem S33. All 20 →

More on this topic

Sibling topic in other IB Maths courses

FAQ

How do you work out degrees of freedom for a chi-squared test?

For a test for independence, df = (rows − 1)(columns − 1), after combining any cells with expected frequencies below 5. For goodness of fit, df = categories − 1, minus one for each parameter you estimated from the data.

Where can I practise chi-squared test and confidence intervals questions?

On the Chi-Square Goodness of Fit, Independence and Error Types questions page: 20 exam-style HL AI questions with full mark schemes, plus free step-by-step worked examples.

Can I use my calculator for chi-squared test and confidence intervals?

Yes: a GDC is allowed on every HL AI paper, so practise the calculator method as well as the working. The t-tests and χ² tests and Confidence intervals guides give the keystrokes for the TI-84 Plus CE, TI-Nspire CX II and Casio fx-CG50.

What else is free here

Save your progress as you reviseA 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