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.

-0.060.160.390.610.841.10.0012.024.036.048.060.0GenerationAllele frequency
p (allele A)q (allele a) (dashed)
Final p: 0.9987Final q: 0.0013No fixation within 60 generations
Generation-by-generation table
Genpqw̄ (mean fitness)
00.10000.9000—
60.43810.56190.7954
120.73800.26200.9226
180.87590.12410.9681
240.93830.06170.9852
300.96830.03170.9927
360.98350.01650.9963
420.99130.00870.9980
480.99540.00460.9990
540.99760.00240.9995
600.99870.00130.9997
The model (simplified educational model)

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

  1. Use the sliders to set the starting allele frequency p0 and the fitnesses wAA, wAa, and waa.

  2. Set the number of generations and run the simulation.

  3. Watch the curve: note whether allele A rises, falls, or stabilizes.

  4. 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.