Evolution

Hardy-Weinberg Equilibrium With Worked Problems

Work through the Hardy-Weinberg equation with six solved problems, including carriers, X-linked genes and a chi-square test.

Key takeaways

  • For two alleles, p + q = 1 and the expected genotype frequencies are p², 2pq and q².
  • The model assumes random mating, a very large population and no selection, mutation or migration affecting the gene.
  • One generation of random mating restores the expected proportions at an autosomal locus when the sexes share the same allele frequencies.
  • For a rare recessive allele, most copies are carried by heterozygotes who do not show the trait.
  • A chi-square test can show whether observed genotype counts depart from expectation more than chance would suggest.

The Hardy-Weinberg principle says that in a large, randomly mating population with no mutation, migration or selection, allele frequencies stay the same from generation to generation, and genotype frequencies are predictable from them. For two alleles with frequencies p and q, the genotypes appear in the proportions p², 2pq and q².

Its main use is as a baseline. When real counts differ clearly from the prediction, at least one assumption is probably not holding, and that gives you something to investigate. G. H. Hardy and Wilhelm Weinberg published the result independently in 1908.

Where the equation comes from

Imagine every adult contributing gametes to one large pool. A fraction p of gametes carry allele A and a fraction q carry a. Offspring form by drawing two at random.

A egg (p) a egg (q)
A sperm (p) AA: p² Aa: pq
a sperm (q) Aa: pq aa: q²

Adding the two routes to a heterozygote gives 2pq. Because p + q = 1, the total p² + 2pq + q² equals (p + q)², which is 1.

The next generation's frequency of A is p² plus half of 2pq, which is p² + pq = p(p + q) = p. Nothing has changed. Inheritance by itself does not wear away rare alleles.

The assumptions

Assumptions and what breaks them
The model assumes Random mating for this gene A very large population No migration No mutation No selection Real departures Mating among relatives or like types Genetic drift Gene flow from other groups New alleles appear Unequal survival or reproduction VS The model assumes Random mating for this gene A very large population No migration No mutation No selection Real departures Mating among relatives or like types Genetic drift Gene flow from other groups New alleles appear Unequal survival or reproduction

No natural population meets all of these exactly. Many come close enough at a particular gene that the proportions are a good approximation.

A method for any problem

Most exercises yield to the same short routine.

  1. Write down what you are given and label it as an allele frequency, a genotype frequency or a phenotype frequency.
  2. Find one of p or q. A recessive phenotype gives q², from which q is the positive square root. Full genotype counts let you count alleles directly.
  3. Get the other from p + q = 1.
  4. Compute whichever genotype frequency the question asks for.
  5. Convert to a number of individuals only at the end, by multiplying by the population size.

Keep several decimal places until the last step. Rounding q early can shift an answer noticeably, especially for rare alleles.

Problem 1: genotypes from allele frequencies

At a locus, p = 0.7 for allele A. In a population of 1,000, how many of each genotype do you expect?

q = 1 − 0.7 = 0.3
AA: p²  = 0.49  →  490
Aa: 2pq = 0.42  →  420
aa: q²  = 0.09  →   90
check: 490 + 420 + 90 = 1,000

Problem 2: carriers of a rare recessive condition

Suppose a recessive condition affects 1 in 2,500 newborns in a population, and assume Hardy-Weinberg proportions. What fraction are carriers?

q² = 1/2,500 = 0.0004
q  = 0.02
p  = 0.98
2pq = 2 × 0.98 × 0.02 = 0.0392     about 1 in 26

Carriers are about 98 times as common as affected people here (0.0392 ÷ 0.0004 = 98). That is why removing or protecting affected individuals changes the allele frequency so slowly. For how carriers pass on variants, see carriers and recessive variants. Questions about personal risk belong with a genetic counselor.

Problem 3: working from the dominant trait

In a plant population, 84 percent of individuals show a dominant flower color. Assume equilibrium. What share of those colored plants are heterozygous?

recessive phenotype = 1 − 0.84 = 0.16 = q²
q = 0.4,  p = 0.6
heterozygotes: 2pq = 0.48
share among dominant-colored plants: 0.48 / 0.84 ≈ 0.57

Note the last step. The question asks about a subset, so you divide by the frequency of that subset, which includes only AA and Aa.

Problem 4: three alleles

With three alleles the expansion becomes (p + q + r)². Take invented frequencies for the ABO gene: p = 0.3 for I^A, q = 0.1 for I^B and r = 0.6 for i. The first two are codominant and both dominate i.

Blood type Genotypes Calculation Expected frequency
A I^A I^A, I^A i p² + 2pr = 0.09 + 0.36 0.45
B I^B I^B, I^B i q² + 2qr = 0.01 + 0.12 0.13
AB I^A I^B 2pq = 0.06 0.06
O i i r² = 0.36 0.36

The four values sum to 1.00.

Problem 5: an X-linked allele

In mammals a male has one X chromosome, so the frequency of an X-linked recessive trait among males equals q. Suppose 8 percent of males show such a trait and the allele frequency is the same in both sexes.

