Chi-Square Test Examples in Math

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Chi-Square Test.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.

Concept Recap

A hypothesis test that compares observed frequencies to expected frequencies using the chi-square statistic to assess independence or goodness of fit.

You expect a die to land on each face about 16\frac{1}{6} of the time. You roll it 600 times and compare what you observed to what you expected. If the differences are small, the die is probably fair. If they're large, something is off. The chi-square statistic measures 'how far off are the observed counts from what we expected?'

Read the full concept explanation →

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: The chi-square test sums squared gaps between observed and expected category counts to test independence or goodness of fit.

Common stuck point: The procedure for chi-square test is the easy part; the trap is dividing by Observed instead of Expected. Asking "Are the data counts of cases falling into categories, being compared to expected counts (rather than means or continuous values)?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

Sense of Study hint: Ask: Are the data counts of cases falling into categories, being compared to expected counts (rather than means or continuous values)?

Worked Examples

Example 1

medium
A die is rolled 60 times. Observed: 1→8, 2→12, 3→9, 4→11, 5→13, 6→7. Conduct a chi-square goodness-of-fit test at α=0.05\alpha=0.05.

Answer

χ2=2.8<11.07\chi^2 = 2.8 < 11.07. Fail to reject H0H_0. No evidence the die is unfair.

First step

1
Expected under H0H_0 (fair die): E=60/6=10E = 60/6 = 10 for each outcome

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Unlock answer keys One Family plan — every worked solution, all subjects

Example 2

hard
A 2×2 table: Men: 30 prefer A, 20 prefer B. Women: 15 prefer A, 35 prefer B. Test independence of gender and preference at α=0.05\alpha=0.05.

Example 3

medium
Observed counts: 40,30,3040,30,30. Expected: 33.3,33.3,33.333.3,33.3,33.3. Compute χ2\chi^2.

Example 4

hard
A goodness-of-fit test: O=(60,40,50,50)O=(60,40,50,50), claimed proportions (0.25,0.25,0.25,0.25)(0.25,0.25,0.25,0.25), n=200n=200. Find χ2\chi^2.

Example 5

hard
Observed counts in a 2×22\times 2 table: (30102040)\begin{pmatrix}30 & 10 \\ 20 & 40\end{pmatrix}. Find the expected count for the top-left cell.

Example 6

challenge
A genetics experiment expects ratio 9:3:3:19:3:3:1 in 160 plants. Observed: 84,33,30,1384,33,30,13. Compute χ2\chi^2.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
For a chi-square test with observed=15, expected=20 for one category, calculate that category's contribution to the χ2\chi^2 statistic.

Example 2

hard
A survey of movie preferences across three age groups produces a 3×4 contingency table (3 age groups, 4 movie genres). State H0H_0 and HaH_a, calculate degrees of freedom, and explain what a significant result would mean.

Example 3

easy
A category had observed count O=30O = 30 and expected count E=25E = 25. Compute its contribution (OE)2E\frac{(O-E)^2}{E} to the chi-square statistic.

Example 4

easy
A fair die is rolled 600600 times. What is the expected count for each face under the null hypothesis of fairness?

Example 5

easy
Chi-square tests are appropriate for which kind of data: categorical counts or continuous measurements?

Example 6

easy
A goodness-of-fit test has k=5k = 5 categories. How many degrees of freedom does the chi-square statistic have?

Example 7

easy
In a chi-square test, what condition must each expected count satisfy for the approximation to be reliable?

Example 8

easy
Two cells contribute (OE)2E\frac{(O-E)^2}{E} values of 1.21.2 and 0.80.8. If these are the only cells, what is the chi-square statistic?

Example 9

easy
As the chi-square statistic gets larger, does the evidence against the null hypothesis get stronger or weaker?

Example 10

easy
A two-way table has 33 rows and 44 columns. How many degrees of freedom does the chi-square test of independence have?

Example 11

medium
A goodness-of-fit test compares observed counts O=(20,30,50)O = (20, 30, 50) to expected counts E=(30,30,40)E = (30, 30, 40). Compute the chi-square statistic.

Example 12

medium
A die rolled 600600 times gives counts (90,110,100,105,95,100)(90, 110, 100, 105, 95, 100). The expected count per face is 100100. Compute the chi-square statistic.

Example 13

