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, , 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 , , and ; 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
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 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 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 “, 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 , far below the 50% expected for unlinked genes, and a chi-squared test against 1 : 1 : 1 : 1 would reject H₀ easily.