SimuVeda/ Biology

Biology · Simulator 031

Natural Selection

A population of moths comes in light and dark forms. Predators spot moths that stand out against the bark. Change the bark colour, predation strength and starting mix, and watch the frequency of the dark allele change over generations.

Class 11–12Class 12 Biology: Evolution

Experiments 0 of 0 Challenge not tried

How the model works

Each moth has two copies (alleles) of a colour gene: dark D (dominant) or light d. DD and Dd moths are dark; dd moths are light. Each generation:

  1. Predators remove some moths. Camouflaged moths survive with probability 1, conspicuous ones with probability 1 − s, where s is the selection coefficient.
  2. Survivors mate at random and produce the next generation (fixed population size N), each parent passing on one allele.
  3. A small mutation rate μ flips alleles at random.

The simulation tracks real individuals with a seeded random generator, so small populations also show chance effects (genetic drift). The dashed line is the deterministic expectation for an infinite population, using the standard one-locus selection recursion.

This is the classic peppered moth story: soot-darkened trees in industrial England favoured dark moths, and clean-air laws reversed the trend.

Simplified single-gene model with complete dominance, random mating and non-overlapping generations. Real moth colour genetics and predation are more complex.

Guided experiments

  1. Industrial revolution. Dark bark, dark allele starts rare (5%). Prediction: because D is dominant, even rare dark moths are visible and favoured straight away. The dark allele rises within a few dozen generations to well over 50%.
  2. Clean air. Light bark, dark allele starts common (90%). Prediction: light moths increase, but the dark allele lingers for a long time, hidden in Dd moths that look dark yet carry d. Selection against a dominant trait is fast; selection against a hidden recessive is slow.
  3. No selection, small population. s = 0, N = 30. Prediction: frequencies wander at random and may hit 0 or 100% by chance alone (drift).

Challenge

On dark bark with strong selection, why does the light allele (d) never quite disappear, even after many generations?

Reveal the explanation

When d is rare it is almost always in Dd moths, which look dark and are not selected against. Only dd moths are exposed, at frequency q². That shrinks very fast as q falls, so selection slows dramatically. Mutation also keeps reintroducing d at a low rate. The deterministic curve flattens near zero for the same reason.

References

  • OpenStax, Biology 2e, §19.2 “Population Genetics” and §19.3 “Adaptive Evolution”.
  • Cook, L. M. et al. (2012), “Selective bird predation on the peppered moth”, Biology Letters 8: 609–612.

Related simulators

Worked example

Start: dark allele D at 5% (q = 0.95 for light d), selection s = 0.3 against conspicuous light moths on dark bark.

Before predators: DD 0.25%, Dd 9.5%, dd 90.25% (Hardy–Weinberg: p², 2pq, q²). So 9.75% of moths are dark.

Survival: dark moths all survive, light ones 70%. Survivors: 0.0975 + 0.9025 × 0.7 ≈ 0.729 of the population.

New allele frequency: d = (0.095 / 2 + 0.632) / 0.729 ≈ 0.931, so D rises from 5% to about 6.9% in one generation, and dark moths from 9.8% to about 13.2%.

Each generation the rise speeds up while D is rare. Run the dark-bark experiment and compare its first generation with these numbers.

Common questions

What is natural selection?

Individuals with traits that help them survive and reproduce leave more offspring, so the alleles behind those traits become more common over generations.

What does the peppered moth show?

When soot darkened tree bark, dark moths were hidden from birds and became common in industrial areas. When the air was cleaned, light moths returned. The trait followed the environment.

Why does a harmful recessive allele take so long to disappear?

Once it is rare, most copies sit in carriers who look normal, so selection cannot see them. That is why the light allele lingers hidden in Dd moths.

Keyboard shortcuts

Space
Play or pause
S
Step
R
Reset
F
Full screen
?
Show this list