Simulation lab

Hardy-Weinberg Equilibrium Breakdown Lab

Hardy-Weinberg equilibrium says that with random mating and no selection, mutation, migration or drift, allele and genotype frequencies stay constant at p-squared, 2pq and q-squared. The catch is the hidden assumption of an effectively infinite population. Real populations are finite, so drift nudges p every generation, and genotype frequencies can no longer sit at their Hardy-Weinberg predictions. Use this panel to watch p wander from its starting value in small populations while holding nearly still in large ones.

Genetic Drift Simulator

Random sampling alone changes allele frequencies — no selection involved.

-0.060.160.390.610.841.10.0012.024.036.048.060.0GenerationAllele frequency p
Replicate 1Replicate 2 (dashed)Replicate 3Replicate 4 (dashed)Replicate 5
Fixed (p = 1): 2Lost (p = 0): 1Still segregating: 2
What to notice

Shrink N to 5–10 and drift dominates: alleles fix or vanish within a few dozen generations purely by chance. Raise N to 200 and frequencies barely move — drift is weak in large populations. Every replicate starts identically yet ends differently: that randomness is genetic drift.

The model (simplified educational model)

Wright–Fisher ideal population: discrete generations, random mating, constant size N, no selection, mutation or migration. Each generation's 2N alleles are a binomial sample of the previous generation's gene pool. Real populations add all the complications this model leaves out.

How to use it

  1. Set N = 200, p0 = 0.5, 1 replicate, 100 generations: p barely moves, approximating Hardy-Weinberg constancy.

  2. Set N = 10, p0 = 0.5, 5 replicates and press 'Run again': p wanders and often fixes, breaking equilibrium.

  3. Note the panel tracks ALLELE frequencies only; the drifting p is what would drag genotype frequencies off their p-squared, 2pq, q-squared predictions.

  4. Try p0 = 0.2 at N = 10 and observe how often the rare allele is lost entirely.

  5. Conclude: Hardy-Weinberg needs effectively infinite N; finite N means drift, and drift means disequilibrium.

About this model

Be clear about what is shown: the panel tracks allele frequencies only and provides no genotype-frequency readouts, so the p-squared, 2pq, q-squared predictions must be computed by hand from the wandering p. Selection, mutation and migration have no terms in this model, so only the finite-size assumption is tested here. The model assumes ideal random mating and constant N, which real populations rarely meet.

What you will learn

  • List the assumptions of Hardy-Weinberg equilibrium.
  • Identify finite population size as the assumption this experiment violates.
  • Explain why drift breaks the constancy of allele and genotype frequencies.
  • Predict that Hardy-Weinberg holds approximately in large populations but fails in small ones.