AP® Biology exam preparation · Skim version
The Chi-Square Test
Read the full lesson → Skim the whole course →
This idea at other levels
This lesson teaches the chi-square test at high school level. Simpler: read a short high school version in the lesson. Deeper: Probability, Crosses and the Chi-Square Test (college core).
The guiding idea
Thirty-seven of 60 flies walk to one side of a chamber. Is that a preference, or the kind of lopsided split chance makes all the time?
Chi-square measures how far observed counts sit from the counts a chance-only null hypothesis predicts, and you reject the null only when a gap that large would turn up by chance less than 5% of the time.
From the film: What Chance Looks Like
- Chi-square asks how often chance alone would put counts this far from the null: less than 1 time in 20 (above the critical value), reject the null; more often, fail to reject it.
- 37 of 60 flies on the humid side gives χ² = 3.27, below the 1-df critical value of 3.84, so you fail to reject the null.
- Failing to reject is not proof: the flies may still prefer humid air, but 60 flies are not enough to rule out chance.
- The same 61.7% share in 120 flies doubles χ² to 6.53, past 3.84, so you reject the null (0.01 < p < 0.05).
- Chi-square takes counts, never percentages, because percentages throw away the sample size.
From the film: Crosses and Cells
- In the corn cross, 291 purple and 109 yellow kernels give χ² = 1.08, below the 1-df critical value of 3.84, so you fail to reject 3:1; the same miss of 9 weighs three times as much in the smaller class.
- Degrees of freedom are outcome categories minus one: a four-class testcross of 400 offspring has 3, not 399.
- The testcross gives χ² = 151.54, past 11.34, so you reject 1:1:1:1; the excess of parental classes is consistent with linkage, not proof of it.
- For treated against control root tips, pool both groups for the expected counts (161 and 39 per group): χ² = 5.16, so you reject the null with 0.01 < p < 0.05. Using the control alone as expected overstates the evidence.
- Rejecting says chance is a poor explanation, not why: more cells entering mitosis and cells staying in mitosis longer both fit.
-
Flies released in the middle of a two-condition tube settle on one side or the other, and 37 against 23 (simulated counts) looks like a preference, but the test asks whether chance alone could split 60 flies that unevenly. AI-generated illustration -
The five-step routine
-
Worked problem 1: a monohybrid cross
-
Worked problem 2: when the ratio breaks
In an AaBb × aabb testcross, independent assortment predicts 100 offspring in each of four classes; the excess of parental AB (165) and ab (158) over recombinant Ab (39) and aB (38) rejects 1:1:1:1 and is consistent with, but does not prove, linkage. AI-generated illustration -
Worked problem 3: treated against control (mitotic index)
Scoring 200 stained onion root-tip cells per group finds more cells in mitosis in the test solution (48 vs 30), and pooling all 400 cells sets one shared null expectation (161 interphase, 39 mitosis per group), though rejecting the null does not show whether more cells entered mitosis or stayed there longer. AI-generated illustration -
Worked problem 4: a fruit-fly choice chamber
-
What the verdict means, and what it does not
-
Before the exam
-
Going deeper
Try the Predict questions again
Five Predict questions from this lesson, on their own. Answer each one first, then open its check.
Back to the 60 flies in the humid-or-dry tube. Which is the null hypothesis: “the flies prefer the humid side” or “the flies show no preference”?
From: The five-step routine
Check your prediction
“The flies show no preference, so equal numbers end up on each side, and any difference is due to chance.” That gives expected counts of 30 and 30. “The flies prefer the humid side” is the research (alternative) hypothesis: it is what the students suspect, but it does not say how many flies to expect, so it cannot be tested directly. Naming the alternative when asked for the null is one of the most common slips on this skill.
A cross produces 400 offspring in four phenotype classes. How many degrees of freedom does its chi-square test have?
From: The five-step routine
Check your prediction
Three: four categories minus one. The number of offspring does not enter the degrees of freedom. A common wrong answer is 399, the sample size minus one, which belongs to a different calculation (the standard deviation on the same sheet).
A 3:1 ratio predicts 300 purple kernels and 100 yellow. This ear is 9 purple kernels short. Is that a reason to doubt the 3:1 model?
From: Worked problem 1: a monohybrid cross
Check your prediction
No. χ² = 1.08, well below the 1-df critical value of 3.84. A miss of 9 kernels in 400 is the kind of gap chance makes all the time.
Nearly two flies in three chose the humid side. At p = 0.05, do the students have evidence of a preference?
From: Worked problem 4: a fruit-fly choice chamber
Check your prediction
Not at p = 0.05. 3.27 < 3.84, so p > 0.05: fail to reject the null. Splits this uneven turn up over 5% of the time when 60 flies choose sides at random.
That verdict feels harsh when 37 against 23 looks like a preference. It may well be one. The test says only that 60 flies are not enough to rule out chance.
The students repeat the test with 120 new flies: 74 on the humid side and 46 on the dry side, the same 61.7% proportion. Same verdict?
From: Worked problem 4: a fruit-fly choice chamber
Check your prediction
No. Expected counts are 60 and 60. χ² = (74 − 60)²/60 + (46 − 60)²/60 = 196/60 + 196/60 = 3.267 + 3.267 ≈ 6.53. With 1 df, 6.53 > 3.84, so p < 0.05: reject the null. Just below 6.63, so 0.01 < p < 0.05.
Only the sample size changed, not the proportion, yet the same lopsidedness became too large for chance. This is the clearest picture of what the first run’s “fail to reject” meant: not enough evidence yet, never no preference.