Natural Selection: Camouflage
Follow a population of moths on a tree trunk over many generations. Birds eat the moths that stand out against the bark, the survivors pair up and pass on their colour gene, and the next generation is born. Choose the bark, how many moths are dark at the start, how hard the birds hunt and how well camouflage protects, and watch dark moths take over on dark bark and light moths on pale bark. No single moth ever changes colour: the population changes because the moths that blend in survive and breed more often.
Preview — sign up free to change the numbers yourself
What you can adjust
- Tree bark
- 0 – 3
- Dark moths at the start
- 1 – 99 %
- Bird hunting strength
- 0 – 80 %
- Camouflage protection
- 0 – 95 %
- Number of moths
- 50 – 1000 moths
- Generations to watch
- 5 – 100 generations
- Random seed
- 1 – 99
The colour of the bark the moths rest on. A moth that matches the bark is hard for birds to see. Soot from factory smoke blackened tree trunks in England in the 1800s, and the bark lightened again as the air was cleaned up, so the last two choices change the bark halfway through the run.
The share of the first generation that is dark. The rest are light.
The chance that a moth that stands out against the bark is eaten in one generation. At 0 the birds eat nothing, so nothing is selected.
How much less often a moth that matches the bark is eaten. At 75%, a well-hidden moth is eaten a quarter as often as one that stands out. At 0% the colour makes no difference.
How many moths there are in every generation. In a small population, chance can change the numbers a lot (this is called drift), even without any selection.
How many generations of moths are shown. Peppered moths have one generation a year. Each generation takes about 0.3 seconds to play.
Fixes the random draws: the same seed and settings always give the same run. Change it to see how chance alone changes what happens.
About this simulation
What it shows
Moths resting on a tree trunk, generation after generation. Birds eat some, the survivors pair up, and the next generation hatches. A graph tracks the share of dark moths and of the dark gene.
The key idea
No moth ever changes colour. Moths that blend in with the bark are eaten less often, so more of them survive, breed and pass on their colour gene. Over the generations the colour that hides best becomes the common one.
Try this
Set Tree bark to Pale bark, covered in lichen and Dark moths at the start to 95: now the light moths are hidden, and the dark moths fall to almost none in about 20 generations.
A simple model: one colour gene (dark is dominant), birds that hunt by sight, and moths that pair up at random. With few moths, chance alone can shift the numbers, so try a different Random seed.