Real results never land exactly on 9 : 3 : 3 : 1. The question is whether they are close enough to call it chance, or so far off that something else must be going on. The chi-squared test answers exactly that — and it is one of the most predictable calculations in the whole course.
📚 What you need to know
Chi-squared (χ2) tests whether the difference between observed and expected results is significant, or just chance.
It is used on categorical data — counts of individuals in groups, never percentages or measurements.
Null hypothesis (H0): there is no significant difference; any difference is due to chance. Alternative hypothesis (H1): there is a significant difference.
Degrees of freedom = number of classes − 1.
Biologists use a critical probability of 0.05. Compare your χ2 to the critical value in that column, on the correct degrees-of-freedom row.
χ2smaller than the critical value → accept H0. χ2larger → reject H0, and look for a cause such as gene linkage.
What the test is really asking
Toss a coin 100 times and you will not get exactly 50 heads. Getting 47 would not surprise anyone. Getting 12 would — you would start to suspect the coin.
Chi-squared does the same job with genetics data. It puts a number on how far your counts are from what the ratio predicted, then tells you how likely a gap that size is by chance alone.
The chi-squared formula
χ2 = Σ (O − E)2 ÷ E where O = observed number, E = expected number, Σ = sum of
Look at what the formula is doing. (O − E) is the gap. Squaring it removes the minus signs, so gaps in both directions count. Dividing by E scales it — a gap of 10 matters far more when you expected 20 than when you expected 200.
The method
🧩 Six steps, always in this order
State your hypotheses. H0: no significant difference between observed and expected. H1: there is one.
Work out the expected numbers from the ratio. Divide the total by the sum of the ratio parts, then multiply.
Build a table with columns for O, E, O − E, (O − E)2 and (O − E)2/E.
Add up the last column — that sum is χ2.
Find the degrees of freedom (classes − 1) and read the critical value at p = 0.05.
Compare and conclude. Below the critical value, accept H0. Above it, reject H0.
Build the table even if you can do the arithmetic in your head. Marks are given for the working, and a table stops you pairing an observed value with the wrong expected one — the single most common error in this calculation.
Critical values at a glance
Degrees of freedom
p = 0.10
p = 0.05
p = 0.01
p = 0.001
1
2.71
3.84
6.64
10.83
2
4.60
5.99
9.21
13.82
3
6.25
7.82
11.34
16.27
4
7.78
9.49
13.28
18.46
A dihybrid cross has four phenotype classes, so the degrees of freedom are 4 − 1 = 3, and the number you almost always end up comparing against is 7.82.
The further right your value falls, the less likely the difference is to be chance. Landing past the dashed line is what “significant” means.
Worked examples
WORKED EXAMPLE 1
A dihybrid cross in rabbits was expected to give a 9 : 3 : 3 : 1 ratio. Of 320 offspring, the counts were 171, 65, 68 and 16. Carry out a chi-squared test and state your conclusion.
Step 1: hypotheses
H0: no significant difference between observed and expected numbers
Step 2: expected numbers320 ÷ 16 = 20 per part → 180, 60, 60, 20Step 3: (O − E)2/E for each class81 ÷ 180 = 0.45025 ÷ 60 = 0.41764 ÷ 60 = 1.06716 ÷ 20 = 0.800Step 4: add them upχ2 = 2.73Step 5: degrees of freedom and critical value4 − 1 = 3, so the critical value at p = 0.05 is 7.822.73 < 7.82, so accept H₀There is no significant difference — the results fit a 9 : 3 : 3 : 1 ratio, and the small differences are due to chance. The genes behave as if unlinked.
Phenotype class
Observed (O)
Expected (E)
O − E
(O − E)2
(O − E)2/E
Brown coat, long ears
171
180
−9
81
0.450
Brown coat, short ears
65
60
+5
25
0.417
Grey coat, long ears
68
60
+8
64
1.067
Grey coat, short ears
16
20
−4
16
0.800
Total
320
320
—
—
2.73
WORKED EXAMPLE 2
A second cross, also expected to give 9 : 3 : 3 : 1 from 320 offspring, gave counts of 240, 25, 22 and 33. Calculate χ2 and suggest an explanation.
Step 1: expected numbers are the same180, 60, 60, 20Step 2: (O − E)2/E for each class3600 ÷ 180 = 20.001225 ÷ 60 = 20.421444 ÷ 60 = 24.07169 ÷ 20 = 8.45Step 3: totalχ2 = 72.93Step 4: compare with 7.82 (3 df, p = 0.05)72.93 is far greater than 7.82Reject H₀ — the difference is significantFar too many parental-type offspring and far too few of the other two classes. The likely cause is autosomal gene linkage: the two genes are on the same chromosome, so they did not assort independently.
Reading the pattern, not just the number. In the second example the two big classes are the parental combinations and the two small ones are the recombinants. That shape — parentals too high, recombinants too low — is the fingerprint of linkage. Always describe the pattern as well as quoting χ2.
Samples and populations
You cannot count every organism in a population, so you work with a sample and assume it represents the whole. Larger samples are more representative, which is why a chi-squared test on 40 offspring is much weaker evidence than the same test on 400.
This is also why the test uses raw counts rather than percentages. Converting to percentages throws away the sample size, and sample size is exactly what tells you how seriously to take a difference.
💡 Exam tip
Write both hypotheses out before calculating. It is often the first mark.
Use the table layout with one row per phenotype class — it is the clearest way to show working.
Check your expected numbers add up to the observed total. If they do not, you have made an arithmetic slip.
Degrees of freedom = classes − 1, not the number of individuals or genes.
End with a biological conclusion, not just “reject H0“. Say what that means about the cross.
Suggest linkage when a dihybrid cross gives a significant result — that is the explanation IB is looking for.
⚠ Common mix-up
Using percentages instead of counts. Chi-squared only works on actual numbers of individuals.
Dividing by O instead of E. The denominator is always the expected value.
Forgetting to square the difference, so the plus and minus gaps cancel out.
Getting the comparison backwards. Bigger than the critical value means significant, so you reject H0.
Using 4 degrees of freedom for four classes. It is 3.
Saying “the results prove the genes are linked”. The test supports it; other causes are possible.
Up next: Genes & Polypeptides (Skills) — how gene loci are named, and how databases let you look up any human gene and its protein.
Want this explained one-to-one?
Book a free session with an experienced IB Biology tutor and get your trickiest topics made simple.