BiologyIntermediateGraph simulation~15 min

Natural Selection and Evolution

In the 1800s, as factories coated the trees of northern England with soot, a rare black form of the peppered moth became common in just a few decades. It is one of the clearest examples of evolution ever observed. Change the environment and the hunting pressure, and watch natural selection reshape a population generation by generation.

Generation 0 Click a moth to see its survival chance
t = 0.0 s
85

Pollution kills pale lichens and blackens bark with soot.

30

How strongly birds pick off moths they can see.

2

Percentage of gene copies that are the dark (carbonaria) version. Changing it restarts.

500

Small populations change more randomly (genetic drift). Changing it restarts.

0.5

New dark or light mutations per 1,000 gene copies each generation.

4

Key

  • Light (typica) moth
  • Dark (carbonaria) moth
Dark moths
—
Dark allele frequency
—
Survival — dark
—
Survival — light
—
Generation
—
Selection favours
—

Percentage of dark moths over generations

Percentage of moths with the dark phenotype in each generation.

    How to use this simulator

    1. Choose the bark colour (or a preset) and the strength of bird predation, then press Start.
    2. Each step is one generation. The moths on screen are a sample; crossed-out moths were caught by birds.
    3. Watch the percentage of dark moths on the graph. Switch from clean forest to pollution and back to see the population respond.
    4. Change the starting frequency, population size and mutation rate to explore dominance, genetic drift and new variation.
    5. Press Save run & restart to compare experiments on the graph. Click a moth to see its survival chance. Reset restores the defaults.

    What is natural selection?

    Charles Darwin and Alfred Russel Wallace proposed that species change over time through natural selection. It needs only three conditions:

    1. Variation: individuals in a population differ in their traits.
    2. Inheritance: some of those differences are passed from parents to offspring through genes.
    3. Differential survival and reproduction: some variants survive and reproduce more than others in a given environment.

    When all three are present, helpful inherited traits become more common over generations. The populationadapts to its environment. Evolution is this change in the genetic makeup of a population over time.

    The peppered moth story

    Peppered moths rest on tree trunks during the day, where birds hunt them by sight. The normal form (typica) is pale with dark speckles, well camouflaged against lichen-covered bark. The first dark form (carbonaria) was recorded near Manchester in 1848. By 1895, about 98% of moths there were dark, because soot had killed the lichens and blackened the trees. After clean-air laws in the 1950s, the bark grew lighter and the pale form became common again. Experiments, including a large study by Michael Majerus published in 2012, confirmed that birds eat more of the moths that stand out.

    Genes, alleles and dominance

    Moth colour is controlled mainly by one gene with two versions, or alleles: dark (D) and light (l). Each moth has two copies. The dark allele is dominant, so DD and Dl moths are dark and only ll moths are light. Because heterozygotes are dark, selection can act on the dark allele even when it is rare — which is why it spread so fast in polluted areas.

    Mutation and genetic drift

    • Mutation creates new alleles at random. It is the ultimate source of variation, but on its own it changes frequencies only slowly. Genetic research has shown the carbonaria mutation arose around 1819.
    • Genetic drift is random change caused by chance — which individuals happen to reproduce. It matters most in small populations, where alleles can be lost or become fixed purely by luck.

    Try this: set the mutation rate to 0, run the polluted forest for a few hundred generations, then switch back to a clean forest. If the light allele has been lost completely, nothing happens — natural selection can only act on variation that already exists. In real populations, mutation and moths migrating in from other areas keep rare alleles from disappearing, which is why the light form could make its comeback.

    The model’s equations

    If q is the frequency of the dark allele, the genotype frequencies before selection are:

    DD = q² Dl = 2q(1 − q) ll = (1 − q)²

    Each phenotype survives with probability s, which falls as its contrast with the bark rises. The dark allele frequency among the survivors is:

    q′ = (q²·s_dark + q(1 − q)·s_dark) / (s_dark·(q² + 2q(1 − q)) + s_light·(1 − q)²)

    The simulator then applies mutation and draws the next generation at random from 2N gene copies to include drift.

    Key terms

    Allele
    One version of a gene.
    Allele frequency
    The proportion of all gene copies in a population that are a particular allele.
    Phenotype and genotype
    An organism’s observable traits, and the alleles it carries.
    Fitness
    Relative ability to survive and reproduce in a particular environment.
    Adaptation
    An inherited trait that increases fitness in a particular environment.

    Real-world examples

    • Antibiotic resistance: bacteria with resistance mutations survive antibiotic treatment and multiply — a major concern in medicine.
    • Pesticide resistance in insects and herbicide resistance in weeds evolve the same way.
    • Darwin’s finches: on the Galápagos, beak size shifted within a few generations after droughts changed the available seeds (studied by Peter and Rosemary Grant).
    • Lactase persistence: in human populations with a long history of dairy farming, the ability to digest milk as adults became common.

    Common misconceptions

    • “Organisms evolve because they need to.” Mutations are random; selection only favours variants that already exist.
    • “Individuals evolve.” Populations evolve; individuals only survive or don’t.
    • “Survival of the fittest means the strongest.” Fitness means reproductive success in a specific environment — sometimes the best-camouflaged, not the strongest.
    • “Evolution is always progress.” Selection tracks the current environment, which can change direction, as it did for the moths.

    What the model simplifies

    The model uses a single gene with two alleles, random mating, non-overlapping generations and a simple link between camouflage and survival. Real moths also migrate between areas, rest in varied places, and have an intermediate “insularia” form. The selection strength here is adjustable for teaching; historical estimates suggest dark moths had roughly a 10–30% survival advantage in polluted areas.

    Key takeaways

    • Natural selection requires variation, inheritance and differences in survival or reproduction.
    • Allele frequencies change across generations; individuals do not evolve.
    • Which trait is favoured depends on the environment, and can reverse when the environment changes.
    • Mutation supplies variation, and drift causes random change, especially in small populations.

    Knowledge check

    Natural Selection and Evolution: test your understanding

    Answer each question to get instant feedback and an explanation. Use the simulator to check your thinking.

    7 questions3 basic2 intermediate2 advanced

    0 of 7 answered

    1. Q1BasicIn natural selection, which individuals are most likely to pass on their genes?
      Show answer

      Answer: B. Those whose traits help them survive and reproduce in their current environment

      “Fitness” in evolution means reproductive success in a particular environment. On light bark, light moths are fittest; on sooty bark, dark moths are.

    2. Q2BasicWhy did dark peppered moths become common in industrial areas of 19th-century Britain?
      Show answer

      Answer: C. Birds found dark moths harder to see on soot-blackened bark, so more of them survived to breed

      The dark form already existed as a rare variant. When pollution darkened the trees, birds ate more of the conspicuous light moths, so the dark allele became more common in each generation.

    3. Q3BasicWhat happens to the population when you switch from “Industrial pollution” back to “Clean forest”?
      Show answer

      Answer: B. Light moths become more common again

      Selection depends on the current environment. After clean-air laws in the 1950s, bark became lighter and the light form became common again — exactly what was recorded in Britain.

    4. Q4IntermediateDoes natural selection act on individuals or on populations?
      Show answer

      Answer: B. Selection acts on individuals, but it is populations that evolve over generations

      An individual moth cannot change its colour. Selection decides which individuals survive and reproduce, and the population’s allele frequencies change from one generation to the next.

    5. Q5IntermediateStarting from 2% dark alleles in a polluted forest, the dark moths spread quickly at first. Why?
      Show answer

      Answer: B. The dark allele is dominant, so every carrier of even one copy is dark and benefits from camouflage

      A dominant allele is expressed in heterozygotes, so selection “sees” it even when it is rare. A rare recessive allele would be hidden in heterozygotes and spread much more slowly at first.

    6. Q6AdvancedWith bird predation set to 0%, what does the dark allele frequency do in a small population?
      Show answer

      Answer: B. It wanders up and down randomly (genetic drift) and may be lost or fixed by chance

      Without selection, chance alone changes allele frequencies — genetic drift. Drift is strongest in small populations. Try a population of 20 and save several runs to compare.

    7. Q7AdvancedWhere did the dark (carbonaria) form originally come from?
      Show answer

      Answer: A. A random mutation that existed before pollution made it useful

      Mutations arise randomly, not because they are needed. Genetic studies (van’t Hof et al., 2016) traced the carbonaria mutation to a single event in the early 1800s. Selection then made the existing variant common.

    References and further reading

    1. Clark, M. A., Douglas, M., & Choi, J. (2018). Biology 2e, Section 19.1: Population Evolution, and 19.3: Adaptive Evolution. OpenStax. openstax.org (opens in a new tab)
    2. Cook, L. M., Grant, B. S., Saccheri, I. J., & Mallet, J. (2012). Selective bird predation on the peppered moth: the last experiment of Michael Majerus. Biology Letters, 8(4), 609–612.
    3. van’t Hof, A. E., et al. (2016). The industrial melanism mutation in British peppered moths is a transposable element. Nature, 534, 102–105.
    4. Understanding Evolution. University of California Museum of Paleontology. evolution.berkeley.edu (opens in a new tab)

    This simulator is a simplified educational model. Found an error? Let us know. See our educational disclaimer.