Chapter 1 The null model

Hardy–Weinberg equilibrium

Without a force to move them, gene variants keep their frequencies, and random mating sorts them into p², 2pq and q² in a single generation.

Calculator →Chi-square test ↓

9 min read · 4 interactive figures, 2 questions

Forty beetles; each wing case is one gene copy. Each generation the same copies are paired again at random, which is all random mating does. The share of orange never moves, while the counts of AA, Aa and aa beetles scatter around p², 2pq and q². Tap the plate to step one generation.
On this page
  1. Random mating is a draw from a pool
  2. Every population is a point in a triangle
  3. Testing a real sample
  4. Why real samples fail the test
  5. The five conditions, and what breaks each one

A population is in Hardy–Weinberg equilibrium when its genotype frequencies are p², 2pq and q², where p and q are the frequencies of the two alleles at a gene. If mating is random and nothing else acts (no selection, mutation, migration or chance), a population reaches those proportions in one generation, from any starting mix, and then stays there. The allele frequencies themselves never change. That is the whole principle, and it matters because it is the null model of evolution: every force in the rest of this site is measured as a departure from it.

The two equations students are asked to memorize are

p + q = 1    and    p² + 2pq + q² = 1(1.1)
#

The first says there are only two alleles, A (frequency p) and a (frequency q). The second is the first one squared, and each term is a genotype: p² is the share of AA individuals, 2pq of Aa, q² of aa. The interesting part is why squaring is the right thing to do, and that comes from thinking about gametes. (For worked examples and practice problems, see the Hardy–Weinberg equation guide.)

Random mating is a draw from a pool

Picture every adult in a population releasing eggs or sperm into a common pool, as many marine animals in fact do. Each gamete carries one copy of the gene. An AA parent contributes only A gametes, an aa parent only a gametes, and an Aa parent half and half. So the share of A gametes in the pool is

p = fAA + ½ fAa(1.2)
#

where fAA and fAa are the shares of AA and Aa adults. Random mating means a new individual is made by drawing two gametes from that pool independently. The chance both are A is p × p; both a, q × q; one of each, in either order, p × q + q × p = 2pq. Nothing about the parents’ genotypes survives except p. That is Hardy’s argument[1], and it is a statement about probability, not about biology.

Question 1 Prediction before the next figure.#
Figure 1 Set the parents to any mix of genotypes, then breed. The gamete pool (middle) is all that carries over. Notice that the offspring bars land on p², 2pq and q² after a single generation, even when no parent is heterozygous, and that p is the same in parents and offspring. Breed again to see sampling scatter; raise the number of offspring and it shrinks.#

Two things happened in that figure, and they are worth separating. The allele frequency did not change: the pool had the same share of orange copies as the parents. The genotype frequencies changed at once, from whatever you set to the Hardy–Weinberg proportions. Allele frequencies are the slow variable of evolution; genotype frequencies follow them instantly under random mating. This is why population genetics tracks p and q, and why “evolution” in this subject means a change in p.

Dominance does not make an allele common

The question Punnett faced is still the most common misunderstanding of the principle. “Dominant” describes how an allele shows up in a heterozygote: an Aa individual looks like AA. It says nothing about how many copies of A get passed on. Under random mating, each A copy has the same chance of entering the next generation as each a copy, so the frequency stays put. Try it in Figure 1: no setting of the parents makes the orange share of the pool differ from the orange share of the parents. Whether an allele spreads depends on selection, drift, mutation and migration, which is what the other chapters are about.

Every population is a point in a triangle

Three genotype shares that add to 1 can be drawn as one point in a triangle, a picture introduced by the Italian statistician Bruno de Finetti in 1926 and now standard in population genetics[4]. A population of only AA sits at the left corner, only aa at the right, only Aa at the top. The horizontal position of any point is the allele frequency q. Populations in Hardy–Weinberg proportions all lie on one curve, the parabola fAa = 2pq.

Figure 2 Drag the vermilion point (or use the sliders) to any mix of genotypes, then press the button: random mating moves it straight up or down onto the Hardy–Weinberg curve, because it changes genotypes but not q. The grey dots are 216 real MN blood-group samples compiled by Mourant and colleagues (1976); tap one to read it. Notice how closely they hug the curve.#

The grey dots are why Hardy–Weinberg is more than an idealization. The MN blood group is controlled by one gene with two common alleles, M and N, which are codominant: MM, MN and NN people can all be told apart with antibodies, so heterozygotes can be counted directly. In 1976 Arthur Mourant and colleagues compiled MN counts for hundreds of populations, from Inuit communities in Greenland to villages in New Guinea; 216 of those samples are distributed with the HardyWeinberg software package for exactly this kind of exercise[4]. Their allele frequencies range from q = 0.06 to 0.94, yet 146 of the 216 have an inbreeding coefficient F (defined below) between −0.05 and 0.05, which on this scale is a hair’s breadth from the curve. established

