Interactive tool
Natural Selection Simulation
Natural selection changes allele frequencies when genotypes differ in fitness. Set the starting frequency p0 of allele A, assign fitnesses wAA, wAa, and waa (relative survival and reproduction), and choose how many generations to run. The tool plots the allele frequency across generations so you can watch selection drive a beneficial allele upward, hold a polymorphism with heterozygote advantage, or fail entirely when fitnesses are equal.
Natural Selection Simulator
Watch allele frequencies change under selection, generation by generation.
Fitness = relative reproductive success (1.0 = baseline). Try w_aa = 0 to model a lethal recessive allele.
Generation-by-generation table
| Gen | p | q | w̄ (mean fitness) |
|---|---|---|---|
| 0 | 0.1000 | 0.9000 | — |
| 6 | 0.4381 | 0.5619 | 0.7954 |
| 12 | 0.7380 | 0.2620 | 0.9226 |
| 18 | 0.8759 | 0.1241 | 0.9681 |
| 24 | 0.9383 | 0.0617 | 0.9852 |
| 30 | 0.9683 | 0.0317 | 0.9927 |
| 36 | 0.9835 | 0.0165 | 0.9963 |
| 42 | 0.9913 | 0.0087 | 0.9980 |
| 48 | 0.9954 | 0.0046 | 0.9990 |
| 54 | 0.9976 | 0.0024 | 0.9995 |
| 60 | 0.9987 | 0.0013 | 0.9997 |
Each generation: p′ = (p²·wAA + pq·wAa) / w̄, where w̄ = p²·wAA + 2pq·wAa + q²·waais mean fitness. This is a deterministic model — it ignores genetic drift, mutation and migration, so real small populations will bounce around these curves.
How to use it
Use the sliders to set the starting allele frequency p0 and the fitnesses wAA, wAa, and waa.
Set the number of generations and run the simulation.
Watch the curve: note whether allele A rises, falls, or stabilizes.
Try heterozygote advantage (wAa highest) and see the frequency settle at an intermediate equilibrium.
What you will learn
- Explain how differences in fitness change allele frequencies over generations.
- Predict the direction of allele-frequency change from given fitness values.
- Describe how heterozygote advantage maintains both alleles.
- Distinguish selection from drift as a mechanism of allele-frequency change.