q = 0.08,  p = 0.92
affected females:  q²  = 0.0064              (0.64 percent)
carrier females:   2pq = 2 × 0.92 × 0.08 = 0.1472   (about 14.7 percent)

Affected males are 12.5 times as common as affected females (0.08 ÷ 0.0064). One caution: at X-linked genes, a difference in allele frequency between the sexes takes several generations of random mating to even out. More on this pattern is in X-linked inheritance.

Problem 6: testing for a departure

You genotype 100 animals and find 50 AA, 20 Aa and 30 aa. Is this consistent with equilibrium?

p = (2×50 + 20) / 200 = 0.6,   q = 0.4
expected: AA = 36,  Aa = 48,  aa = 16

chi-square = sum of (observed − expected)² / expected
AA: (50 − 36)² / 36 = 196 / 36 ≈ 5.44
Aa: (20 − 48)² / 48 = 784 / 48 ≈ 16.33
aa: (30 − 16)² / 16 = 196 / 16 = 12.25
total ≈ 34.0

There is 1 degree of freedom: three genotype classes, minus 1, minus 1 more because p was estimated from the same data. The usual 0.05 cutoff for 1 degree of freedom is about 3.84. Since 34.0 is far larger, you reject equilibrium. The method is explained further in chi-square tests for genetics data.

One generation restores the proportions

Take the animals from Problem 6 and let them mate at random, assuming the other conditions hold and that males and females share the same frequencies. The gametes carry A with frequency 0.6 and a with frequency 0.4, whatever packaging the parents had.

offspring AA: 0.6²            = 0.36
offspring Aa: 2 × 0.6 × 0.4   = 0.48
offspring aa: 0.4²            = 0.16
offspring p:  0.36 + 0.48/2   = 0.60     unchanged

A badly distorted set of genotype counts returns to the expected proportions in a single round, while the allele frequencies stay put. This applies to a single autosomal locus with non-overlapping generations. Combinations of alleles at two different loci approach their random proportions more gradually, especially when the loci are close together on a chromosome.

What selection does to the numbers

Suppose instead that, starting from p = 0.6 and q = 0.4 at birth, none of the aa individuals reproduce.

breeders:  AA = 0.36,  Aa = 0.48     total 0.84
new q = (0.48 / 2) / 0.84 = 0.24 / 0.84 ≈ 0.286

For complete selection against a recessive, the next value equals q / (1 + q), and 0.4 / 1.4 gives the same 0.286. Apply it again and q falls to about 0.222. Each step removes a smaller share as the allele hides increasingly in heterozygotes. Going from q = 0.01 to 0.005 would take 100 generations under this rule. Mutation, which the model omits, would also keep adding new copies.

Interpreting a departure

The shortage of heterozygotes in Problem 6 has several possible causes: inbreeding, preference for similar mates, a sample that pools two populations with different frequencies, selection against heterozygotes, or a genotyping method that misses one allele. The test cannot choose among them.

Passing the test is not proof that nothing is happening. Small samples have little power, and selection acting on survival can sometimes leave proportions close to expectation. Compare allele frequencies across generations and gather independent evidence.

When two populations are pooled

A classic trap produces too few heterozygotes with no inbreeding at all. Imagine two isolated groups, each in perfect equilibrium, one with p = 0.9 and the other with p = 0.1, sampled in equal numbers.

group 1:  AA 0.81,  Aa 0.18,  aa 0.01
group 2:  AA 0.01,  Aa 0.18,  aa 0.81
pooled:   AA 0.41,  Aa 0.18,  aa 0.41
pooled p = 0.5, so expected Aa = 2 × 0.5 × 0.5 = 0.50

The mixture shows 18 percent heterozygotes where equilibrium would predict 50 percent. This is called the Wahlund effect. It disappears if the groups merge and mate at random.

Common questions

Does equilibrium mean the population is not evolving?

At that gene, constant allele frequencies mean no change is happening in the sense the model measures. Other genes in the same population may be changing quickly. And matching proportions in a single generation do not show that frequencies are stable over time.

Do dominant alleles take over under random mating?

No. The calculation above shows that p stays p whichever allele is dominant. Dominance affects which phenotype a heterozygote shows. A change in frequency needs one of the processes the model leaves out.

Why is the heterozygote term 2pq?

There are two ways to make a heterozygote: A from the first parent with a from the second, or the reverse. Each has probability pq. The frequency of heterozygotes is largest, one half, when p and q are both 0.5.

Habits that prevent errors

  • Check whether you are given a phenotype, genotype or allele frequency before touching the equation.
  • Start from q² only when the recessive phenotype is clearly identified and equilibrium is assumed.
  • Use counts, not percentages, in a chi-square test.
  • Verify that your frequencies add to 1.
  • State the assumptions alongside the answer.

If counting alleles still feels shaky, review allele frequencies and the gene pool first. For what happens when the large-population assumption fails, continue to genetic drift.

Written for 4Biology with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 59 articles in Evolution →

Latest news on this topic