Population genetics & Hardy–Weinberg
What you'll learn
About 7 min read- Calculate allele and genotype frequencies from phenotype data.
- Test whether a population is in Hardy–Weinberg equilibrium.
- Identify which condition is violated in a given scenario.
Lesson
In 1902, soon after Mendel's work was rediscovered, the British scientist Udny Yule raised an objection. If an allele is dominant, he argued, shouldn't it keep spreading through a population, generation after generation? The geneticist Reginald Punnett couldn't answer him, so he took the puzzle to G. H. Hardy, a mathematician he played cricket with. In 1908 Hardy published a two-page paper in the journal Science showing, with what he called "a little mathematics of the multiplication-table type", that Yule was wrong: without some force acting on them, allele frequencies don't change at all. The same year, a German physician, Wilhelm Weinberg, worked out the same result independently. It was called "Hardy's law" in English until 1943, when Curt Stern pointed out Weinberg's claim, and today it carries both names.
Counting alleles in a population
To study evolution, you need a way to measure a population's genes. All the alleles of all the individuals in a population make up its gene pool. For a gene with two alleles, A and a, we write the allele frequencies as p (the fraction of alleles that are A) and q (the fraction that are a). Every allele is one or the other, so p + q = 1.
Take 500 pea plants: 245 are YY, 210 are Yy and 45 are yy. Each plant has two alleles, so there are 1,000 alleles in total. The Y alleles are 2 × 245 from the YY plants plus 210 from the Yy plants: 700. So p = 700 / 1,000 = 0.7 and q = 300 / 1,000 = 0.3.
The genotype frequencies are just the fractions of individuals with each genotype: here 0.49 YY, 0.42 Yy and 0.09 yy. Allele frequencies and genotype frequencies are different things, and keeping them apart is half the battle in this topic.
Why frequencies stay put
Imagine every individual releases gametes into one big pool, and gametes pair up at random. A fraction p of the gametes carry A and q carry a. The chance that an egg and a sperm are both A is p × p, so the frequency of AA offspring is p². The chance of two a's is q². A heterozygote can form two ways (A egg with a sperm, or a egg with A sperm), so its frequency is 2pq.
These three add up to everything: p² + 2pq + q² = 1. That's just (p + q)² multiplied out, the same logic as a Punnett square, but for a whole population instead of two parents.
Now count the alleles in the new generation. The frequency of A is p² + ½(2pq) = p² + pq = p(p + q) = p. It's exactly what it was before. Mendelian inheritance on its own simply reshuffles alleles; it doesn't favour any of them. A population where this holds is in Hardy–Weinberg equilibrium.
The five conditions, and what breaks them
Hardy–Weinberg equilibrium is a null model: a description of what happens when nothing is going on. It holds only if five conditions are all true. Each one that fails is a way for a population to evolve:
- No natural selection. If some genotypes survive or reproduce better, their alleles increase.
- No mutation. Mutations turn one allele into another, slowly changing p and q.
- No gene flow. Gene flow is the movement of alleles between populations, when individuals (or pollen) migrate in or out.
- A very large population. In a small population, chance alone changes allele frequencies from one generation to the next. This is genetic drift. A bottleneck, when a disaster leaves only a few survivors, and a founder effect, when a few individuals start a new population, are both drift in action.
- Random mating. If individuals choose mates like themselves, or mate with relatives, genotype frequencies shift away from p², 2pq and q².
No real population meets all five conditions perfectly. The value of the model is that it tells you what "no evolution" looks like, so a departure from it is a clue that something, whether selection, drift, migration, mutation or non-random mating, is at work.
From phenotypes to allele frequencies
Often you can't see genotypes. With a dominant and a recessive allele, AA and Aa look the same. But you can always spot the recessive homozygotes, and if the population is in equilibrium, their frequency is q².
- Find the fraction of individuals with the recessive phenotype. This is q², not q.
- Take the square root to get q.
- Calculate p = 1 − q.
- Calculate the carriers: 2pq. The dominant homozygotes are p².
For example, if 1 in 10,000 people has a recessive condition, q² = 0.0001, so q = 0.01 and p = 0.99. Carriers are 2 × 0.99 × 0.01 ≈ 0.02, or about 1 person in 50. Notice how many more carriers there are than affected people. Most copies of a rare recessive allele hide in heterozygotes, where selection can't see them.
Testing for equilibrium with chi-square
When you can count all three genotypes (for example, when alleles are codominant, or you have DNA data), you can test whether a population fits Hardy–Weinberg expectations. Real counts never match exactly, so you need to know whether the difference is bigger than chance would give. The chi-square (χ²) test does this.
- Calculate p and q from the observed genotype counts.
- Calculate expected counts: p² × N, 2pq × N and q² × N, where N is the number of individuals.
- For each genotype, work out (observed − expected)² ÷ expected, and add the three values together to get χ².
- Use 1 degree of freedom: 3 genotype classes, minus 1 because the total is fixed, minus 1 more because you estimated p from the same data.
- Compare with the critical value of 3.84 (for p = 0.05). If χ² is below 3.84, the data are consistent with equilibrium. If it's above, reject equilibrium and look for the cause.
A real example: when the ecological geneticist E. B. Ford scored 1,612 scarlet tiger moths for a gene that affects their wing pattern, the counts of the three genotypes gave χ² ≈ 0.83, well below 3.84. That population looked like it was in equilibrium for that gene.
X-linked genes
For a gene on the X chromosome, males have only one copy. So the fraction of males with a recessive X-linked trait is simply q, while the fraction of females is q². If q = 0.08 for an X-linked colour-blindness allele, about 8% of males but only about 0.64% of females would be affected. That's why X-linked recessive traits are so much more common in males.
Worked example
Is this population in equilibrium?
A biologist genotypes 200 plants for a gene with codominant alleles A and a. She finds 100 AA, 60 Aa and 40 aa. Is the population in Hardy–Weinberg equilibrium? If not, what might explain it?
- Count alleles: there are 400 in total. A alleles = 2 × 100 + 60 = 260, so p = 260 / 400 = 0.65. a alleles = 2 × 40 + 60 = 140, so q = 0.35. Check: 0.65 + 0.35 = 1.
- Expected genotype frequencies: p² = 0.4225, 2pq = 0.455, q² = 0.1225. They add up to 1.
- Expected counts (× 200): AA = 84.5, Aa = 91, aa = 24.5.
- χ² for AA: (100 − 84.5)² ÷ 84.5 = 240.25 ÷ 84.5 ≈ 2.84.
- χ² for Aa: (60 − 91)² ÷ 91 = 961 ÷ 91 ≈ 10.56.
- χ² for aa: (40 − 24.5)² ÷ 24.5 = 240.25 ÷ 24.5 ≈ 9.81.
- Total χ² ≈ 23.2, with 1 degree of freedom. This is far above 3.84.
- Look at the pattern: there are too few heterozygotes (60 instead of 91) and too many of both homozygotes.
Answer: No. χ² ≈ 23.2 is much greater than 3.84, so the population is not in equilibrium. A shortage of heterozygotes with an excess of both homozygotes points to non-random mating such as self-pollination or inbreeding, or to a sample that mixes two separate populations with different allele frequencies.
Key terms
- Gene pool
- All the alleles of all the individuals in a population.
- Allele frequency (p, q)
- The fraction of all copies of a gene in a population that are one particular allele.
- Hardy–Weinberg equilibrium
- The state in which allele and genotype frequencies stay constant from one generation to the next: p² + 2pq + q² = 1.
- Genetic drift
- Random change in allele frequencies from one generation to the next, strongest in small populations.
- Founder effect / bottleneck
- Drift caused by a few individuals starting a new population / by a sharp drop in population size.
- Gene flow
- Movement of alleles between populations through migration of individuals or gametes.
- Non-random mating
- Choosing mates by genotype or phenotype, or mating with relatives, which shifts genotype frequencies.
- Chi-square test
- A statistical test of whether observed counts differ from expected counts by more than chance would explain.
Check yourself
Try answering in your head before you open each answer.
1.About 1 in 2,500 babies in a population is born with a recessive condition. Assuming Hardy–Weinberg equilibrium, what fraction of the population are carriers?Show answerHide
q² = 1/2,500 = 0.0004, so q = 0.02 and p = 0.98. Carriers: 2pq = 2 × 0.98 × 0.02 ≈ 0.039, or about 1 in 25 people. Don't use 0.0004 as q; that's the frequency of affected people.
2.Ten birds are blown onto an empty island and start a new population. A generation later, an allele that was at 0.1 on the mainland is at 0.3 on the island, and at first it has no effect on survival. Which Hardy–Weinberg condition was violated?Show answerHide
The population was very small, so the change is best explained by genetic drift, specifically the founder effect. The ten founders happened to carry more copies of that allele than a typical mainland sample. Selection isn't needed to explain it, since the allele has no effect on survival.
3.A population of plants switches from cross-pollination to self-pollination. Predict what happens to p, q and the frequency of heterozygotes over the next few generations.Show answerHide
p and q stay the same, because selfing doesn't add or remove alleles on its own. But heterozygotes become rarer each generation (a selfed Aa plant gives only half Aa offspring) and both homozygotes become more common. Genotype frequencies move away from Hardy–Weinberg expectations even though allele frequencies don't change.
Misconception alerts
Misconception“Dominant alleles automatically become more common over time.”Why is this wrong? Think first, then open.
Why it's tempting
Dominant phenotypes look stronger.
What's actually true
Without selection or another evolutionary force, allele frequencies stay constant whatever their dominance. A recessive allele isn't eliminated just because it's recessive.
Misconception“q equals the fraction of individuals showing the recessive phenotype.”Why is this wrong? Think first, then open.
Why it's tempting
The recessive phenotype seems to measure the recessive allele directly.
What's actually true
That fraction is q². Take the square root to get q.
Olympiad depth
Estimating carrier frequency from the frequency of a recessive phenotype, and a χ² test for equilibrium. Also covered: drift and effective population size, founder and bottleneck effects, inbreeding raising homozygosity without changing allele frequencies, and Hardy–Weinberg for X-linked genes.
Concept links
- Builds onMendelian geneticsSegregation and the probability of genotypes.
- Contrast withNatural selectionHardy–Weinberg is the null model; selection is a departure from it.
- Applies toSpeciationDrift and reduced gene flow let isolated populations diverge.
Linked from
Test yourself
Too few heterozygotes
Calculate the allele frequencies and expected genotype counts, then carry out a χ² test (1 degree of freedom; critical value 3.84 at p = 0.05). Which conclusion is best supported?
Start the drillStill stuck?
See what other students have asked about this topic, or ask your own question.