← SciSim / Biology 🖨️ Printable lesson pack for this sim ↓Lesson pack ↓

Natural Selection & Evolution

🧬 Tier: Middle School → AP/Intro-College Biology
Watch evolution happen. In this 3D habitat birds hunt beetles: beetles that stand out get eaten, camouflaged ones survive to breed, and their offspring inherit the colour alleles. Run the generations and watch the allele frequencies change on the graph. Switch the habitat, turn on genetic drift or mutation, replay the peppered moth story, and click any beetle to see its genotype.

🧬 Interactive Beetle Population

Dark forest floor

The ground is dark, so dark beetles are camouflaged and pale beetles are easy for the predator to spot. Each generation, conspicuous beetles are more likely to be eaten before they reproduce, so the dark allele spreads.

Click any beetle

Every dark beetle is either AA or Aa — they look identical because the dark allele A is dominant. Only aa beetles are light. Click a beetle to see which it is.

Generation
0
Freq. A (dark)
0.50
Freq. a (light)
0.50
% dark
75%
% light
25%
Mean fitness
1.00
Eaten this generation
—
Birds’ selection
against light
Allele & phenotype frequency vs. generation
Dark beetle (AA or Aa) Light beetle (aa) Allele A frequency Eaten (red ring) Eggs of the next generation

Run the generations

Environment (who is camouflaged)

Selection & population

Forces

View

💡 The Idea, Step by Step

Start — a field of beetles and a hungry bird

Picture a patch of dark forest floor covered in beetles. Some beetles are dark and blend in; some are light and stand out like a coin on a doormat. A bird hunts by sight, so it spots and eats the light ones more easily. The survivors breed, and their offspring inherit their parents’ color. Do this for a few generations and the field slowly fills with dark beetles — nobody decided to change, the population simply shifted. That shift is evolution.

Build — alleles, frequencies, and the gene pool

Color here is set by one gene with two versions, called alleles: $A$ (dark, dominant) and $a$ (light, recessive). Write the fraction of $A$ copies in the whole gene pool as $p$ and the fraction of $a$ copies as $q$, so that $p+q=1$. With random mating, the three genotypes appear in the famous Hardy-Weinberg proportions $p^2$ for $AA$, $2pq$ for $Aa$, and $q^2$ for $aa$. Because $A$ is dominant, both $AA$ and $Aa$ beetles look dark, and only $aa$ beetles look light. Evolution is just these frequencies changing over time.

Deepen — fitness and the selection equation

Give each genotype a relative fitness $w$ — its reproductive success compared with the best type. On the dark floor the dark beetles have $w=1$ and the conspicuous light beetles have $w=1-s$, where $s$ is the selection pressure. The population’s mean fitness is $\bar w = p^2 w_{AA} + 2pq\,w_{Aa} + q^2 w_{aa}$, and the next generation’s dark-allele frequency is $p' = \dfrac{p^2 w_{AA} + pq\,w_{Aa}}{\bar w}$. The Selection pressure slider sets $s$, the environment buttons decide which color has $w=1$, and turning on genetic drift replaces this smooth formula with a random draw from a finite population.

Try this in the sim above

Press Play on the Dark forest and watch the birds: they mostly catch the pale beetles, the survivors lay eggs, and the next generation is darker — follow the green line climb on the graph. Now switch to Pale meadow and see how quickly the dominant dark allele falls. Click a few dark beetles: some are Aa carriers hiding the light allele, which is why a recessive allele is so hard to get rid of. Try No selection with Genetic drift on and a small population, and finally press Peppered moth story to watch a rare dark mutation spread when soot blackens the trees — and decline again when the air is cleaned.

📐 How Natural Selection Works

