Biology · D3.2 · HL only

The chi-squared test in genetics

Real counts never match a 9 : 3 : 3 : 1 ratio exactly. Mendel’s own dihybrid peas came out at 315 : 108 : 101 : 32. The chi-squared test asks whether a difference like that is small enough to be chance, and in IB questions the calculation is the easy part; the marks people lose are on the hypotheses and on the sentence that interprets the result.

Written from the stage “Dihybrid crosses, linkage and the chi-squared test” of the 7Quest Biology course. The questions are our own, in the style of the exam; none are from past papers.

What the test is asking

The offspring you count are a sample of all the offspring the cross could produce, so the numbers wobble around the expected ratio by chance. The test compares the observed counts with the counts the ratio predicts and gives one number, χ2\chi^2, that is larger the further apart they are.

You start with two hypotheses. The null hypothesis H₀ is that there is no significant difference between the observed and expected numbers: for a dihybrid cross, that the two genes assort independently. The alternative hypothesis H₁ is that there is a significant difference.

The calculation step by step

First work out the expected number for each class: total × fraction. For a 9 : 3 : 3 : 1 ratio the fractions are 916\frac{9}{16}, 316\frac{3}{16}, 316\frac{3}{16} and 116\frac{1}{16}; for Mendel’s 556 seeds that gives 312.75, 104.25, 104.25 and 34.75. For a test cross with unlinked genes the ratio is 1 : 1 : 1 : 1, so each class expects a quarter of the total.

Then calculate

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

with one term per class. Laying it out as a table with columns O, E, O − E, (O − E)² and (O − E)²/E keeps the working clear and earns method marks even if you slip on the arithmetic.

The degrees of freedom are the number of classes minus one: 3 for four phenotypes, 1 for a 3 : 1 monohybrid cross.

Critical values and the decision

Compare your χ2\chi^2 with the critical value for your degrees of freedom at p = 0.05. The values you need most often are 3.841 for 1 degree of freedom, 5.991 for 2 and 7.815 for 3; exam questions give you a table.

If χ2\chi^2 is greater than the critical value, reject H₀: a difference this large would happen by chance less than 5% of the time, so the results do not fit the expected ratio. If it is smaller, you cannot reject H₀: the difference can be explained by chance.

Write the comparison and its meaning in one sentence, for example “χ2=12.4>7.815\chi^2 = 12.4 > 7.815, so H₀ is rejected; the results do not fit 9 : 3 : 3 : 1, so the genes may be linked”. Accepting H₀ does not prove the genes are unlinked; it only means the data give no evidence that they are.

Linked genes and recombinants

Genes whose loci are on the same chromosome are linked: they tend to be inherited together, so they do not assort independently unless crossing over separates them. In a test cross of a double heterozygote with a double homozygous recessive, unlinked genes give four classes in roughly equal numbers. Linked genes give two large parental classes and two small recombinant classes, made by crossing over between the loci.

The course example uses tomatoes with height and fruit shape linked: 83 tall round, 79 dwarf elongated, 21 tall elongated and 17 dwarf round. The recombinants are 21+17200=19%\frac{21 + 17}{200} = 19\%, far below the 50% expected for unlinked genes, and a chi-squared test against 1 : 1 : 1 : 1 would reject H₀ easily.

Where the marks go

  • Using percentages or proportions instead of the actual counts. The test only works on counts.
  • Taking the number of individuals minus one as the degrees of freedom. It is the number of classes minus one.
  • Writing the null hypothesis as “the genes are linked”. H₀ is always “no significant difference” from the expected ratio.
  • Stopping at “χ² is greater than the critical value”. Say what that means: reject H₀, the results do not fit the ratio, and suggest why (linkage).
  • Saying the test “proves” independent assortment when H₀ is not rejected.

Three questions to try

Answer on paper first, then open the markscheme and mark yourself honestly. A mark only counts if your answer says that point.

Calculate4 marksPaper 2 styleHL

Two pea plants heterozygous for seed shape (round dominant to wrinkled) and pod colour (green dominant to yellow) are crossed. The offspring are: 290 round green, 106 round yellow, 92 wrinkled green and 40 wrinkled yellow. The critical value of χ2\chi^2 for 3 degrees of freedom at p = 0.05 is 7.815.
Use a chi-squared test to determine whether these results fit a 9 : 3 : 3 : 1 ratio.

Show the markscheme

Markscheme (4 marks)

  1. Expected values from the total of 528: 297, 99, 99 and 33 [1]
  2. Terms (O−E)2E\frac{(O - E)^2}{E}: 0.165, 0.495, 0.495 and 1.485 [1]
  3. χ2=2.64\chi^2 = 2.64 [1]
  4. 2.64 < 7.815, so H₀ is not rejected: the results fit a 9 : 3 : 3 : 1 ratio and the difference is due to chance (consistent with independent assortment) [1]

A full-marks answer

