← All animations

📊 Hardy–Weinberg Equilibrium

In a large, randomly-mating population with no selection, mutation, migration or drift, allele frequencies don't change — and genotype frequencies snap to a fixed recipe: p² + 2pq + q² = 1. That "nothing happening" is the whole point: it's the null hypothesis of population genetics. When real frequencies drift away from it, that deviation is the signature of evolution at work. Scroll to see equilibrium form in one generation, then break each assumption and watch evolution appear.

1. The null model — equilibrium in one generation

Pick how common allele A is (its frequency p); the other allele a has frequency q = 1 − p. Under random mating, gametes pair up by chance, so the next generation's genotypes land on exactly p² AA, 2pq Aa, q² aa. Watch the gene pool combine into offspring that fill the predicted stacked bar — and note it reaches that equilibrium in a single generation, then holds there forever.

p = 0.60 · q = 0.40
AA (p²) Aa (2pq) — carrier aa (q²)

2. Break the rules — and evolution appears

Hardy–Weinberg is the flat baseline. Switch on an evolutionary force and run the generations: allele frequency q (allele a) is plotted over time. Selection against aa pushes q down; drift in a small population sends q on a random walk that can fix or lose an allele; mutation and migration nudge it too. The dashed line is the starting frequency — the "no evolution" prediction.

N = 5000 (drift weak) w = 0.60
Gen 0 · q = 0.50 · carriers 2pq = 0.50

3. Why it matters

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

Large population
no genetic drift
Random mating
no mate choice by genotype
No selection
all genotypes equally fit
No mutation
alleles don't change into each other
No migration
no gene flow in or out