A 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 -value on your GDC: if it is less than the significance level, reject , and write the conclusion in context.
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 →
For independence, : the two variables are independent; : they are not independent. For goodness of fit, : the data follow the stated distribution (for example, uniform). Write them in the words of the question.
Expected frequencies
For a contingency table, expected = . With row total 69, column total 67 and grand total 150, the expected frequency is . 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: for rows and columns, so a 3 by 4 table has . Goodness of fit: number of categories minus 1.
The test statistic and the decision
is in the booklet, but the GDC computes it with the -value. Reject if the -value is less than the significance level (or if is greater than the critical value). Otherwise there is not enough evidence to reject .
Writing the conclusion
Give the comparison and the meaning: ", so do not reject : there is insufficient evidence that meal choice depends on age group." Never say the test proves . The two-sample t-test compares means instead.
Key formulas
statistic In the booklet
Expected frequency (independence) Learn it
Degrees of freedom Learn it
Test decision: reject if -value significance level (or 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
diners rate meals. are Children; ordered Shrimp. Under , find the expected frequency of Children who ordered Shrimp.
Solution
1. Formula: .
2. Identify: Row , Column , Grand .
3. Substitute: .
4. Numerator: .
5. Evaluate: .
4. Numerator: .
5 steps · 1 to fill in
Examiner tip: Never round expected frequencies during working — keep exact decimals so the final statistic stays accurate.
Worked example 2: Chi-squared conclusion at 5% · medium
test at gives , . State and write the conclusion.
Solution
1. : the two variables are independent (no association).
2. Extract: .
3. Compare: .
4. Decision: do not reject .
5. Context: insufficient evidence to suggest the variables are dependent.
2. Extract: .
5 steps · 1 to fill in
Examiner tip: "Accept " is poor mathematical phrasing. Always say "Reject " or "Do not reject ".
Worked example 3: Chi-squared goodness of fit · hard
calls tracked over 7 days: . Test if calls are uniform. State df and find using a GDC.
Solution
1. df: .
2. Expected: uniform per day.
3. Enter: observed and expected .
4. Execute: GOF with df .
5. Read: .
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 test for independence at the significance level to determine whether a person’s gender is associated with their chosen professional field: Engineering, Medicine, or Law.
State the null hypothesis, , for this test.
State the alternative hypothesis, , for this test.
A test of independence is performed on a contingency table with 3 rows and 3 columns at the significance level. The calculated value is , and the software outputs a -value of .
Calculate the number of degrees of freedom.
State, with a reason, whether the null hypothesis should be rejected.
Full worked solution Free, no sign-in
(M1) A1
Since (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 test for independence is conducted on a contingency table that has 3 rows and 4 columns.
Calculate the number of degrees of freedom for this test.
If the significance level is and the critical value is , state the condition under which the null hypothesis would be rejected using the test statistic .
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:
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.