# Hypothesis testing: chi-squared and t-tests

> IB Mathematics Applications and Interpretation SL · IB Math AI SL
> Source: https://www.owlsprep.com/study/ib-math-ai-sl-u4-hypothesis-testing-chi-squared-and/

We cover core workflows for 3 mandatory IB AI SL hypothesis tests: chi-squared goodness of fit, chi-squared independence, and one-sample t-tests, including hypothesis framing, GDC calculation, and mark-earning conclusion writing.

**Prerequisites:** [Descriptive statistics and basic probability distribution knowledge](https://www.owlsprep.com/study/ib-math-ai-sl-u4-probability-distributions/); [Basic familiarity with GDC statistical function menus](https://www.owlsprep.com/study/ib-math-ai-sl-u4-gdc-stat-tools/)

## Learning objectives

- Distinguish between chi-squared goodness of fit, chi-squared test for independence, and one-sample t-tests
- State valid null and alternative hypotheses for each test type aligned with IB requirements
- Calculate expected frequencies, degrees of freedom, and p-values using a GDC
- Draw statistically correct conclusions from test results at a specified significance level

## Core Hypothesis Testing Framework

All 3 tests follow the same 5-step standard workflow required for full marks in IB exams: 1) State H₀ and H₁, 2) Define the significance level α, 3) Calculate the test statistic and p-value via GDC, 4) Compare p-value to α, 5) Write a contextual conclusion.

**Significance Level** — The pre-defined threshold for rejecting the null hypothesis, most commonly 5% (0.05) for IB AI SL questions

*Notation:* \alpha

**Worked example:** A café owner claims average daily sales are \$1200. A staff member suspects the true average is lower. Write the null and alternative hypotheses for a t-test.

1. Define the population parameter first: μ = true average daily sales at the café
2. Write H₀ as the statement of no effect, matching the owner's claim:

   $$H_0: \mu = 1200$$
3. Write H₁ as the staff's directional suspicion:

   $$H_1: \mu < 1200$$

**Check your understanding**

1. What is the maximum standard significance level used in IB AI SL hypothesis tests?

   - 0.01
   - 0.05
   - 0.10
   - 0.20

   *Why:* 5% (0.05) is the default threshold specified in almost all IB AI SL assessment questions

## Chi-Squared Goodness of Fit Test

This test checks if an observed frequency distribution matches a specified theoretical model (e.g. uniform, binomial, normal). Expected frequencies are calculated by multiplying the total sample size by the theoretical probability for each category.

**Worked example:** A 6-sided die is rolled 60 times, with observed frequencies [7, 12, 11, 9, 10, 11]. Test at α=0.05 if the die is fair.

1. State hypotheses: H₀ = die is fair (each outcome has 1/6 probability), H₁ = die is not fair
2. Calculate expected frequencies: 60 * 1/6 = 10 for all 6 outcomes
3. Calculate degrees of freedom: 6 categories - 1 = 5
4. Run test on GDC to get χ² = 2.0, p-value = 0.849
5. Conclusion: 0.849 > 0.05, so there is insufficient evidence to reject H₀, the die can be assumed fair

> **DF Adjustment Rule**
>
> If you estimate parameters from sample data to build your theoretical distribution, subtract 1 extra degree of freedom for each estimated parameter

> **Exam tip:** IB exam markers award 1 mark for correctly stating the degrees of freedom, so always write this value explicitly before running your GDC calculation

## Chi-Squared Test for Independence

This test checks if two categorical variables are associated, using a contingency table of observed frequencies. Expected frequency for each cell = (row total * column total) / grand total.

**Worked example:** A survey tests if snack preference is independent of age group, with a 3-row (age group) x 4-column (snack type) contingency table. Calculate degrees of freedom for the test.

1. Identify number of rows r = 3, number of columns c = 4
2. Apply the independence test df formula:

   $$df = (r-1)(c-1) = (3-1)(4-1) = 2 * 3 = 6$$

> **Low Expected Frequency Rule**
>
> All expected frequencies must be ≥5. If any are smaller, merge adjacent categories and recalculate df for the new smaller table before running the test

## One-Sample t-Test for Population Mean

This test compares a sample mean to a hypothesized population mean, used when the population standard deviation is unknown and the data is approximately normally distributed. Degrees of freedom = sample size n - 1.

**Worked example:** Sample of 15 students has a mean test score of 72, sₙ₋₁ = 8. Test at α=0.05 if the population mean is different from 75.

1. State hypotheses: H₀: μ =75, H₁: μ ≠75 (two-tailed test)
2. Calculate t-statistic:

   $$t = \frac{72 -75}{8 / \sqrt{15}} \approx -1.452$$
3. df = 15 - 1 =14, GDC returns p-value = 0.168
4. Conclusion: 0.168 > 0.05, insufficient evidence to reject H₀

**Exam command terms**

- **Conclude** — You must link your p-value comparison back to the original context of the question, not just state 'reject H₀'

- **Show that the result is significant** — You must explicitly compare your calculated p-value to the given significance level to earn full marks

## Common pitfalls

- **Wrong:** Stating 'the null hypothesis is proven true' when p > α
  - Why it fails: You can never confirm the null hypothesis, only find insufficient evidence to reject it
  - Correct: Write 'there is insufficient evidence at the α significance level to reject the null hypothesis'
- **Wrong:** Using population standard deviation instead of sₙ₋₁ for t-test inputs
  - Why it fails: This produces an incorrect z-statistic instead of the required t-statistic, losing method marks
  - Correct: Always select the unbiased sample standard deviation sₙ₋₁ from your GDC menu
- **Wrong:** Forgetting to adjust degrees of freedom after merging categories with expected frequencies <5
  - Why it fails: Unadjusted df will return an invalid p-value that does not match IB mark scheme values
  - Correct: Recalculate df using the new smaller number of categories after merging
- **Wrong:** Using a one-tailed test for a t-test when no direction is specified in the question
  - Why it fails: IB AI SL defaults to two-tailed tests for unstated alternative hypotheses
  - Correct: Confirm the number of tails from the question prompt before running the test on your GDC
- **Wrong:** Mixing up goodness of fit and independence test df formulas
  - Why it fails: This is the most common mark-losing error for chi-squared questions
  - Correct: Write the df formula explicitly on your working page before calculating the value

## Cheatsheet

| Test Type | Primary Use Case | Degrees of Freedom Formula | Core GDC Inputs |
| --- | --- | --- | --- |
| Chi-squared Goodness of Fit | Match observed distribution to theoretical model | $k - 1 - m$ | Observed frequencies, theoretical probabilities |
| Chi-squared Independence | Test association between two categorical variables | $(r-1)(c-1)$ | Full contingency table of observed values |
| One-sample t-test | Compare sample mean to hypothesized population mean | $n-1$ | Sample data, hypothesized population mean |

## What's next

These three hypothesis tests make up ~15% of your total IB Math AI SL assessment marks, and appear on nearly every recent Paper 2. Next, you will practice scenario identification to select the correct test type for mixed question prompts, a skill that trips up 40% of candidates. You will also refine your GDC workflow to avoid common input errors, and practice writing full, mark-aligned conclusions that meet IB examiner standards. This foundation will also support your upcoming work on hypothesis testing for Pearson's correlation coefficient later in the unit.

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ib-math-ai-sl-u4-hypothesis-testing-chi-squared-and/
