Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›IB Mathematics: Applications and Interpretation
  3. ›4 Statistics and probability
  4. ›4.11 Chi-squared and t-tests

IB Mathematics: Applications and Interpretation · Topic 4 · Statistics and probability

4.11 Chi-squared and t-tests

Describe the purpose of chi-squared and t-tests, carry out each test with technology, and interpret p-values and conclusions in context.

  • 5 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5Hypothesis tests judge whether a pattern could be chance
  1. 1Hypothesis tests judge whether a pattern could be chance
  2. 2A chi-squared test compares observed counts with expected counts
  3. 3Technology carries out the chi-squared test from a table
  4. 4A t-test compares the means of two groups
  5. 5A small p-value is evidence against the null hypothesis
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: Hypothesis tests judge whether a pattern could be chance

A school survey finds that more Year 13 students cycle than Year 12 students. Samples vary, so a difference in a sample may be due to chance. A hypothesis test decides whether the evidence is strong enough to rule chance out.

The null hypothesis, H0H_0H0​, states that there is no difference or no association. The alternative hypothesis, H1H_1H1​, states that there is one. The p-value measures how surprising the data would be if H0H_0H0​ were true.

We compare the p-value with a significance level, usually 5%. A chi-squared test looks for association between categories. A t-test compares the means of two groups.

Key terms · tap one for its definition

null hypothesis

The null hypothesis H0H_0H0​ is the default statement of no difference or no association, which a test looks for evidence against.

p-value

The p-value is the probability of obtaining results at least as extreme as those observed, assuming the null hypothesis is true.

significance level

The significance level is the chosen threshold, often 5%, below which a p-value leads us to reject the null hypothesis.

Part 1 done

2

Part 2 of 5: A chi-squared test compares observed counts with expected counts

Start with counts of people in categories. A contingency table shows these observed counts for two categorical variables. The test asks whether the variables are independent.

If the variables were independent, each cell would have an expected frequency. This is found from the totals in the table.

The hypotheses are H0H_0H0​: the variables are independent, and H1H_1H1​: they are associated. The test statistic is χ2=∑(O−E)2E\chi^2=\sum\frac{(O-E)^2}{E}χ2=∑E(O−E)2​ where OOO is an observed count and EEE an expected count.

The degrees of freedom are (r−1)(c−1)(r-1)(c-1)(r−1)(c−1) for a table with rrr rows and ccc columns. Technology uses this number to find the p-value.

Key terms · tap one for its definition

contingency table

A contingency table is a table of observed counts for two categorical variables, with a row or column for each category.

expected frequency

An expected frequency is the count a cell would have if the variables were independent, equal to row total×column totalgrand total\frac{\text{row total}\times\text{column total}}{\text{grand total}}grand totalrow total×column total​.

degrees of freedom

The degrees of freedom of a chi-squared test is the number of counts free to vary, given by (r−1)(c−1)(r-1)(c-1)(r−1)(c−1) for rrr rows and ccc columns.

Part 2 done

Quick check

One question on the part you just read

Easy

Identify the test used to decide whether two categorical variables are independent.
Show answer and explanation

Answer: A · Worked explanation

A chi-squared test for independence compares observed counts in a contingency table with the counts expected under independence. A t-test compares means of numerical data. The other options are probability calculations, not hypothesis tests.
3

Part 3 of 5: Technology carries out the chi-squared test from a table

Now apply the test to real data. A school records how students travel. We test at the 5% significance level whether transport choice is independent of year group.

Enter the observed counts as a matrix on the calculator. It returns χ2\chi^2χ2, the degrees of freedom, the p-value and the matrix of expected counts. Check those expected counts before trusting the result.

Observed travel counts

BusCarTotal
Year 12302050
Year 13203050
Total5050100
Year 12
Bus
30
Car
20
Total
50
Year 13
Bus
20
Car
30
Total
50
Total
Bus
50
Car
50
Total
100

Worked example

Transport and year group

Use the table of observed counts to test whether transport choice is independent of year group at the 5% level.
  1. 1
    H0H_0H0​: transport and year group are independent. H1H_1H1​: they are associated.
  2. 2
    Expected frequency for each cell: E=50×50100=25E=\frac{50\times 50}{100}=25E=10050×50​=25.
  3. 3
    χ2=4×(5)225=4\chi^2=4\times\frac{(5)^2}{25}=4χ2=4×25(5)2​=4, and (2−1)(2−1)=1(2-1)(2-1)=1(2−1)(2−1)=1 degree of freedom.
  4. 4
    Technology gives p≈0.0455p\approx 0.0455p≈0.0455.
  5. 5
    Compare: 0.0455<0.050.0455<0.050.0455<0.05.

Answer: Reject H0H_0H0​. There is evidence of an association between year group and transport choice.

Exam tip

Check that every expected frequency is at least 5. If one is smaller, the test is unreliable, so combine categories or gather more data.

Part 3 done

4

Part 4 of 5: A t-test compares the means of two groups

Now suppose the data are measurements rather than counts. A t-test compares the mean of one group with the mean of another. It assumes that both groups are independent and roughly normal, with similar spread.

