Hardy-Weinberg Equilibrium
Overview
The Hardy-Weinberg principle gives us a null model for population genetics. Under five conditions—no mutation, no selection, infinite population size, random mating, and no migration—allele frequencies stay constant across generations. Genotype frequencies settle into the familiar p² + 2pq + q² = 1 distribution and stay there indefinitely.
Of course, no real population meets all five conditions. That's exactly the point. Hardy-Weinberg equilibrium is useful precisely because it gives you a baseline to test against. By violating each assumption one at a time, you can see which evolutionary forces have the biggest effect—and that's what this simulation lets you do.
What You'll Do
Start with a population in Hardy-Weinberg equilibrium. Then toggle evolutionary forces on and off, one at a time or in combination. Introduce new alleles via mutation. Make one genotype more fit than the others and watch selection drive allele frequency change. Shrink the population to see genetic drift in action. Add immigrants with different allele frequencies. Switch on assortative mating.
At each step, track allele and genotype frequencies across generations on real-time graphs. Run replicate simulations to see how stochastic processes like drift produce different outcomes each time, while deterministic forces like strong selection produce consistent results.
Learning Objectives
- Calculate expected genotype frequencies from allele frequencies using the Hardy-Weinberg equation
- Determine which evolutionary force has the greatest impact on allele frequency change in a given scenario
- Distinguish between the effects of genetic drift in small versus large populations
- Predict the outcome when multiple evolutionary forces act simultaneously
Background
G. H. Hardy (a mathematician) and Wilhelm Weinberg (a physician) independently published the equilibrium principle in 1908. Hardy reportedly considered it trivial—he wrote about it in a brief letter to Science—but it became one of the foundational results in population genetics.
The power of the principle lies in its role as a null hypothesis. If observed genotype frequencies don't match Hardy-Weinberg expectations, something interesting is going on. A chi-square goodness-of-fit test lets you quantify the departure. The challenge is figuring out which assumption is being violated, since multiple forces can produce similar deviations.
In practice, genetic drift tends to dominate in small populations, while selection is the main driver of directional change in large ones. Migration homogenizes allele frequencies between populations. Mutation introduces new variation but acts slowly on its own. Non-random mating changes genotype frequencies without altering allele frequencies—a subtle distinction that trips up a lot of students.
Run the Simulation
Configure parameters below and click Start to begin