H₀: there is no significant difference between the observed and expected numbers. The total is 290 + 106 + 92 + 40 = 528, so the expected numbers are 916×528=297\frac{9}{16} \times 528 = 297, 316×528=99\frac{3}{16} \times 528 = 99, 99 and 116×528=33\frac{1}{16} \times 528 = 33.
χ2=(290−297)2297+(106−99)299+(92−99)299+(40−33)233=0.165+0.495+0.495+1.485=2.64\chi^2 = \frac{(290 - 297)^2}{297} + \frac{(106 - 99)^2}{99} + \frac{(92 - 99)^2}{99} + \frac{(40 - 33)^2}{33} = 0.165 + 0.495 + 0.495 + 1.485 = 2.64.
With 4 − 1 = 3 degrees of freedom the critical value is 7.815. Because 2.64 is less than 7.815, H₀ is not rejected: the differences can be put down to chance, and the results are consistent with the two genes assorting independently.

Evaluate4 marksPaper 2 styleHL

In fruit flies, a fly heterozygous for body colour and wing shape is test-crossed with a fly homozygous recessive for both genes. The 400 offspring are: 168 grey body normal wings, 160 black body vestigial wings, 38 grey body vestigial wings and 34 black body normal wings. The critical value for 3 degrees of freedom at p = 0.05 is 7.815.
Calculate χ2\chi^2 for a 1 : 1 : 1 : 1 ratio and evaluate the hypothesis that the two genes are unlinked.

Show the markscheme

Markscheme (4 marks)

  1. Expected number for each class is 100 [1]
  2. χ2=682+602+622+662100=164\chi^2 = \frac{68^2 + 60^2 + 62^2 + 66^2}{100} = 164 (accept 164.24) [1]
  3. 164 > 7.815, so H₀ is rejected: the results do not fit 1 : 1 : 1 : 1 and the genes are not assorting independently [1]
  4. Two parental classes are large and the two recombinant classes are small, (38 + 34)/400 = 18% recombinants, so the genes are linked [1]

A full-marks answer

If the genes were unlinked, a test cross would give the four classes in a 1 : 1 : 1 : 1 ratio, so the expected number for each is 4004=100\frac{400}{4} = 100. Then χ2=682100+602100+622100+662100=46.24+36.00+38.44+43.56=164\chi^2 = \frac{68^2}{100} + \frac{60^2}{100} + \frac{62^2}{100} + \frac{66^2}{100} = 46.24 + 36.00 + 38.44 + 43.56 = 164.
This is far above the critical value of 7.815, so H₀ is rejected and the hypothesis that the genes are unlinked is not supported. The pattern shows why: grey normal and black vestigial are the two large parental classes, while grey vestigial and black normal are small recombinant classes made by crossing over. Recombinants are 38+34400=18%\frac{38 + 34}{400} = 18\%, well below 50%, so the two genes are linked on the same chromosome.

Calculate3 marksPaper 2 styleHL

A monohybrid cross between two heterozygous plants gives 132 tall and 28 dwarf offspring. The critical value of χ2\chi^2 for 1 degree of freedom at p = 0.05 is 3.841. Calculate χ2\chi^2 for a 3 : 1 ratio and state the conclusion.

Show the markscheme

Markscheme (3 marks)

  1. Expected: 120 tall and 40 dwarf from a total of 160 [1]
  2. χ2=122120+12240=1.2+3.6=4.8\chi^2 = \frac{12^2}{120} + \frac{12^2}{40} = 1.2 + 3.6 = 4.8 [1]
  3. 4.8 > 3.841, so H₀ is rejected: the results differ significantly from 3 : 1 [1]

A full-marks answer

The total is 160, so a 3 : 1 ratio predicts 120 tall and 40 dwarf. χ2=(132−120)2120+(28−40)240=1.2+3.6=4.8\chi^2 = \frac{(132 - 120)^2}{120} + \frac{(28 - 40)^2}{40} = 1.2 + 3.6 = 4.8. There are two classes, so 1 degree of freedom and a critical value of 3.841. Because 4.8 is greater than 3.841, H₀ is rejected: there are significantly fewer dwarf plants than a 3 : 1 ratio predicts, which could mean, for example, that the dwarf seedlings survive less well.

Where this is in 7Quest

It is in Mendel’s Garden, the part of the Biology map for Reproduction, inheritance and homeostasis:

  • Dihybrid crosses, linkage and the chi-squared testHLSyllabus D3.2 · 2 exam-style questions

Each stage has a short lesson, quick questions, a minigame and exam-style questions marked point by point, and what you get wrong comes back in your review a few days later. If this is the topic you find hardest, you can choose Reproduction, inheritance and homeostasis as your free Biology topic and do all of it without paying or giving a card. Full access is a subscription per subject that renews each September and stops after your final exams, so nothing is charged once you have finished (prices and details).

Questions students ask about this

Is the chi-squared test on the SL syllabus?

No. In the 2025 guide, dihybrid crosses, gene linkage and the chi-squared test are part of the HL extension of D3.2. SL students do monohybrid crosses, codominance, sex linkage and pedigrees.

Do I have to memorise critical values?

No. A table of critical values, or the value you need, is given in the question. You do need to know how to choose the right degrees of freedom.

Why should every expected value be at least 5?

With very small expected numbers a single individual makes a large change to (O−E)2/E(O - E)^2/E, and the test becomes unreliable. That is one reason the samples in genetics experiments are large.