medium
In a 2×22 \times 2 table, the expected count for a cell is (row total)(column total)grand total\frac{(\text{row total})(\text{column total})}{\text{grand total}}. If row total =40= 40, column total =50= 50, grand total =200= 200, find the expected count.

Example 14

medium
A chi-square test of independence yields χ2=9.5\chi^2 = 9.5 with df=4df = 4 and a p-value of 0.050.05. At α=0.05\alpha = 0.05, what is the conclusion?

Example 15

medium
A goodness-of-fit test claims four candies should appear in ratio 1:1:1:11:1:1:1 among n=120n=120. What is the expected count per color?

Example 16

medium
A claimed distribution is 50%,30%,20%50\%, 30\%, 20\% over n=200n = 200. Find the expected counts for the three categories.

Example 17

medium
A test of independence and a test of homogeneity use the same chi-square formula. What distinguishes them?

Example 18

medium
A goodness-of-fit test gives χ2=1.2\chi^2 = 1.2 on df=3df = 3, with a large p-value of 0.750.75. At α=0.05\alpha = 0.05, what do you conclude?

Example 19

medium
One cell of a chi-square test has O=18O = 18, E=12E = 12. Compute that cell's contribution.

Example 20

challenge
A goodness-of-fit test on 44 categories gives χ2=7.81\chi^2 = 7.81. The critical value for α=0.05\alpha = 0.05 at df=3df = 3 is exactly 7.817.81. State the decision and explain the boundary case.

Example 21

challenge
In a 2×32\times 3 table the smallest expected count comes out to 4.24.2. All others exceed 55. Why might the chi-square p-value be unreliable, and what is one fix?

Example 22

challenge
A goodness-of-fit test on n=200n=200 claims proportions 0.4,0.4,0.20.4, 0.4, 0.2. Observed: 90,70,4090, 70, 40. Compute χ2\chi^2 and state dfdf.

Example 23

easy
For one cell of a chi-square test, O=24O=24 and E=20E=20. Compute (OE)2E\frac{(O-E)^2}{E}.

Example 24

easy
A goodness-of-fit test has 77 categories. Compute the degrees of freedom.

Example 25

easy
A spinner is spun 200200 times with 44 equal sectors. Find the expected count per sector.

Example 26

easy
A 4×54\times 5 contingency table has how many degrees of freedom for independence?

Example 27

medium
A 2×22\times 2 table has row total 6060, column total 4040, grand total 120120. Find the expected count for that cell.

Example 28

medium
For n=300n=300 with claimed proportions 0.5,0.3,0.20.5, 0.3, 0.2, find expected counts.

Example 29

medium
A chi-square test produces χ2=12.3\chi^2=12.3 with df=5df=5, critical value 11.0711.07 at α=0.05\alpha=0.05. State the decision.

Example 30

medium
A test gives χ2=3.0\chi^2=3.0, df=4df=4. Critical value 9.499.49 at α=0.05\alpha=0.05. State the decision.

Example 31

medium
A goodness-of-fit test on 4 candy colors with n=400n=400, equal expected. Observed: 90,110,95,10590,110,95,105. Compute χ2\chi^2.

Example 32

medium
A 3×33\times 3 contingency table — how many degrees of freedom does the chi-square independence test have?

Example 33

medium
For n=240n=240 split into 6 categories under uniform null. What is the expected count per category?

Example 34

hard
For a 2×32\times 3 table the chi-square statistic is 5.995.99 with df=2df=2, critical value 5.995.99 at α=0.05\alpha=0.05. State the decision.

Example 35

hard
In a 2×22\times 2 table, the smallest expected count is 3.53.5. Is the chi-square approximation appropriate?

Example 36

hard
For the 2×22\times 2 table (30102040)\begin{pmatrix}30 & 10 \\ 20 & 40\end{pmatrix}, compute the chi-square statistic.

Example 37

hard
A goodness-of-fit test with df=10df=10 has critical value 18.3118.31 at α=0.05\alpha=0.05. If observed χ2=14.0\chi^2=14.0, what is the decision?

Example 38

challenge
A homogeneity test compares 3 separate samples on 4 categories. State the degrees of freedom.

Example 39

challenge
A claim says a coin is fair. In 400400 flips you observe 220220 heads. Compute χ2\chi^2 for the goodness-of-fit test.

Background Knowledge

These ideas may be useful before you work through the harder examples.

hypothesis testingp valueprobability