The four conditions for natural selection (VIST). Variation — individuals differ (here, beetle colour). Inheritance — the differences are passed on in genes (the A and a alleles). Selection — some variants survive and reproduce more than others (camouflaged beetles escape the birds). Time — over many generations the favoured alleles become more common. If all four are present, evolution by natural selection is unavoidable.
Three ingredients, one result. Natural selection follows automatically whenever a population has (1) variation in a trait, (2) that variation is heritable, and (3) the trait affects survival or reproduction. Given those three, the better-fitting versions of the gene must become more common — that is evolution. The steps below match what the simulation does each generation.
StepWhat happens
1. VariationThe population contains both alleles, giving dark ($AA$, $Aa$) and light ($aa$) beetles in Hardy-Weinberg proportions $p^2$, $2pq$, $q^2$.
2. SelectionThe predator eats the conspicuous color more often. The disfavored genotype’s fitness drops to $1-s$, so it leaves proportionally fewer offspring.
3. InheritanceSurvivors pass their alleles to the next generation. The new allele frequency is $p' = (p^2 w_{AA} + pq\,w_{Aa})/\bar w$.
4. IterationRandom mating reshuffles the surviving alleles into a fresh batch of zygotes, and the cycle repeats. Small shifts each generation add up to large change.
5. Drift (chance)In a finite population the next generation is a random sample of $2N$ alleles, so frequencies also wander by luck — strongly when $N$ is small.

Why selection against a recessive allele is slow

When the disfavored allele is recessive, it is invisible to selection whenever it is paired with a dominant allele. As the recessive allele $a$ becomes rare, almost every remaining copy sits hidden inside a healthy-looking heterozygote $Aa$, where the predator never sees it. Selection can only act on the few $aa$ beetles, so the last copies of a harmful recessive allele are removed extremely slowly and can persist for thousands of generations. Selection against a dominant allele is the opposite: every carrier shows the trait, so a harmful dominant allele is exposed and purged quickly.

Directional, stabilizing, and disruptive selection

This sim shows directional selection, where one extreme is favored and the population shifts toward it. Two other patterns matter in nature: stabilizing selection favors the average and trims the extremes (human birth weight is the classic case), while disruptive selection favors both extremes over the middle and can split a population. All three are natural selection; they differ only in which individuals leave the most offspring.

The peppered moth — selection caught in the act

The most famous real example mirrors this model exactly. Before industrial Britain, pale Biston betularia moths were camouflaged on lichen-covered bark; a rare dark (melanic) form stood out. As soot from coal blackened the trees in the 1800s, the dark form became camouflaged and the pale form conspicuous, and dark moths shot up to over 90% near industrial cities. After clean-air laws cleaned the bark in the late 1900s, the pale form rebounded — the allele frequency reversed, just like flipping the environment button here.

Natural selection seen in the real world

ExampleWhat changedSelective pressure
Peppered moth (England)Dark form rose from rare in 1848 to about 98% near Manchester by 1895, then fell after clean-air lawsBirds eating moths that stand out on soot-darkened or clean bark
Darwin’s finches (Galápagos)After the 1977 drought the medium ground finch’s average beak became about 4% deeper in one generationOnly large, hard seeds were left to eat
Rock pocket mice (USA)Dark mice on black lava rock, sandy mice on pale desert, caused by variants of the Mc1r geneOwls and other predators hunting by sight
Antibiotic-resistant bacteriaResistant strains such as MRSA become common where antibiotics are used a lotAntibiotics kill the susceptible bacteria
Pesticide-resistant insectsResistance spreads within a few years of heavy sprayingPesticide kills non-resistant insects
Lactase persistence (humans)The ability to digest milk as an adult spread in dairy-farming peoples over the last ~10,000 yearsExtra nutrition from milk

Sources: Kettlewell’s and later field studies, including Cook et al. (2012), Biology Letters 8:609 (bird predation on peppered moths); Boag & Grant (1981), Science 214:82 (finches); Nachman, Hoekstra & D’Agostino (2003), PNAS 100:5268 (pocket mice); Tishkoff et al. (2007), Nature Genetics 39:31 (lactase persistence).

References: Darwin C. (1859), On the Origin of Species; Hartl D.L. & Clark A.G., Principles of Population Genetics (the one-locus selection model); Futuyma D.J. & Kirkpatrick M., Evolution; Campbell & Reece, Biology (mechanisms of evolution, Hardy-Weinberg); Cook L.M. et al. (2012), Biology Letters — the peppered-moth selection experiment.

