# The Chi Square Test: AP Biology Crash Course Course: AP® Biology › Unit 5: Heredity › 5.3 Mendelian Genetics ([course hub](https://www.albert.io/blog/category/test-prep/advanced-placement/ap-biology.md)) Source: https://www.albert.io/blog/chi-square-test-ap-biology-crash-course/ · Updated November 16, 2026 The **Chi Square (χ²) test** is the one piece of statistics the AP Biology exam expects you to master — and the one most biology students dread. The good news: once you internalize the formula and the decision-making process, every χ² problem follows the exact same steps. You'll encounter this test in genetics questions (are observed phenotype ratios consistent with Mendelian predictions?), ecology questions (is species distribution random?), and experimental design questions (does your independent variable actually affect the outcome?). This review covers the statistics foundations, walks through the formula step by step, and finishes with an AP-style practice problem. ## **Null and Alternative Hypotheses** Before performing any statistical test, you need two hypotheses: - **Null hypothesis (H₀)**: There is *no significant difference* between the observed data and the expected data. Any deviation is due to random chance alone. In genetics, the null hypothesis typically states that the observed offspring ratios match the predicted Mendelian ratio. - **Alternative hypothesis (Hₐ)**: The observed data *is significantly different* from the expected data — something other than chance is influencing the results. The χ² test does not "prove" a hypothesis. It tells you whether you have sufficient evidence to **reject** the null hypothesis. If the χ² value is small (observed data is close to expected), you **fail to reject** the null hypothesis — the data is consistent with chance. If the χ² value is large, you **reject** the null hypothesis — something beyond chance is at work. **Coin flip example:** If you flip a fair coin 100 times, the null hypothesis predicts 50 heads and 50 tails. The alternative hypothesis predicts a different ratio. If you observe 55 heads and 45 tails, is that close enough to 50:50 to be explained by chance? The χ² test answers this question mathematically. ## **Defining the Variables** The Chi Square formula is provided on the AP Biology Equations and Formulas sheet — you do not need to memorize it, but you absolutely need to understand every part of it. ![chi square](https://www.albert.io/blog/wp-content/uploads/2019/12/32227246024_0e3a3da395_b.jpg) *[*Image Source: Wikimedia Commons*](https://www.flickr.com/photos/sustainablerural/32227246024/sizes/l/)* Here is what each symbol means: | Symbol | Name | What It Means | | --- | --- | --- | | **χ²** | Chi squared | The test statistic you solve for — a single number that measures how far your observed data deviates from expected data | | **Σ** | Sigma (summation) | "Add up all the following calculations" — you compute (O − E)²/E for each category and sum them | | **O** | Observed value | The actual count you recorded in your experiment (e.g., 55 heads) | | **E** | Expected value | The count you would predict if the null hypothesis were true (e.g., 50 heads) | **The formula in words:** For each category in your data, subtract the expected value from the observed value, square the result (to eliminate negative signs), divide by the expected value (to normalize for scale), and then add up all the categories. The larger the χ² value, the greater the deviation between what you observed and what you expected. ## **Working out the Coin Flip** You flipped a coin 100 times and recorded these results: | | Observed (O) | Expected (E) | (O − E)²/E | | --- | --- | --- | --- | | **Heads** | 55 | 50 | (55 − 50)² / 50 = 25/50 = **0.5** | | **Tails** | 45 | 50 | (45 − 50)² / 50 = 25/50 = **0.5** | | **Sum (χ²)** | | | **1.0** | Your χ² value is **1.0**. But what does that number mean? Is 1.0 big enough to reject the null hypothesis, or is it small enough that the deviation could be random chance? To answer that, you need degrees of freedom and a critical value table. ## **Degrees of Freedom and Critical Values** **Degrees of freedom (df)** = number of categories − 1. In the coin flip, there are 2 categories (heads and tails), so df = 2 − 1 = **1**. ![A chi-square distribution: a statistic beyond the critical value lands in the rejection region.](https://www.albert.io/blog/wp-content/uploads/2026/11/chi-square-distribution-test-statistic-in-critical-region.png) A chi-square distribution: a statistic beyond the critical value lands in the rejection region. *Image: Tomasz59, CC BY-SA 4.0, via [Wikimedia Commons](https://commons.wikimedia.org/wiki/File%3AChi-square_distribution_%E2%80%94_test_statistic_in_critical_region.svg)* Why subtract 1? Once you know the total sample size and all but one category count, the last category is mathematically determined. That constrained category doesn't add independent information, so it's excluded from the degrees of freedom. ![Chi-square critical values table listing degrees of freedom 1 to 10 against probabilities from 0.99 to 0.01](https://www.albert.io/blog/wp-content/uploads/2019/12/table-1.jpg) *[*Image Source: Malouff's AP Bio Blog*](https://malouffapbioblog.files.wordpress.com/2013/05/table-1.jpg)* Using the critical values table above, locate your degrees of freedom (1) in the left column, then read across to the **p = 0.05** column. The critical value is **3.84**. The p = 0.05 threshold means: "There is only a 5% probability that a deviation this large (or larger) would occur by chance alone." In other words, if your χ² exceeds the critical value, you can be 95% confident that the deviation is NOT due to chance. **The decision rule:** - If χ² **≥** critical value → **reject** the null hypothesis (the difference is statistically significant) - If χ² **<** critical value → **fail to reject** the null hypothesis (the difference could be due to chance) ## **Coin Flip Results** Our χ² = 1.0 and the critical value at p = 0.05 with 1 degree of freedom = 3.84. Since **1.0 < 3.84**, we **fail to reject the null hypothesis**. The deviation of 55:45 from the expected 50:50 is small enough to be explained by random chance alone. The coin appears to be fair. **Important language note:** Scientists say "fail to reject the null hypothesis" rather than "accept the null hypothesis." This distinction matters on the AP exam — you never "prove" the null is true; you only determine whether you have enough evidence to reject it. ## **AP Biology Exam Question** This question was adapted from the [2013 AP Biology exam](https://secure-media.collegeboard.org/ap-student/pdf/biology/ap-2013-biology-free-response-questions.pdf). **Scenario:** In an investigation of fruit-fly behavior, a covered choice chamber tests whether flies prefer glucose. 60 flies are introduced into the middle of the chamber. A ripe banana is placed at one end and an unripe banana at the other. Fly positions are recorded at 1 minute and 10 minutes: | Time (minutes) | End With Ripe Banana | Middle of Chamber | End With Unripe Banana | | --- | --- | --- | --- | | 1 | 21 | 18 | 21 | | 10 | 45 | 3 | 12 | **Step 1: State the null hypothesis.** If the banana has no effect on fly distribution, flies should distribute evenly across all three zones: 60 flies ÷ 3 zones = **20 flies per zone**. **Step 2: Calculate χ² for the 10-minute data.** | Zone | Observed (O) | Expected (E) | (O − E)²/E | | --- | --- | --- | --- | | **Ripe banana end** | 45 | 20 | (45 − 20)² / 20 = 625/20 = **31.25** | | **Middle** | 3 | 20 | (3 − 20)² / 20 = 289/20 = **14.45** | | **Unripe banana end** | 12 | 20 | (12 − 20)² / 20 = 64/20 = **3.20** | | **Sum (χ²)** | | | **48.90** | **Step 3: Determine degrees of freedom.** 3 categories − 1 = **2 degrees of freedom**. **Step 4: Compare to critical value.** At df = 2 and p = 0.05, the critical value is **5.99**. Our χ² of 48.90 is far greater than 5.99. **Step 5: Make a conclusion.** We **reject the null hypothesis**. The fly distribution is NOT random — the ripe banana significantly influences fly behavior. Flies show a strong preference for the ripe banana end of the chamber, likely due to chemotaxis toward glucose and volatile fruit compounds. ## Test-Taking Strategies **Mnemonics and memory shortcuts:** - **"OESC" — Observe, Expect, Subtract, Compare.** This is your workflow for every χ² problem: record Observed values, calculate Expected values, Subtract and square to get χ², Compare to the critical value. Run through OESC and you'll never miss a step. - **"df = categories minus 1"** — Degrees of freedom is always the number of phenotype classes (or experimental groups) minus one. For a monohybrid cross with 2 phenotypes, df = 1. For a dihybrid cross with 4 phenotypes, df = 3. - **"Big χ² = Big difference = Reject."** A large χ² value means your data is far from expected, so you reject the null hypothesis. A small χ² means your data fits the expected pattern. - **"Fail to reject, don't accept."** AP graders specifically look for this language. Never write "accept the null hypothesis" — write "fail to reject the null hypothesis." **Cross-topic connections:** - **Mendelian genetics (Unit 5)** — The most common AP Biology χ² question gives you offspring counts from a genetic cross and asks whether they fit a predicted Mendelian ratio (3:1, 9:3:3:1, 1:1:1:1). The expected values come directly from the predicted ratio multiplied by the total offspring count. - **Hardy-Weinberg equilibrium (Unit 7)** — You can use χ² to test whether a population's observed genotype frequencies match Hardy-Weinberg expected frequencies, helping determine whether evolution is occurring. - **Experimental design** — Any lab-based FRQ where you collect categorical count data (flies in zones, plant growth in conditions, etc.) could ask you to perform a χ² test to determine if your results are statistically significant. **Common question formats:** - **"Perform a chi-square analysis on the following data and state your conclusion."** This is the most direct format. Show your work in a table (O, E, (O−E)²/E for each category), state df, state the critical value at p = 0.05, and explicitly state whether you reject or fail to reject the null hypothesis. - **"The expected ratio is 9:3:3:1. Do the observed results support this ratio?"** Convert the ratio to expected counts (multiply each ratio component by total offspring ÷ 16), then run χ². - **"A student claims the data supports independent assortment. Use a statistical test to evaluate this claim."** This is a χ² question in disguise — set up a 9:3:3:1 expected ratio and test it. **Frequent student mistakes:** - **Using percentages instead of raw counts.** The χ² formula requires actual counts (number of organisms, number of events), not percentages or proportions. If the problem gives percentages, convert them to counts first. - **Calculating expected values incorrectly.** For a 3:1 ratio with 100 total offspring, expected = 75 and 25 (not 3 and 1). Always multiply the ratio by the total and divide by the sum of the ratio components. - **Forgetting to sum across ALL categories.** The Σ in the formula means you must add up (O − E)²/E for every category. Missing one category gives a wrong χ² value. - **Mixing up the conclusion language.** If χ² > critical value → reject H₀. If χ² < critical value → fail to reject H₀. Students frequently get this backwards. - **Not stating degrees of freedom.** Many FRQ rubrics require you to explicitly state df. Always include it. **Test-day shortcuts:** - **Set up a table immediately.** The moment you see a χ² problem, draw a table with columns for Category, O, E, and (O−E)²/E. This organization prevents arithmetic errors and shows graders your systematic approach. - **Memorize key critical values:** At p = 0.05, df = 1 → 3.84; df = 2 → 5.99; df = 3 → 7.81. These three cover monohybrid crosses (2 phenotypes, df = 1), three-category experiments such as the three-zone fly-choice problem (df = 2), and dihybrid crosses (4 phenotypes, df = 3). The full table is on your formula sheet, but knowing these by heart saves time. - **Double-check: do your expected values sum to the total?** If you have 100 total offspring and your expected values add to 97, you've made an error. The sum of expected values must equal the sum of observed values. **Time management:** A χ² problem on the AP FRQ typically takes 8–10 minutes. Spend 1 minute setting up the table, 3 minutes on calculations, 1 minute looking up the critical value, and 2 minutes writing a clear conclusion with proper statistical language. If the arithmetic is getting messy, round intermediate steps — graders award points for correct process even with minor rounding differences. Previous topic: [5.2 Meiosis and Genetic Diversity](https://www.albert.io/blog/genetic-diversity-ap-biology-review.md) Next topic: [5.4 Non-Mendelian Genetics](https://www.albert.io/blog/non-mendelian-genetics-ap-biology-review.md)