Here H0H_0H0​ states that the two population means are equal. Enter each data set into technology and choose the two-sample test with pooled variance. The output gives ttt, the degrees of freedom and the p-value.

Worked example

Fertiliser and plant height

Heights in cm after four weeks: fertiliser X gives 14, 16, 15, 18, 17. Fertiliser Y gives 19, 21, 18, 20, 22. Test at the 5% level whether the mean heights differ.
  1. 1
    H0H_0H0​: the means are equal. H1H_1H1​: the means differ.
  2. 2
    The sample means are 16 cm for X and 20 cm for Y.
  3. 3
    Technology gives t=4.00t=4.00t=4.00 in magnitude, with 8 degrees of freedom.
  4. 4
    The p-value is p≈0.0039p\approx 0.0039p≈0.0039, and 0.0039<0.050.0039<0.050.0039<0.05.

Answer: Reject H0H_0H0​. There is evidence that the mean height is greater with fertiliser Y.

Write the sample means before the conclusion. Then say which group has the higher mean, since a significant result alone does not say which.

Key term

t-test

A t-test is a hypothesis test that compares the means of two groups of numerical data, assuming both come from normal populations.

Part 4 done

Quick check

One question on the part you just read

Easy

Determine the degrees of freedom for a contingency table with 3 rows and 4 columns.
Show answer and explanation

Answer: A · Worked explanation

Use (r−1)(c−1)=2×3=6(r-1)(c-1)=2\times 3=6(r−1)(c−1)=2×3=6. The value 12 multiplies the numbers of rows and columns without subtracting 1. The value 7 comes from adding the dimensions.
5

Part 5 of 5: A small p-value is evidence against the null hypothesis

The decision rule is the same for both tests. If the p-value is less than the significance level, reject H0H_0H0​. If it is greater, do not reject H0H_0H0​. Choose the significance level before looking at the p-value. Always finish with a sentence in context.

Comparing the two tests

FeatureChi-squared testt-test
Data typeCounts in categoriesNumerical measurements
ComparesObserved and expected countsTwo group means
H0H_0H0​ statesVariables are independentThe means are equal
Feature
Data type
Chi-squared test
Counts in categories
t-test
Numerical measurements
Feature
Compares
Chi-squared test
Observed and expected counts
t-test
Two group means
Feature
H0H_0H0​ states
Chi-squared test
Variables are independent
t-test
The means are equal

Common mistake

Do not write that we accept H0H_0H0​ or prove it true. A large p-value shows only that the evidence is not strong enough to reject H0H_0H0​.

The p-value is not the probability that H0H_0H0​ is true. It is the probability of results at least as extreme as ours if H0H_0H0​ is true.

Note read

Check your recall[14 marks]

6 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.State[2 marks]

    State the null and alternative hypotheses for a chi-squared test for independence.

    Show mark schemeHide mark scheme

    Model answer

    H0H_0H0​: the two variables are independent. H1H_1H1​: the two variables are associated.

    • 1 mark for stating the null hypothesis as independence
    • 1 mark for stating the alternative hypothesis as association
  2. 2.Calculate[2 marks]

    A contingency table has a row total of 60, a column total of 40 and a grand total of 200. Calculate the expected frequency of the cell where they meet.

    Show mark schemeHide mark scheme

    Model answer

    E=60×40200=12E=\frac{60\times 40}{200}=12E=20060×40​=12.

    • 1 mark for using row total times column total divided by grand total
    • 1 mark for obtaining 12
  3. 3.Determine[2 marks]

    Determine the degrees of freedom for a chi-squared test on a table with 3 rows and 4 columns.

    Show mark schemeHide mark scheme

    Model answer

    (3−1)(4−1)=2×3=6(3-1)(4-1)=2\times 3=6(3−1)(4−1)=2×3=6.

    • 1 mark for using (r−1)(c−1)(r-1)(c-1)(r−1)(c−1)
    • 1 mark for obtaining 6
  4. 4.Deduce[3 marks]

    A chi-squared test for independence between gender and choice of club gives p=0.03p=0.03p=0.03. Deduce the conclusion at the 5% significance level, in context.

    Show mark schemeHide mark scheme

    Model answer

    Since 0.03 is less than 0.05, reject the null hypothesis. There is evidence of an association between gender and choice of club.

    • 1 mark for comparing 0.03 with 0.05
    • 1 mark for rejecting the null hypothesis
    • 1 mark for concluding in context that gender and club choice are associated
  5. 5.Distinguish[3 marks]

    Distinguish between the purposes of a chi-squared test for independence and a t-test.

    Show mark schemeHide mark scheme

    Model answer

    A chi-squared test for independence uses counts in categories to test for association between two categorical variables. A t-test uses numerical data to compare the means of two groups.

    • 1 mark for stating that a chi-squared test uses categorical counts
    • 1 mark for stating that it tests for association or independence
    • 1 mark for stating that a t-test compares the means of two groups
  6. 6.Explain[2 marks]

    Explain why a large p-value should lead to the conclusion “do not reject H0H_0H0​” rather than “accept H0H_0H0​”.

    Show mark schemeHide mark scheme

    Model answer

    A large p-value shows only that the data are consistent with the null hypothesis. It does not prove that the null hypothesis is true.

    • 1 mark for stating that a large p-value shows the evidence is not strong enough against H0H_0H0​
    • 1 mark for stating that this does not prove H0H_0H0​ true

