Chalk−1

Biology · Introductory biology · Worked example

Test Hardy–Weinberg equilibrium with chi-square

A sample of 100 individuals has 45 AA, 30 Aa and 25 aa. Test at α = 0.05 whether the genotypes fit Hardy–Weinberg proportions.

Estimate p from the sample

The 200 gene copies include 2(45) + 30 = 120 A copies, so p = 0.6 and q = 0.4.

2⁢(45)+30200=0.6

Find the expected counts

Hardy–Weinberg proportions are p² = 0.36, 2pq = 0.48 and q² = 0.16. Multiply each by the 100 individuals.

100⁢(0.36)=36100⁢(0.48)=48100⁢(0.16)=16

Compute χ²

Each genotype contributes (observed − expected)²/expected. The differences are 9, −18 and 9.

9236+18248+9216=14.0625
9236+18248+9216=14.0625

Count the degrees of freedom

Three genotype classes give 3 − 1 = 2, and estimating p from the same data uses up one more, which leaves 1 degree of freedom.

3−1−1=1

Find the p-value and decide

With 1 degree of freedom, P(χ² ≥ 14.06) ≈ 0.0002. That is far below 0.05, so reject Hardy–Weinberg proportions for this sample.

Read the pattern

The sample has 30 heterozygotes where 48 were expected, and more homozygotes than expected. A heterozygote deficit is what inbreeding, or pooling two separate subpopulations into one sample, produces. The test shows that some condition fails; it does not name which one.

Result

χ² ≈ 14.06 with 1 degree of freedom and p ≈ 0.0002: the sample departs from Hardy–Weinberg proportions, with too few heterozygotes.

Your turn

Test the fish sample from the first example, 90 AA, 80 Aa and 30 aa, against its expected counts 84.5, 91 and 24.5.

Show the answer and explanation

χ² ≈ 2.92 with 1 degree of freedom and p ≈ 0.087: consistent with Hardy–Weinberg proportions at α = 0.05.

The differences are 5.5, −11 and 5.5, so χ² = 5.5²/84.5 + 11²/91 + 5.5²/24.5 ≈ 0.358 + 1.330 + 1.235. A p-value above 0.05 is no evidence of a departure, not proof of equilibrium.

5.5284.5+11291+5.5224.5≈2.92
5.5284.5+11291+5.5224.5≈2.92

Keep exploring

In Statistics, Distributions shows the right-tail probability for χ² = 14.0625 with 1 degree of freedom, about 0.00018. The Hardy–Weinberg tool reaches the same test through Send to… from the counts 45, 30 and 25.

Return to the concept →
Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

Make it concrete

Try in the workspace

Open the example inputs, change a value and keep a useful result on your board.

Find the p-value in Statistics Open the Hardy–Weinberg tool Open worked example on a board Hardy–Weinberg equation in Biology Reference

Your existing work stays on this device. Examples open as editable copies.