| Study Guides
AP · Introducing Chi-Square · 14 min read · Updated 2026-05-10

Introducing Chi-Square — AP Statistics Study Guide

For: AP Statistics candidates sitting AP Statistics.

Covers: The chi-square test statistic, comparison of observed vs expected counts, conditions for chi-square inference, goodness-of-fit tests, degrees of freedom calculation, and interpretation of chi-square distributions aligned to the AP Stats CED.

You should already know: Basics of categorical data and proportion distributions, Core conditions for hypothesis test inference, Properties of common sampling distributions (z, t).

A note on the practice questions: All worked questions in the "Practice Questions" section below are original problems written by us in the AP Statistics style for educational use. They are not reproductions of past College Board / Cambridge / IB papers and may differ in wording, numerical values, or context. Use them to practise the technique; cross-check with official mark schemes for grading conventions.


1. What Is Introducing Chi-Square?

Introducing chi-square (written , pronounced "kigh-square") is the foundational topic for all inference on categorical data in AP Statistics, making up 6-10% of the total AP exam weight per the official College Board CED. Unlike z or t-tests, which are designed for inference on quantitative data, chi-square procedures are built specifically for working with count data from categorical variables. The core idea unifying all chi-square inference is comparing the observed counts of observations we collect in our sample to the expected counts we would see if our null hypothesis were true. The distribution is a family of right-skewed, non-negative distributions, whose shape depends only on degrees of freedom, rather than sample size directly. This topic appears on both MCQ and FRQ sections of the AP exam: it typically accounts for 2-3 MCQs, and the first 3-4 points of a multi-part FRQ on categorical inference. It is a strict prerequisite for all more advanced chi-square procedures.

2. The Chi-Square Test Statistic

The test statistic is the core calculation for all chi-square inference, quantifying how far observed data deviates from the expected distribution under the null hypothesis. The formula for the test statistic is: where is the observed count for a category, and is the expected count for that category under the null hypothesis. The structure of the formula has intuitive reasoning: first, we subtract from to get the raw deviation of observed from expected. We square the deviation to ensure all terms are positive, so positive and negative deviations do not cancel each other out. We divide by to scale the deviation by the size of the expected count: a difference of 10 between and is much more meaningful when than when . The distribution is always right-skewed, and becomes more symmetric (approaching a normal distribution) as degrees of freedom increase, because of the Central Limit Theorem.

Worked Example

A coffee shop claims that their four sizes of iced coffee are equally popular: 25% small, 25% medium, 25% large, 25% extra-large. A barista takes a random sample of 80 orders during a week and gets: 17 small, 26 medium, 24 large, 13 extra-large. Calculate the chi-square test statistic for this data.

  1. List observed counts for each category: , , , . Total , which matches the problem statement.
  2. Calculate expected counts: the null proportion for each category is 0.25, so for all categories.
  3. Calculate for each category: Small: Medium: Large: Extra-large:
  4. Sum all terms to get the test statistic: .

Exam tip: On the AP exam, even if you calculate the final value on your calculator, you must write out the formula with substituted and values to earn full credit for the calculation step.

3. Conditions for Chi-Square Inference

All inference relies on meeting conditions to ensure the p-value we calculate is reliable, and the AP exam almost always awards 1 point on FRQs for correctly stating and checking chi-square conditions. There are three required conditions:

  1. Random: The data comes from a random sample from the population of interest, or a randomized experiment. This is identical to the random condition for all other inference procedures, and ensures we can generalize results to the population or establish causation (for experiments).
  2. Independence: Individual observations are independent of each other. For sampling without replacement, this means the 10% condition holds: the sample size is less than 10% of the total population size.
  3. Large Counts: The distribution is a continuous approximation to the discrete sampling distribution of the test statistic, so this condition ensures the approximation is accurate. The AP Stats CED accepts the rule: all expected counts are at least 1, and no more than 20% of expected counts are less than 5. A stricter rule (all expected counts ≥ 5) is also acceptable.

Worked Example