Practice this topic

10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)

0 right0 of 10 answered

Includes the 2 quick checks in the note above.

3.

Easy·Identify[1 mark]

Identify the correct meaning of a p-value.
Show answer and explanation

Answer: A · Worked explanation

A p-value is calculated by assuming the null hypothesis is true. It is not the probability that the null hypothesis itself is true. The significance level is chosen in advance, while the p-value comes from the data.
4.

Medium·Calculate[1 mark]

A table has a row total of 45, a column total of 80 and a grand total of 200. Calculate the expected frequency of that cell.
Show answer and explanation

Answer: A · Worked explanation

E=45×80200=3600200=18E=\frac{45\times 80}{200}=\frac{3600}{200}=18E=20045×80​=2003600​=18. The value 62.5 averages the two totals. The value 36 divides by 100 instead of the grand total.
5.

Medium·Deduce[1 mark]

A chi-squared test for independence between two variables gives p=0.03p=0.03p=0.03. Deduce the correct conclusion at the 5% significance level.
Show answer and explanation

Answer: A · Worked explanation

Since 0.03 is less than 0.05, the null hypothesis is rejected. The null hypothesis states independence, so rejecting it gives evidence of association. Not rejecting would be correct only if the p-value were above 0.05.
6.

Medium·Calculate[1 mark]

In a chi-squared test, a cell has observed count 18 and expected count 12. Calculate its contribution (O−E)2E\frac{(O-E)^2}{E}E(O−E)2​.
Show answer and explanation

Answer: A · Worked explanation

(18−12)212=3612=3\frac{(18-12)^2}{12}=\frac{36}{12}=312(18−12)2​=1236​=3. The value 0.5 forgets to square the difference. The value 6 is the difference itself, and 1.5 halves the correct value.
7.

Medium·Deduce[2 marks]

A t-test comparing two group means gives p=0.12p=0.12p=0.12. Deduce the conclusion at the 5% significance level.
Show answer and explanation

Answer: A · Worked explanation

Since 0.12 is greater than 0.05, we do not reject the null hypothesis. This does not prove the means are equal. It shows only that the data do not give strong enough evidence of a difference.
8.

Hard·Calculate[2 marks]

A 2 by 2 table has observed counts 18 and 12 in the first row and 22 and 48 in the second row. Calculate χ2\chi^2χ2.
Show answer and explanation

Answer: A · Worked explanation

The row totals are 30 and 70, and the column totals are 40 and 60. The expected counts are 12, 18, 28 and 42, so χ2=3+2+1.29+0.86≈7.14\chi^2=3+2+1.29+0.86\approx 7.14χ2=3+2+1.29+0.86≈7.14. The value 1.19 forgets to square each difference, and 144 forgets to divide by EEE.
9.

Hard·Deduce[2 marks]

A t-test gives p=0.022p=0.022p=0.022. Deduce the correct conclusion at the 1% significance level.
Show answer and explanation

Answer: A · Worked explanation

The comparison must use the stated level of 0.01. Since 0.022 is greater than 0.01, we do not reject the null hypothesis. Comparing with 0.05 would use the wrong level and give a different decision.
10.

Hard·Identify[2 marks]

A chi-squared test on a 2 by 2 table has one expected frequency of 3. Identify the best response.
Show answer and explanation

Answer: A · Worked explanation

An expected frequency below 5 makes the chi-squared test unreliable. A small expected value does not by itself give evidence against the null hypothesis. The remedy is to combine categories or collect more data.

Keep going

Next topic4.12 Designing data collectionPrevious topic4.10 Spearman's rank correlation

More in Topic 4 · Statistics and probability

  1. 4.7Discrete random variablesNotes · 10 questions
  2. 4.8Binomial distributionNotes · 10 questions
  3. 4.9Normal distributionNotes · 10 questions
  4. 4.10Spearman's rank correlationNotes · 10 questions
  5. 4.11Chi-squared and t-testsNotes · 10 questions
  6. 4.12Designing data collectionNotes · 10 questions· HL only
  7. 4.13Non-linear regressionNotes · 10 questions· HL only
  8. 4.14Linear combinations of random variablesNotes · 10 questions· HL only
  9. 4.15Central limit theoremNotes · 10 questions· HL only

All IB Mathematics: Applications and Interpretation topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by IB Diploma Programme or any exam board.

On this page

0/5 read

  1. 1Hypothesis tests judge whether a pattern could be chance
  2. 2A chi-squared test compares observed counts with expected counts
  3. 3Technology carries out the chi-squared test from a table
  4. 4A t-test compares the means of two groups
  5. 5A small p-value is evidence against the null hypothesis
  6. Check your recall
  7. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe