This course has been archived. The College Board updated AP Statistics for the 2026–27 school year, and the units and topics changed.
Go to the new AP® Statistics
5m left·0%
Reading Time: 5 min
Last Updated: March 26, 2026
Main Ideas: 8
Reading Time: 5 min
Last Updated: March 26, 2026
Main Ideas: 8

Topic 8.4 Notes – Expected Counts in Two-Way Tables

Read aloud
When you compare categorical variables, expected counts tell you what the table would look like if the null hypothesis were true. Every chi-square test from a two-way table depends on calculating these correctly.

Two-Way Tables and What “Expected” Means

A two-way table organizes counts for two categorical variables.

  • Rows = one categorical variable
  • Columns = another categorical variable
  • Each cell = number of individuals in that category combination

The numbers you collect from data are called observed counts (O).

An expected count (E) is what we would expect in a cell if the null hypothesis were true.

  • For a test of independence → assume the variables are independent.
  • For a test of homogeneity → assume the distributions are the same across groups.

Expected counts are not guesses. They come from a formula that builds the table under the assumption of no relationship.

The Expected Count Formula

For any cell in a two-way table:

Expected Count=(Row Total)(Column Total)Table Total \text{Expected Count} = \frac{(\text{Row Total})(\text{Column Total})}{\text{Table Total}}

Where:

  • Row Total = total for that row
  • Column Total = total for that column
  • Table Total = grand total nn

This formula is required. You won’t get credit for “estimating” from proportions unless you show the actual calculation.

Why This Formula Makes Sense

If two variables are independent, then:

  • The proportion in each column should be the same across rows.
  • The marginal totals (row and column totals) control how the data is distributed.

The formula combines:

  • How big the row is
  • How big the column is
  • How big the whole sample is

It spreads counts proportionally, assuming no association.

Step-by-Step Example

Suppose a survey of 200 students recorded:

  • Whether they prefer online or in-person classes
  • Whether they are freshmen or seniors

Here are the observed counts from the survey:

Observed two-way table of class preference by year. Row totals (80, 120) are on the right; column totals (90, 110) are along the bottom.

Let’s find the expected count for Freshmen who prefer Online.

  1. Row total (Freshmen) = 80
  2. Column total (Online) = 90
  3. Table total = 200

E=(80)(90)200=7200200=36 E = \frac{(80)(90)}{200} = \frac{7200}{200} = 36

So if class preference and year in school were independent, we would expect 36 freshmen to prefer online classes.

The observed count in that cell is 50. That difference is what feeds into the chi-square statistic later.

You repeat this process for every cell in the table.

Independence vs Homogeneity

Both tests use the same expected count formula. The difference is context.

Independence Homogeneity
Populations One population Two or more populations
Variables Two categorical variables One categorical variable compared across groups
Null hypothesis Variables are independent Distributions are the same
Expected count formula Same formula Same formula

AP questions love to describe the scenario in words and make you decide which situation it is. Once you’re computing expected counts, the math is identical.

How Expected Counts Connect to Chi-Square

The chi-square statistic is:

χ2=∑(O−E)2E \chi^2 = \sum \frac{(O - E)^2}{E}

  • OO = observed count
  • EE = expected count

Each cell contributes a piece. Big differences between observed and expected lead to a large χ2\chi^2 value.

Expected counts are the “model” under the null hypothesis. The entire test is measuring how far reality deviates from that model.

Conditions Reminder

For chi-square procedures:

  • All expected counts must be at least 5.
  • This rule is about expected counts, not observed counts.

Students often check the wrong numbers here.

Common Mistakes to Avoid

  • Using the observed count inside the formula instead of the row and column totals.
  • Forgetting to divide by the grand total.
  • Only calculating one expected count when the problem requires all of them.
  • Writing the formula but not plugging in actual numbers. On FRQs, you must show the substitution.

When you compute expected counts correctly, the row totals and column totals will still match the original margins. If they don’t, something went wrong in the arithmetic.

Key Takeaways

Expected count is calculated with (row total×column total)/table total(\text{row total} \times \text{column total}) / \text{table total}.
Expected counts represent what we would see if the null hypothesis were true.
Independence and homogeneity use the exact same expected count formula.
The chi-square statistic compares observed counts to expected counts using (O−E)2E\frac{(O - E)^2}{E}.
The condition for chi-square procedures requires all expected counts to be at least 5.

AP® is a trademark registered by the College Board, which is not affiliated with, and does not endorse this website.

Notes

1 credit used · 5/5 remaining