A student tests whether the distribution of college majors matches the college's reported distribution: 30% STEM, 40% humanities, 20% social science, 10% arts. They take a random sample of 50 students, resulting in the following expected counts: 15 STEM, 20 humanities, 10 social science, 5 arts. Check all conditions for chi-square inference.

  1. Random: The problem states the sample is random, so this condition is satisfied.
  2. Independence: The total population of the college is almost certainly more than students, so the 10% condition holds, and independence is satisfied.
  3. Large Counts: All four expected counts are ≥ 1, and 0 out of 4 expected counts are less than 5. This meets the 20% rule, so the large counts condition is satisfied.

Exam tip: If the large counts condition is violated, do not just say "we cannot proceed" on the AP exam. Explicitly note the issue, mention p-values may be inaccurate, and suggest combining small categories to fix the problem to earn partial credit.

4. Chi-Square Goodness-of-Fit Tests

A chi-square goodness-of-fit (GOF) test is the first full inference procedure introduced for chi-square, used to test whether the distribution of a single categorical variable matches a claimed null distribution. The hypotheses for a GOF test are always structured as:

  • : The distribution of the categorical variable matches the claimed distribution.
  • : The distribution of the categorical variable differs from the claimed distribution (at least one proportion differs from the null value).

Degrees of freedom for a GOF test is always , where is the number of categories of the variable. We lose 1 degree of freedom because the sum of expected counts is always fixed to the total sample size, so we have one less free parameter to estimate. All chi-square tests are right-tailed: larger values mean larger deviations from the null, so the p-value is .

Worked Example

A geneticist claims that five possible phenotypes from a genetic cross occur in the proportions 9:3:3:1 (i.e., 9/16, 3/16, 3/16, 1/16). A random sample of 160 offspring gives the following observed counts: 86, 31, 29, 14. Conduct a chi-square GOF test at to test the geneticist's claim.

  1. Hypotheses: : The phenotypic distribution matches the 9:3:3:1 genetic ratio. : The phenotypic distribution differs from the claimed ratio.
  2. Check conditions: Random sample is given, population of offspring is far more than 1600, 10% condition holds. Expected counts: , , , . All expected counts ≥ 5, so large counts condition is satisfied.
  3. Calculate test statistic and df: . .
  4. Conclusion: . Since , we fail to reject . There is not sufficient evidence to reject the geneticist's claimed ratio.

Exam tip: Always state hypotheses in context of the problem's variable. AP readers deduct a full point for generic, out-of-context hypotheses for chi-square tests.

5. Common Pitfalls (and how to avoid them)

  • Wrong move: Plugging null proportions (values between 0 and 1) into the chi-square formula instead of count expected values. Why: Students confuse the null proportion for a category with the expected count, forgetting to multiply by total sample size. Correct move: Always confirm and are counts (not proportions) before substituting into the formula.
  • Wrong move: Using instead of for goodness-of-fit tests. Why: Students forget that the total sample size uses up one degree of freedom, and confuse GOF degrees of freedom with other chi-square procedures. Correct move: For all GOF tests, explicitly write before calculating the p-value.
  • Wrong move: Calculating a two-tailed or left-tailed p-value for a chi-square test. Why: Students are used to two-tailed tests for z and t, and forget only large deviations count as evidence against . Correct move: All chi-square tests are always right-tailed; the p-value is always the probability of getting a test statistic as large or larger than your calculated value.
  • Wrong move: Rejecting the large counts condition because observed counts are less than 5, not expected counts. Why: Students mix up observed and expected counts when checking conditions. Correct move: Only expected counts matter for the large counts condition; small observed counts do not violate the rule.
  • Wrong move: Concluding "we accept " when failing to reject the null hypothesis. Why: Students carry over bad habits from earlier hypothesis testing, forgetting we can never prove the null is true. Correct move: Always state "we fail to reject " and conclude there is insufficient evidence to support the alternative.

6. Practice Questions (AP Statistics Style)

Question 1 (Multiple Choice)

A city council tests whether traffic accidents are uniformly distributed across the seven days of the week (i.e., 1/7 of accidents on each day). A random sample of 140 accidents over one year gives a chi-square test statistic of 11.1. What is the p-value for this test, and what conclusion is appropriate at ? A) p-value ≈ 0.08, fail to reject B) p-value ≈ 0.08, reject C) p-value ≈ 0.03, fail to reject D) p-value ≈ 0.03, reject

