Chi-square practice problems
By Jude Wallis · Published
This set has 8 problems on chi-square tests for two-way tables: computing expected counts, adding cell contributions to get the chi-square statistic, finding degrees of freedom, and telling a test of homogeneity from a test of independence. Solve each on paper, then open the steps.
AP Statistics: Unit 3 (topics 3.14 Setting Up a Chi-Square Test for Homogeneity or Independence, 3.15 Carrying Out a Chi-Square Test for Homogeneity or Independence). These problems cover the chi-square test for homogeneity and the chi-square test for independence on two-way tables (Unit 3 topics 3.14 and 3.15) in the Fall 2026 AP Statistics course. Unit 3 is 15 to 25% of the multiple-choice section. Chi-square goodness-of-fit is not part of this course.
What these problems build
These 8 problems build the workflow of a chi-square test on a two-way table of counts: finding the expected count in each cell, adding the cell-by-cell contributions to get the chi-square statistic (read 'ky-square'), counting the degrees of freedom, and deciding between a test of homogeneity and a test of independence. The expected count for a cell is , the count the null model predicts. The statistic is , where is an observed count and is its expected count, summed over every cell. The degrees of freedom equal .
A test of homogeneity compares the distribution of one categorical variable across two or more separate samples, while a test of independence checks whether two variables are associated within a single sample; the study design tells you which one fits. The first problems drill expected counts, degrees of freedom, and the statistic on their own, then the later problems run a full test and reason about the result. For the setup and conditions, read chi-square tests explained, and check your arithmetic with the chi-square calculator. More sets are on the practice page.
Problem 1
An animal shelter records, for a random sample of 200 recently adopted pets, the species of the pet and whether the adopter signed up for a free training class.
| Species | Signed up | Did not | Total |
|---|---|---|---|
| Cat | 80 | 40 | 120 |
| Dog | 70 | 10 | 80 |
| Total | 150 | 50 | 200 |
Assuming no association between species and signing up, find the expected count for all four cells and check the expected-counts condition.
Show the worked solution
Each expected count is . The row totals are 120 and 80, the column totals are 150 and 50, and the table total is 200.
Cat and signed up: .
Cat and did not: .
Dog and signed up: .
Dog and did not: .
Check the condition. The four expected counts are 90, 30, 60, and 20, and every one is greater than 5, so the expected-counts condition is met.
Expected counts: cat and signed up 90, cat and did not 30, dog and signed up 60, dog and did not 20; all exceed 5, so the condition is met.
Problem 2
For each study, name the chi-square test that fits (homogeneity or independence), state the hypotheses in words, and give the degrees of freedom.
- Study A. A researcher takes one random sample of 250 adults and records each person's favorite coffee style (drip, espresso, or cold brew) and whether they work remotely, then asks whether coffee style and remote work are associated.
- Study B. A district office draws separate random samples of 100 students from each of three high schools and records each student's preferred learning mode (in person, hybrid, or online), then asks whether the distribution of learning mode is the same across the three schools.
Show the worked solution
Look at how the data were collected. Study A is one sample from a single population measured on two variables, which points to a test of independence. Study B is separate samples from several populations compared on one variable, which points to a test of homogeneity.
Study A test and hypotheses. Chi-square test for independence. : coffee style and remote-work status are independent (not associated) among adults. : coffee style and remote-work status are associated.
Study A degrees of freedom. The table is 3 coffee styles by 2 remote-work categories, so .
Study B test and hypotheses. Chi-square test for homogeneity. : the distribution of preferred learning mode is the same across the three schools. : the distribution of learning mode is not the same across the three schools.
Study B degrees of freedom. The table is 3 schools by 3 learning modes, so .
Study A: test of independence, coffee style and remote work independent vs associated, . Study B: test of homogeneity, same learning-mode distribution across schools vs not the same, .
Problem 3
A streaming service takes a random sample of 300 subscribers and cross-classifies each by plan tier and the device they watch on most.
| Plan | TV | Phone | Laptop | Total |
|---|---|---|---|---|
| Basic | 100 | 50 | 30 | 180 |
| Premium | 50 | 40 | 30 | 120 |
| Total | 150 | 90 | 60 | 300 |
Find the expected count for every cell under the null hypothesis of no association, and give the degrees of freedom.
Show the worked solution
Each expected count is , with table total 300. Row totals are 180 (basic) and 120 (premium); column totals are 150 (TV), 90 (phone), and 60 (laptop).
Basic row: for TV, for phone, and for laptop.
Premium row: for TV, for phone, and for laptop.
Check the condition. The expected counts are 90, 54, 36, 60, 36, and 24, all greater than 5.
Degrees of freedom. The table has 2 rows and 3 columns, so .
Expected counts (basic) 90, 54, 36 and (premium) 60, 36, 24, all above 5; .
Problem 4
An orchard tests two pollination methods on whether each tree sets fruit. It randomly assigns 100 trees to managed bee boxes and 100 trees to hand pollination, then records the outcome for each tree.
| Method | Set fruit | No fruit | Total |
|---|---|---|---|
| Bee boxes | 66 | 34 | 100 |
| Hand | 54 | 46 | 100 |
| Total | 120 | 80 | 200 |
Compute the chi-square statistic and its degrees of freedom for a test of whether the fruit-set rate differs by method.
Show the worked solution
Expected counts, . Set-fruit column: for each method. No-fruit column: for each method.
Bee-box contributions. Set fruit: . No fruit: .
Hand contributions. Set fruit: . No fruit: .
Add the four terms. .
Degrees of freedom. . A chi-square value of 3.0 on 1 degree of freedom gives a p-value of about 0.083, above , so this would not be convincing evidence of a difference.
Expected counts are 60 and 40 in every cell; with (p-value about 0.083).
Problem 5
At three wetland sites, a conservation crew bands a random sample of 100 birds per site and records whether each bird is a juvenile or an adult.
| Site | Juvenile | Adult | Total |
|---|---|---|---|
| Site 1 | 48 | 52 | 100 |
| Site 2 | 36 | 64 | 100 |
| Site 3 | 36 | 64 | 100 |
| Total | 120 | 180 | 300 |
Test at whether the age distribution is the same across the three sites. Find the expected counts, the chi-square statistic, the degrees of freedom, and the decision.
Show the worked solution
Hypotheses. : the distribution of age (juvenile vs adult) is the same at all three sites. : the age distribution is not the same across the sites. This is a chi-square test for homogeneity, because the three sites are separate samples.
Expected counts, . Juvenile column: per site. Adult column: per site. All expected counts exceed 5.
Juvenile contributions. Site 1: . Sites 2 and 3: each. Juvenile total .
Adult contributions. Site 1: . Sites 2 and 3: each. Adult total .
Statistic and degrees of freedom. , and .
Decision. The critical value for at is 5.991 (the p-value is about 0.135). Since , fail to reject : there is not convincing evidence that the age distribution differs across the three sites.
Expected counts 40 (juvenile) and 60 (adult) per site; , . Since (p about 0.135), fail to reject ; no convincing evidence the age distribution differs.
Problem 6
A transportation study compares primary commute mode in two cities. Independent random samples of 200 commuters are drawn in each city, and each commuter's main mode (bus, train, or bike) is recorded.
| City | Bus | Train | Bike | Total |
|---|---|---|---|---|
| City X | 105 | 65 | 30 | 200 |
| City Y | 75 | 95 | 30 | 200 |
| Total | 180 | 160 | 60 | 400 |
(a) State the hypotheses and name the test. (b) Find the expected counts. (c) Compute the chi-square statistic and degrees of freedom. (d) At , state your conclusion in context.
Show the worked solution
(a) Chi-square test for homogeneity, since the two cities are separate random samples compared on one categorical variable. : the distribution of commute mode is the same in the two cities. : the distribution of commute mode differs between the two cities.
(b) Expected counts, , with each row total 200. Bus: . Train: . Bike: . These are the same for both cities, and all exceed 5.
(c) Bus contributions. City X: . City Y: .
(c) Train contributions. City X: . City Y: . Both bike contributions are .
(c) Add the terms and find df. , and .
(d) Conclusion. For the p-value is about 0.005, less than (and the statistic 10.625 exceeds the critical value 5.991). Reject : there is convincing evidence that the distribution of commute mode differs between City X and City Y.
(a) Homogeneity test, same commute-mode distribution vs different. (b) Expected 90, 80, 30 per city. (c) , . (d) p about 0.005 < 0.05, reject ; convincing evidence the distributions differ.
Problem 7
A random sample of 200 day hikers at a national park is classified by experience level and by whether they carry a first-aid kit.
| Experience | Carries kit | No kit | Total |
|---|---|---|---|
| Novice | 30 | 50 | 80 |
| Intermediate | 34 | 26 | 60 |
| Expert | 36 | 24 | 60 |
| Total | 100 | 100 | 200 |
(a) Name the appropriate test and explain why. (b) State the hypotheses. (c) Find the expected counts and the chi-square statistic with its degrees of freedom. (d) At , state a conclusion. (e) Would the decision change at ?
Show the worked solution
(a) Chi-square test for independence. The data come from one random sample of hikers measured on two categorical variables (experience level and kit), not from separate samples of different populations.
(b) Hypotheses. : experience level and carrying a first-aid kit are independent among the park's day hikers. : experience level and carrying a first-aid kit are associated.
(c) Expected counts, , each column total 100. Novice: per cell. Intermediate and expert: per cell. All exceed 5.
(c) Novice contributions. Carries kit: . No kit: .
(c) Intermediate and expert contributions. Each intermediate cell: . Each expert cell: .
(c) Statistic and df. , and .
(d) At . The p-value for is about 0.0145, less than 0.05, so reject : there is convincing evidence that experience level and carrying a first-aid kit are associated.
(e) At . Now , so you fail to reject ; the same data are not strong enough to conclude an association at the stricter level, so the decision changes.
(a)/(b) Test of independence, experience and kit independent vs associated. (c) , . (d) p about 0.0145 < 0.05, reject . (e) At , p > 0.01, so fail to reject; the decision changes.
Problem 8
A high school compares study-music preferences using separate random samples of 150 juniors and 150 seniors. Each student names their usual study music: lo-fi, classical, or none.
| Grade | Lo-fi | Classical | None | Total |
|---|---|---|---|---|
| Juniors | 78 | 39 | 33 | 150 |
| Seniors | 42 | 51 | 57 | 150 |
| Total | 120 | 90 | 90 | 300 |
(a) Compute the chi-square statistic and degrees of freedom. (b) Identify the cell that contributes most to the statistic and interpret it in context. (c) A classmate suggests running this instead as a test of independence. Explain why a test of homogeneity is the right choice here.
Show the worked solution
(a) Expected counts, , each row total 150. Lo-fi: per grade. Classical: per grade. None: per grade.
(a) Lo-fi contributions. Juniors: . Seniors: .
(a) Classical and none contributions. Classical: juniors , seniors . None: juniors , seniors .
(a) Statistic and df. , and ; the p-value is under 0.001, strong evidence of a difference.
(b) Largest contribution. The two lo-fi cells each add 5.4, the largest single contribution. Juniors chose lo-fi far more than the null predicts (78 observed versus 60 expected) while seniors chose it far less (42 versus 60), so the lo-fi preference is where the two grades differ most.
(c) Why homogeneity. The design fixed two separate samples, 150 juniors and 150 seniors, and compares the distribution of one variable (study music) across those two populations. A test of independence applies to a single sample classified by two variables at once, which is not how these data were collected.
(a) , (p < 0.001). (b) The lo-fi cells contribute most (5.4 each): juniors pick lo-fi much more than expected (78 vs 60), seniors much less (42 vs 60). (c) Two separate grade samples compared on one variable calls for homogeneity, not independence.