The vertical distance from the curve has a name. The fixation index or inbreeding coefficient compares observed heterozygosity with the Hardy–Weinberg expectation:

F = 1 − Hobs / 2pq(1.3)
#

F = 0 on the curve. Points below the curve have too few heterozygotes (F > 0), points above too many (F < 0). With inbreeding, genotype frequencies become p² + Fpq, 2pq(1 − F) and q² + Fpq[5]: relatives share alleles inherited from a common ancestor, so their offspring are homozygous more often than random pairs would be.

Testing a real sample

Real samples never sit exactly on the curve, because even a population in perfect equilibrium gives a slightly different count each time you sample it. The question a test answers is narrow: is the gap larger than sampling alone would usually produce? Take the British sample in Mourant’s table: 279 MM, 436 MN and 185 NN people, n = 900.

  1. Allele frequency: p = (2 × 279 + 436) / 1800 = 994 / 1800 = 0.5522, so q = 0.4478.
  2. Expected counts: p²n = 274.5 MM, 2pqn = 445.1 MN, q²n = 180.5 NN.
  3. For each class, (observed − expected)² / expected: 0.075, 0.186 and 0.115. Their sum is the chi-square statistic, χ² = 0.38.
  4. Degrees of freedom: three classes, minus one because they must add to n, minus one more because p was estimated from the same data, leaves 1.
  5. With one degree of freedom, χ² exceeds 3.84 only 5 % of the time when the population really is in equilibrium. Our 0.38 is far below that: the probability of a gap at least this large is p = 0.54.

So the British sample is consistent with Hardy–Weinberg. That is not proof that it is in equilibrium; it means the data give no reason to think otherwise. The chi-square distribution is itself an approximation that works when every expected count is at least about five. For small samples, or rare alleles, the exact test of Wigginton, Cutler and Abecasis (2005) is better: given n and the allele counts, it lists the probability of every possible number of heterozygotes and adds up those at least as unlikely as the one observed[6]. The calculator below runs both.

Question 2 Prediction before the next figure.#
Figure 3 Type genotype counts or load a sample. The table builds the chi-square statistic class by class; the curve is its distribution when Hardy–Weinberg holds, with your value marked and the 5 % cut-off dashed. The shaded tail is the p-value. Try the Japanese sample with too many homozygotes, and the two pooled populations. The button runs the exact test on all 216 MN samples at once and lists the ones that fail.#

Why real samples fail the test

Of the 52 MN samples that fail at the 5 % level, 22 have too few heterozygotes and 30 have too many. The two directions point to different causes, and the test cannot tell you which one is at work.

Too few heterozygotes is what you get when a “population” is really two. Pool 500 people from a group with p = 0.2 and 500 from a group with p = 0.8, each in perfect equilibrium on its own. Together p = 0.5, so you expect 50 % heterozygotes, but you find only 32 %: each subgroup has few, and adding them does not create any. This is the Wahlund effect[7], and the deficit equals twice the variance of p among the groups[5]:

2p̄q̄ − Hobs = 2 Var(p)(1.4)
#

Load “Two populations pooled” in the calculator: χ² = 130, with F = 0.36. Inbreeding produces the same signature, and so does a genotyping method that misses heterozygotes. The Japanese sample in the calculator (233 MM, 320 MN, 288 NN) has F = 0.24. That is far more than inbreeding alone could plausibly produce (the child of first cousins has F = 1/16), so pooling of different groups or a typing problem is the likelier explanation.

Too many heterozygotes is rarer in nature. It can arise when the parents of a sample came from groups with different allele frequencies (first-generation mixing), from selection favouring heterozygotes among the survivors who were sampled, or from errors in typing or transcription. The large Russian sample (n = 5,728) has χ² = 145 with F = −0.16; a departure that size in a sample that large points to how the sample was assembled more than to biology, though the data alone cannot say. reconstructed

There is also a statistical reason the 216 samples fail more often than 5 %. Half of them have 1,000 people or more, and the largest has 31,564. With that much data a test detects departures far too small to matter biologically. A significant result tells you the curve does not fit exactly, not that it fits badly; F tells you by how much.

The five conditions, and what breaks each one

Textbooks list five conditions for Hardy–Weinberg equilibrium. It is more useful to read them as a list of the forces that change allele or genotype frequencies, because each is a chapter of its own:

ConditionIf it failsWhat changes
Random matingInbreeding, assortative mating, population structureGenotype shares (F ≠ 0), not p
No selectionNatural selectionp moves in a direction set by fitness
Very large populationGenetic drift; Founders and bottlenecksp wanders at random
No migrationGene flowp moves toward the source population
No mutationMutation (a slow, steady push; rates are about 10⁻⁸ per base per generation in humans[5])p creeps toward a mutation balance

Note the asymmetry in the first row. Non-random mating changes how alleles are packaged into genotypes but, on its own, not how many of each allele there are. The other four change p itself, and so they are the four forces of evolution. The next chapter switches on the one with a direction.