❓ FAQ

Basics What is natural selection?►

Natural selection is the process by which individuals whose inherited traits make them better suited to their environment tend to survive and reproduce more than others, so the helpful versions of genes become more common over generations. It needs three things: variation in a trait, that variation being heritable, and the trait affecting how many offspring an individual leaves. When a predator more easily spots beetles that stand out against the ground, the camouflaged beetles leave more offspring and the camouflaging allele spreads. Darwin and Wallace proposed this mechanism in 1858.

Key takeaway: natural selection is differential survival and reproduction of heritable variation, which over generations shifts a population toward traits that fit the environment.
Concept What is the difference between natural selection and evolution?►

Evolution is the outcome — a change in the allele frequencies of a population over generations. Natural selection is one mechanism that can cause it. They are not the same: allele frequencies can also change through genetic drift (random change, strong in small populations), gene flow (migration between populations), mutation (new alleles), and non-random mating. A population is evolving whenever its allele frequencies are shifting, whatever the cause.

Key takeaway: evolution is the change in a population over time, while natural selection is just one of several forces — alongside drift, gene flow, and mutation — that can drive it.
Fitness What does “fitness” or “survival of the fittest” really mean?►

Fitness does not mean being strongest, fastest, or healthiest. It means reproductive success: how many surviving, fertile offspring an individual leaves relative to others. An organism that lives long but never reproduces has zero fitness; a short-lived one with many offspring has high fitness. The phrase “survival of the fittest” is misleading because reproduction, not mere survival, is what counts, and fitness is always relative to a particular environment — dark color helps on dark bark but hurts on pale lichen.

Key takeaway: fitness is relative reproductive success in a given environment, not physical strength, and the fittest are simply those who leave the most offspring.
Genetics What is the Hardy-Weinberg principle?►

It is the null model of population genetics: in a large, randomly mating population with no selection, mutation, migration, or drift, allele frequencies stay constant. If allele A has frequency p and allele a has frequency q (with p + q = 1), the genotype frequencies are p² for AA, 2pq for Aa, and q² for aa. The principle is useful because real populations often depart from it — when observed genotype frequencies do not match the prediction, some evolutionary force must be acting. It is the baseline against which evolution is detected.

Key takeaway: Hardy-Weinberg gives the genotype frequencies expected when nothing is changing allele frequencies, so it is the baseline against which real evolutionary change is measured.
Level Does evolution act on individuals, populations, or genes?►

Natural selection acts on individuals, because individual organisms survive or die and reproduce or fail based on their traits. But individuals do not evolve — their genes are fixed from birth. What evolves is the population, since evolution is defined as a change in allele frequencies across the whole group between generations. The gene’s-eye view adds that, because alleles are what get copied, selection can also be described as successful alleles becoming more common. These views are compatible.

Key takeaway: selection screens individuals, but it is populations that evolve, while alleles are the heritable units whose frequencies actually change.
Chance What is genetic drift and how is it different from selection?►

Genetic drift is random change in allele frequencies caused by chance, because each generation is a finite sample of the previous one and which individuals reproduce is partly luck. Drift is not driven by fitness, so it can make a neutral or even harmful allele more common, or lose a beneficial one. Its strength depends on population size: weak in large populations where fluctuations average out, powerful in small ones where it can overwhelm selection. Selection, by contrast, is directional and predictable. Both can cause evolution and usually act together.

Key takeaway: drift is random change strongest in small populations, while selection is directional change driven by fitness — the smaller the population, the more chance outweighs selection.
Limits Why doesn’t a beneficial allele always reach 100%?►

Several things can stop fixation. When a harmful allele is recessive it hides in heterozygous carriers, so as it gets rare selection removes it ever more slowly and it lingers a very long time. Heterozygote advantage — as with the sickle-cell allele that protects against malaria — actively keeps both alleles because Aa is fittest. In small populations drift can randomly remove a beneficial allele before selection fixes it. And recurrent mutation keeps reintroducing the disfavored allele, balancing selection.

