Simulation lab
Peppered Moth Industrial Melanism Lab
In industrial England, the peppered moth (Biston betularia) existed in two forms: the pale, speckled typica form that camouflaged perfectly against lichen-covered birch bark, and the rare dark carbonaria form. As factory soot blackened the trees, birds could suddenly spot pale moths easily while dark moths vanished against the grime. In this lab, allele A represents the melanism allele. Set its starting frequency low, give dark genotypes high fitness on soot-darkened bark, and watch industrial melanism unfold generation by generation.
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
Set the starting frequency of A (p0) to 0.05: the dark allele is rare before industrialization.
Model soot-darkened bark with wAA = 1.0, wAa = 1.0, waa = 0.6 (melanism is dominant, so carriers survive better) and 150 generations.
Watch the p (allele A) curve climb, and note the generation at which the readout reports fixation.
Now model the clean-air era: set wAA = 0.8, wAa = 0.8, waa = 1.0 and watch the dark allele decline as pale moths are favored again.
Open the generation-by-generation table and find how the mean fitness (w-bar) rises as the population adapts to each environment.
This panel treats melanism as a single diallelic locus with constant fitnesses, which simplifies the real genetics of carbonaria. It ignores genetic drift, mutation and migration, and summarizes the whole bird-predation process into three fitness numbers. Real predation is frequency-dependent in ways this model cannot show: birds form search images, so a rare morph may gain extra protection that constant fitness values miss.
What you will learn
- Explain how differential survival by camouflage changes allele frequencies over generations.
- Translate a real predation pressure into relative fitness coefficients wAA, wAa and waa.
- Explain why the melanic allele spread during industrialization and declined after clean-air laws.
- Interpret the fixation readout and the mean-fitness column as evidence of adaptation.