← SciSim / Biology

Natural Selection & Evolution

🧬 Tier: Middle School → AP/Intro-College Biology
Evolution is a change in a population’s gene pool over generations. In this living field, beetles carry a gene for dark or light color, and a predator more easily spots whichever color stands out. Choose the environment, set the selection pressure, and step through the generations — watch the camouflaged beetles take over and the allele frequency shift on the live graph. Turn on genetic drift to see chance fight against selection.

🧬 Interactive Beetle Population

Generation 0 — starting population
press Play to run generations
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.

Generation
0
Freq. A (dark)
0.50
Freq. a (light)
0.50
% dark
75%
% light
25%
Mean fitness
1.00
Allele & phenotype frequency vs. generation
Dark beetle (AA or Aa) Light beetle (aa) Allele A frequency Eaten this generation

Run the generations

Environment (who is camouflaged)

Selection & population

Forces

💡 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

Set Dark forest, push Selection pressure high, and press Play: watch the light allele crash and the field go dark. Now switch to Pale meadow and reset — the same gene, opposite outcome, because fitness is relative to the environment. Notice that selection against the recessive light beetle slows down as $a$ gets rare (it hides in $Aa$ carriers), but selection against the dominant dark beetle is fast. Finally turn on Genetic drift and drop Population size to about $20$: now chance jiggles the lines and can even lose a favored allele.

📐 How Natural Selection Works

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.

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.

⚠️ 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.
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.