Lesson 1: Quantitative Biology: Chi-Square, Hardy-Weinberg and Data AnalysisAP Deep Dive
The main course taught you the mechanics of chi-square, Hardy–Weinberg and error bars. This deep dive is about judgement: knowing which test a data set is asking for, executing it without arithmetic slips, and writing the conclusion sentence that earns the final point. On recent exams, the quantitative FRQs are where 5s separate from 4s — not because the maths is hard, but because students use percentages instead of counts, pick the wrong degrees of freedom, or write "the null hypothesis is accepted."
Chi-square: goodness of fit versus independence
Two different questions hide behind the same χ² statistic. A goodness-of-fit test compares one set of observed counts against a ratio predicted by a hypothesis (3:1, 9:3:3:1, 1:1:1:1). A test of independence uses a two-way table and asks whether two variables are associated; the expected counts come from the data themselves, E = (row total × column total) / grand total, and the degrees of freedom are (rows − 1)(columns − 1), not categories − 1. Choosing between them is the first scored decision on any data question.
Worked example 1 — a dihybrid test. A dihybrid cross predicts 9:3:3:1. In 556 offspring you count 315, 108, 101 and 32 in the four classes. Expected counts are 312.75, 104.25, 104.25 and 34.75. The contributions (O − E)²/E are tiny: 0.016, 0.135, 0.101 and 0.218, giving χ² = 0.47 with df = 3. The critical value at p = 0.05 is 7.81. Because 0.47 < 7.81, we fail to reject the null hypothesis: the deviations are consistent with chance, so the data support independent assortment of the two genes. Notice the discipline: counts, not percents; the comparison stated; the conclusion tied back to the biology.
Worked example 2 — detecting linkage. A testcross (AaBb × aabb) should give 1:1:1:1 if the genes assort independently. You observe 88, 12, 10 and 90 (n = 200, expected 50 each). Now χ² = (38² + 38² + 40² + 40²)/50 = 121.8, vastly above 7.81. Reject the null: the genes are linked. The two large classes are the parental combinations; the recombinant classes total 22/200 = 11%, which estimates the map distance — about 11 map units. The same statistic that "passed" a hypothesis in example 1 destroys one here, and the pattern of the counts (two big, two small) is the signature to recognise.
Standard error and the honest reading of error bars
The standard error of a mean, SE = s/√n, measures how far a sample mean is likely to sit from the true mean. A 95% confidence interval is approximately mean ± 2 SE. Worked example: seedlings have mean height 24.0 cm with s = 4.0 cm and n = 16, so SE = 1.0 cm and the 95% CI runs from about 21.9 to 26.1 cm. The top-band skill is interpretation. If two 95% CIs do not overlap, the difference is significant. If they do overlap, you may not conclude "no difference" — overlapping intervals can still hide a significant difference, because the standard error of a *difference* is smaller than the sum of the two separate uncertainties. Exam questions reward students who say "the overlap is suggestive but not conclusive; a statistical test is needed" over students who overclaim in either direction. Also internalise the scaling law: quadrupling n halves the SE. Doubling precision costs four times the data — a favourite MCQ relationship.
Hardy–Weinberg as a measuring instrument
Hardy–Weinberg is not just an equation to solve; it is a null model. Compute the genotype counts the population *would* have at equilibrium, then measure how reality departs from it. Worked example — selection in one generation. A population starts with p = 0.6, q = 0.4, so genotype frequencies are 0.36 AA, 0.48 Aa, 0.16 aa. Suppose aa individuals do not survive to reproduce. The surviving gene pool is 0.84 of the original. Allele A among survivors: all of the AA alleles plus half the Aa alleles = 0.36 + 0.24 = 0.60, so p stays 0.60/0.84 = 0.714; allele a survives only inside heterozygotes: 0.24/0.84 = 0.286. One generation of selection moved q from 0.400 to 0.286 — and notice why recessive alleles are so hard to eliminate: at low frequency almost all copies hide in heterozygotes where selection cannot see them.
A second subtlety the top band knows: when you estimate allele frequencies *from the same data* you then test, you lose an extra degree of freedom. Testing three genotype classes with p estimated from the sample gives df = 3 − 1 − 1 = 1, not 2.
Water potential: the multi-step version
Solute potential is Ψs = −iCRT (with R = 0.0831 L·bar·mol⁻¹·K⁻¹, T in kelvin). Potato cores are placed in sucrose solutions and the percentage change in mass recorded: 0.1 M → +8%, 0.2 M → +3%, 0.3 M → 0%, 0.4 M → −5%, 0.5 M → −9%. Zero change at 0.3 M means the tissue's water potential equals the solution's there; with no pressure potential in an open beaker, Ψcell ≈ Ψs = −(1)(0.3)(0.0831)(298) = −7.4 bar ≈ −0.74 MPa. Now the prediction step: place those cells in a solution of Ψ = −0.30 MPa. Water moves from higher (less negative) to lower (more negative) potential, so water enters the cells (−0.30 > −0.74) until pressure potential builds in the walled cells. Examiners chain exactly these steps: graph → isotonic point → calculation → prediction.
Common mistakes at the top band
- Feeding percentages into χ². The statistic needs raw counts; 78% vs 75% and 780 vs 750 give wildly different χ² values because sample size carries the information about chance.
- Wrong df in an independence test. A 3 × 2 table has df = 2, not 5.
- Writing "accept the null hypothesis." You fail to reject it; the data are *consistent with* the model, never proof of it.
- Solving 2pq before finding p and q. Always extract q from q² first, get p = 1 − q, then compute 2pq.
- Confusing SD with SE. SD describes the spread of individuals; SE describes the precision of the mean. Error bars on a graph of means should be SE (or CI), and the caption must say which.
AP Exam Experience
1. In a population at Hardy–Weinberg equilibrium, 9% of individuals express a recessive trait. What percentage of the population are carriers of the recessive allele?
- (A) 9%
- (B) 21%
- (C) 42%
- (D) 49%
Answer: (C). q² = 0.09, so q = 0.3 and p = 0.7. Carriers are the heterozygotes: 2pq = 2(0.7)(0.3) = 0.42 = 42%. Choice (B) comes from the error 2q = ... no — 21% is pq without the factor of 2; (D) is p², the dominant homozygotes.
2. A researcher cross-tabulates 600 sampled fish by habitat (3 types) and diet (2 types) and runs a chi-square test of independence. The degrees of freedom are
- (A) 1
- (B) 2
- (C) 5
- (D) 599
Answer: (B). For a two-way table, df = (rows − 1)(columns − 1) = (3 − 1)(2 − 1) = 2. Choice (C) is "cells − 1," the goodness-of-fit rule misapplied.
3. A biologist measures the mean wing length of flies from two populations, each with n = 25, and plots means with ±2 SE bars. She then increases each sample to n = 100 and repeats. The new error bars will be
- (A) the same width, because SE depends only on the standard deviation
- (B) half as wide, because SE falls by a factor of √4
- (C) one quarter as wide, because SE is inversely proportional to n
- (D) twice as wide, because larger samples vary more
Answer: (B). SE = s/√n. Quadrupling n from 25 to 100 multiplies √n by 2, so the SE — and the bars — halve. Choice (C) states the wrong functional relationship.
Free-response question. A population of 1,000 plants is genotyped at a locus with two alleles: 350 AA, 500 Aa, 150 aa.
(a) Calculate the allele frequencies p and q from these counts. (b) Calculate the genotype counts expected under Hardy–Weinberg equilibrium, perform a chi-square test, and state your conclusion. (Use df = 1 and a critical value of 3.84 at p = 0.05.) (c) A cell from this plant species has Ψs = −0.74 MPa and negligible pressure potential. It is placed in a solution with Ψ = −0.30 MPa. State the direction of net water movement and justify it.
Scoring guideline.
- (a) 2 points. 1 point for counting alleles correctly: A alleles = 2(350) + 500 = 1,200 of 2,000, so p = 0.60; 1 point for q = 0.40 (from a alleles = 2(150) + 500 = 800, or q = 1 − p). Using phenotype ratios instead of allele counts earns neither point.
- (b) 3 points. 1 point for expected counts 360 AA, 480 Aa, 160 aa (from p², 2pq, q² × 1,000). 1 point for χ² = (10²/360) + (20²/480) + (10²/160) = 0.28 + 0.83 + 0.63 = 1.74 (accept 1.7–1.8). 1 point for the conclusion: 1.74 < 3.84, so fail to reject the null — the population is consistent with Hardy–Weinberg equilibrium at this locus (no evidence of selection, migration or non-random mating acting strongly). "The population is in equilibrium, proven" earns no conclusion point; the hedging is the science.
- (c) 2 points. 1 point for the direction: water moves into the cell. 1 point for the justification: water moves from higher water potential (−0.30 MPa in the solution) to lower water potential (−0.74 MPa in the cell); the cell's potential is more negative. Answers that compare "concentrations" without potentials earn the direction point only.
🎬 Watch & Learn
Free YouTube video lessons on “Quantitative Biology: Chi-Square, Hardy-Weinberg and Data Analysis” — pick a result below:
- Quantitative Biology: Chi-Square, Hardy-Weinberg and Data Analysis: full video lesson
- Quantitative Biology: Chi-Square, Hardy-Weinberg and Data Analysis on Bozeman Science
- Quantitative Biology: Chi-Square, Hardy-Weinberg and Data Analysis on Amoeba Sisters
- Quantitative Biology: Chi-Square, Hardy-Weinberg and Data Analysis on Khan Academy
✅ Check your understanding
Quick recall check, generated from this lesson’s key terms. It is practice only and is not graded.