Hardy-Weinberg equilibrium, and how drift breaks it
A single gene with two alleles, A and a. The frequency of A is p; the frequency of a is q = 1 - p. Two ideas in one page: what the genotype proportions should be in an idealized population, and what actually happens to allele frequencies when the population is small.
Genotype proportions are fixed by allele frequency alone: AA = p², Aa = 2pq, aa = q².
Drag p and watch the three bars. They always add up to 100% of the population.
- AA (p²)
- Aa (2pq)
- aa (q²)
What this shows. Under the Hardy-Weinberg assumptions (random mating, no selection, mutation, or migration, and a very large population), genotype frequencies are completely determined by allele frequency. How to read it. Compare the bars by height (length from the zero baseline). Heterozygotes (Aa, orange) are most common at p = 0.5, where 2pq = 0.5, and become rare as p approaches 0 or 1. Rare alleles hide mostly inside heterozygotes, which is why a recessive allele can persist at low frequency without showing up as the aa phenotype.
The takeaway: small populations drift hard. Large ones barely move.
Both lines start at the same p. The small population (orange) wanders and often hits fixation or loss; the large population (blue) stays near where it began.
What this shows. This is the Wright-Fisher model. With no selection, the next generation is formed by randomly sampling 2N gene copies from the current pool, so the number of A copies next generation is a Binomial(2N, p) draw. The expected frequency never changes, but each generation adds sampling noise with variance p·q / (2N). How to read it. Follow the two lines left to right across generations. Smaller N means a larger denominator shrinks slowly, so the variance term is bigger and the orange line jumps further each step. Push enough generations and the small population usually slams into one of the dashed absorbing lines: fixation (p = 1, the A allele is all that is left) or loss (p = 0, A is gone). Once there, drift can no longer move it. Shrink N and watch how much sooner that happens.
Try this. Set N small (say 10), then click Step 50 a few times and notice how often the orange line reaches fixation or loss while the blue large-N line is still hovering near its start. Then drag N up toward 500 and reset: the orange line calms down and starts to look like the blue one. That single contrast is genetic drift.