Natural selection simulator
Put a population of beetles on pale sand. Most are brown, a few a little paler. Birds hunt by sight and catch more of the beetles that stand out; the survivors breed, and their young inherit their parents' colour, with a small mutation now and then. Generation by generation the population turns the colour of the sand. Nobody chose it and no beetle changed: the beetles that happened to match simply left more young. That is natural selection, and here you can watch it, speed it up and change the rules. A population of beetles lives on a habitat. Birds catch the beetles that stand out, food is limited, and the survivors pass their colour, size and speed on to their young, with a mutation now and then. Press Play to run generation after generation, Next generation to finish one, Reset to start again. Pick a preset, or set the predators, the food, the cold and the mutation rate, and change the habitat during a run to watch the population adapt. Click a beetle to catch it yourself. The chart shows the colours of every generation as stacked bars above a ribbon of the habitat's colour, with the mean size and speed as lines.
How it works
- Press Play and watch the birds strike: in every generation the beetles that stand out from the habitat are caught first, and the survivors' young fill the habitat again.
- Pick a preset: the peppered moth, whose bark turns black with soot and later clean again, beach mice on pale dunes, rock pocket mice on black lava, a mixed population moving into a meadow, a harsh winter, or no predators at all.
- Change the habitat during a run, or set the predators, the food, the cold and the mutation rate, and see how quickly the population follows, or whether it dies out.
- Read the share that is camouflaged and the mean size and speed in the tiles, follow the colours of every generation on the chart, click a beetle to catch it yourself, and save the picture or open it in the editor with the habitat, the beetles, the birds and the chart on layers of their own.
Variation, heredity, selection
Darwin's argument rests on three facts. The individuals of a population differ: some beetles are paler, bigger or faster than others. Part of that variation is inherited: young beetles resemble their parents. And more are born than can survive. Put together, the variants that survive and breed best become more common in the next generation, simply because they leave more young. The simulator follows these rules and nothing else, and adaptation appears by itself.
How the birds choose
Birds hunt by sight. Each beetle's colour is a point between dark and pale and between brown and green, and so is the habitat's. The further a beetle's colour is from the ground's, the likelier a bird is to spot it: small differences are hard to see, large ones easy. Big beetles are easier to see too, and fast ones are harder to catch. With no predators, colour stops mattering at all.
Food, size and the cold
The habitat feeds a fixed number of average beetles. Food goes to those that find it, and fast and big beetles forage more. But a bigger body needs more energy, roughly in proportion to its size to the power 0.75 (Kleiber's law), running costs energy, and in the cold a small body loses heat faster because it has more surface for its volume. So in a warm place small beetles do well, while in a harsh winter the population grows bigger, as Bergmann's rule describes for warm-blooded animals in cold climates.
Mutation and drift
Selection can only choose among variants that exist. Mutation makes new ones: each gene of a young beetle may shift a little, with the chance set by the mutation rate. Set it to zero and a population on the wrong background can only use the variation it started with. In a small population chance matters too: with no predators, colour drifts at random from one generation to the next until one shade takes over. That is genetic drift, evolution without selection.
Frequently asked questions
What is natural selection?
The process by which inherited traits that help living things survive and reproduce become more common over the generations. It needs variation between individuals, heredity of that variation, and more offspring than can survive. Charles Darwin and Alfred Russel Wallace described it independently and presented it together in 1858; Darwin's On the Origin of Species followed in 1859.
What happened to the peppered moth?
Before the Industrial Revolution nearly all peppered moths in England were pale and speckled, hard to see on lichen-covered trees. Soot from coal killed the lichen and blackened the bark, and a dark form, first recorded near Manchester in 1848, rose to about 98 percent there by 1895, because birds ate more of the pale moths. After the clean air laws of the 1950s the trees grew lighter again and the pale form came back. Bird-predation studies by Bernard Kettlewell in the 1950s and by Michael Majerus from 2001 to 2007 confirmed the cause.
Does an animal change its colour to fit in?
No. No beetle in the simulator, and no moth or mouse in nature, changes its own colour to match. Each individual keeps the colour it was born with. What changes is the population: the beetles that happen to match survive more often and leave more young, so the next generation has more of their colour. Adaptation is a change in how common the variants are, not a change inside individuals.
What is genetic drift?
Change in a population caused by chance rather than by selection. In every generation some individuals leave more young than others for no particular reason, and in a small population those accidents add up quickly. Choose No predators: colour no longer affects survival, yet the mean colour wanders and the variety shrinks until one shade dominates.
Why does mutation matter if selection does the work?
Selection only sorts the variation that is there; mutation supplies new variation. On the Rock pocket mice preset, pale beetles live on black lava and no dark ones exist yet. With a mutation rate of zero they cannot adapt; with a few percent, darker mutants appear, survive better and slowly take over. In real rock pocket mice the dark fur comes from mutations in a gene called Mc1r.
Can I use the picture?
Yes. Save gives a PNG at the size you choose, and the pencil opens the picture in the PictorX photo editor with the habitat, the beetles, the birds and the chart on layers of their own and the chart's title as editable text. In the editor itself it is under Apps ▸ Science ▸ Biology ▸ Natural Selection, where you set the preset, the number of generations and the mutation rate. Everything runs in your browser.
Natural Selection Simulator: how do I record a video?
Press the red Record button in the playback bar: it films what the stage shows. Press it again to stop, and the video is saved to your device. Recording is free; you only need to sign in. Without a subscription the video carries a small PictorX logo in a corner. The button beside Record opens the video options: the shape (as shown, square, story 9:16 or wide 16:9), the length (until you stop, or 5, 10, 15 or 30 seconds for social media) and the file: MP4, WebM or an animated GIF. For the sound, choose the app's own sounds or one of three music tracks: calm, bright or beat.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
Go to Editor