Worked Solution: First, this is a goodness-of-fit test with categories (days), so . The mean of a chi-square distribution equals its degrees of freedom, so the mean here is 6. The critical value for for is 12.59, meaning any larger than 12.59 has a p-value less than 0.05. Our test statistic is 11.1, which is less than 12.59, so the p-value is between 0.05 and 0.10, approximately 0.08. Since 0.08 > 0.05, we fail to reject . The correct answer is A.


Question 2 (Free Response)

A coffee chain claims that the distribution of customer drink preferences is: 40% black coffee, 30% lattes, 20% cappuccinos, 10% espresso. A regional manager takes a random sample of 200 customers to test this claim. (a) Calculate the expected count for each drink type under the null hypothesis. (b) The manager calculates a chi-square test statistic of 9.2. What are the degrees of freedom for this test? Find the p-value and interpret it in context. (c) The manager notices the expected count for espresso is 20, which meets the large counts condition, but suggests combining espresso with cappuccino to create a new "other espresso drinks" category. Is combining necessary here, and how would it change the degrees of freedom if done?

Worked Solution: (a) Expected counts are calculated as , where : Black coffee: Lattes: Cappuccinos: Espresso:

(b) There are categories, so . For with , the p-value is approximately 0.027. Interpretation: If the chain's claimed preference distribution is correct, the probability of observing a chi-square test statistic as large or larger than 9.2 is 2.7%.

(c) Combining categories is not necessary: all expected counts are greater than 5, so the large counts condition is already satisfied. If we combine cappuccino and espresso into one category, we have total categories, so the new degrees of freedom will be , a decrease of 1 from the original 3.


Question 3 (Application / Real-World Style)

Wildlife biologists study nest site selection by wood ducks in a wetland. Historically, 45% of nests are in tree cavities, 35% are in man-made nesting boxes, and 20% are in brush piles. After a conservation program that adds more nesting boxes, a random sample of 120 nests finds: 48 tree cavities, 54 nesting boxes, 18 brush piles. Does this data provide evidence at the level that the distribution of nest site selection has changed from the historical distribution?

Worked Solution: First, state hypotheses: : The distribution of nest sites is 45% tree cavities, 35% boxes, 20% brush piles. : The distribution differs from the historical distribution. Check conditions: Random sample is given, total number of nests is far more than 1200 so 10% condition holds, expected counts are , , , all ≥ 5 so large counts are satisfied. Calculate the test statistic: . , p-value ≈ 0.061. Since 0.061 > 0.05, we fail to reject . Conclusion: There is not sufficient evidence at the 0.05 level to conclude that the distribution of wood duck nest site selection has changed from the historical distribution after the conservation program.

7. Quick Reference Cheatsheet

Category Formula Notes
Chi-Square Test Statistic = observed count, = expected count. Works for all chi-square procedures.
Expected Count (GOF) = total sample size, = null proportion for the category.
Degrees of Freedom (GOF) = number of categories of the categorical variable.
10% Condition (Independence) Required for sampling without replacement; = population size.
Large Counts Condition All , ≤ 20% of AP CED accepts this flexible rule; all is also acceptable.
Chi-Square P-Value All chi-square tests are right-tailed; only large test statistics count as evidence against .
Mean of Chi-Square Distribution The center of the distribution shifts right as degrees of freedom increase.

8. What's Next

This chapter lays the foundational framework for all inference on categorical data, and the next topics in Unit 8 are chi-square tests for homogeneity and independence for two categorical variables. These procedures use the same core chi-square test statistic, conditions, and p-value calculation you learned here, only differing in how expected counts and degrees of freedom are calculated. Without mastering the core ideas of observed vs expected counts and chi-square inference structure from this chapter, you will not be able to correctly complete the more complex two-variable chi-square procedures, which frequently appear as full 5-6 point FRQs on the AP exam. Beyond this unit, this topic reinforces the general hypothesis testing framework that unifies all inference in AP Statistics. Follow-on topics: Chi-Square Tests for Homogeneity Chi-Square Tests for Independence Hypothesis Testing for Proportions

← Back to topic

Stuck on a specific question?
Snap a photo or paste your problem — Ollie (our AI tutor) walks through it step-by-step with diagrams.
Try Ollie free →