Key takeaway: dominance hiding recessives, heterozygote advantage, genetic drift, and ongoing mutation can all keep a population from ever reaching 100% of even a beneficial allele.
Conceptual What are the four conditions needed for natural selection?►

Natural selection happens whenever four things are true: there is variation between individuals, the variation is inherited, some variants survive and reproduce better than others in their environment, and this repeats over many generations. A handy memory aid is VIST: Variation, Inheritance, Selection, Time.

Key takeaway: variation + inheritance + differential survival and reproduction + time = evolution by natural selection.
Applied What are real examples of natural selection happening today?►

Bacteria evolving resistance to antibiotics, insects evolving resistance to pesticides and weeds to herbicides are all natural selection in action, often within a few years. Well-studied wild examples include the peppered moth in industrial England, the beaks of Darwin’s finches after a drought on the Galápagos, and dark and light pocket mice that match lava or desert rock.

Key takeaway: antibiotic and pesticide resistance show natural selection happening in our own lifetime.
History Who discovered natural selection?►

Charles Darwin and Alfred Russel Wallace worked out the idea independently. Their joint papers were presented to the Linnean Society of London in 1858, and Darwin set out the full argument and evidence in On the Origin of Species in 1859. Neither knew about genes; the link to Mendelian genetics and allele frequencies came in the 1920s–1940s, in what is called the modern synthesis.

Key takeaway: Darwin and Wallace, 1858; genetics was added later in the modern synthesis.

⚠️ Misconceptions & Common Errors

❌ "Individual organisms evolve or adapt during their lifetime because they need to."✅ Individuals do not change their genes to suit their needs. Selection acts on heritable variation that already exists; the population changes across generations as some individuals out-reproduce others.🔍 A beetle is born dark or light and stays that way — the field shifts, not the beetle.
❌ "Survival of the fittest means the strongest, biggest, or toughest survive."✅ Fitness means reproductive success, not strength. A well-camouflaged, unremarkable beetle that leaves many offspring is fitter than a big conspicuous one that gets eaten first.🔍 The winner is whoever leaves the most surviving offspring, not whoever wins a fight.
❌ "Evolution has a goal and is working toward perfect or more advanced organisms."✅ Selection has no foresight or goal. It only favors whatever works now, in this environment. Flip the environment and the “goal” reverses, as the peppered moth shows.🔍 Better-fitting, not better — and only for the current conditions.
❌ "Natural selection creates new traits or mutations when they are needed."✅ Selection cannot create variation; it can only sort what already exists. Mutation (random, not need-based) supplies new alleles, and selection then favors the useful ones.🔍 Mutation deals the cards; selection plays the hand.
❌ "If a trait is helpful, its allele will quickly reach 100% of the population."✅ Not always. A favorable recessive hides in carriers and spreads slowly; heterozygote advantage holds both alleles; drift can lose it; and mutation keeps reintroducing the other allele.🔍 Watch the recessive case slow to a crawl as the allele gets rare.
❌ "Evolution is just random chance" / "Evolution is only natural selection."✅ Both are wrong. Mutation and drift are random, but selection is decidedly non-random — it is the consistent, directional sorting of variation. And selection is only one of several forces (with drift, gene flow, and mutation) that change allele frequencies.🔍 Random raw material, non-random sorting — plus other forces too.
❌ “Whales evolved from hippos.”✅ Whales and hippos are cousins, not ancestor and descendant: both evolved from a common ancestor that lived more than 50 million years ago, and both lineages have kept evolving since. DNA evidence shows that hippos are the closest living relatives of whales, and fossils of early whales and their relatives (such as Pakicetus and Indohyus) show that whales came from land-living, even-toed hoofed mammals, not from hippos.🔍 Shared ancestor, separate branches.
Education note: the three ideas students confuse most are that populations evolve, individuals do not, that fitness means reproduction, not strength, and that selection sorts variation but does not create it. Keeping those straight clears up most confusion about how evolution actually works.