← Laboratorium Biology · evolution

Experiment · Evolution

Evolutionnatural selection, live

Little creatures with genes for speed, size, sensing range, and color compete for food and flee from predators. Nobody steers them — and yet, generation after generation, they become better and better suited to their world. Change the world and watch them change.

Population0
Generation (avg.)0
Food items0
Time (steps)0

Click a creature to see its genes · body size = size gene · quick legs = speed · long antennae = senses · plumper body = more energy

×4 seed 2026

Charts

Population · births and deaths

creatures 0food 0birthsdeaths

Lineages · share of each founder's descendants

Lineages surviving: 0one color = one family

Mean traits ± 1 standard deviation

Speed0
Size0
Senses0
Color (- - bg)0

Trait distribution now (outline — at the start)

0.2mean 0 · start 03

Distinct genotypes: 0

Keys

Q W E
modes: simulation, genetic drift, evolution in nature
Space
start / pause (simulation and drift)
1 … 5
simulation scenarios (switches to simulation mode)
+ −
faster / slower
R N
reset (same random seed) / new seed
Esc
deselect the selected creature

How does it work?

The three ingredients of natural selection

Natural selection needs no plan and no goal. Three things are enough:

  • variation — individuals differ in their traits (here: speed, size, sensing range, and color);
  • inheritance — offspring get their parent's genes, sometimes with a small random change, a mutation;
  • differential reproductive success — some traits help an individual find food or avoid a predator, so their carriers leave more offspring.

When all three are at work, the makeup of the population has to change from generation to generation. That is evolution. A single creature doesn't evolve — the population changes.

The best fit, not the strongest

“Survival of the fittest” is often misread as “survival of the strongest.” But fittest here means “best suited,” not “in the best shape.” The simulation shows this clearly: on an island with little food, the small and thrifty win; with predators around, those whose color blends into the background do. A trait that helps in one world can hurt in another.

A creature's energy budget

Each creature has four genes: size r, speed v, sensing range z, and color k (from 0 — light, to 1 — dark). Every step it loses energy:

Estep = 0.02·r3 + 0.03·r3·v2 + 0.012·v2 + 0.02·z body upkeep · body motion (like kinetic energy ½mv², since mass grows as r³) · leg movement · senses

A food item gives 12 units of energy. When a creature has stored twice the cost of an offspring, Eo = 20·(0.4 + 0.6·r3), it divides. When its energy drops to zero, it starves. Speed lets it reach food first and escape, senses let it spot food earlier (and predators too), and a large size gives a longer reach, protects against predators, and lets it eat creatures at least ¼ smaller. Every advantage has a cost — that's why traits don't grow without limit.

Offspring inherit the genes with a mutation:

g′ = g·eμ·ε    (color: k′ = k + μ·ε) ε — a random number from a normal distribution (mean 0), μ — mutation strength from the slider

Camouflage

Every so often a predator looks around within a radius of 130 units. The chance that it spots a creature grows with the square of the contrast between the creature's color k and the background color t:

pspot = 0.003 + 0.18·(k − t)2

When the bark darkens, light creatures suddenly stand out — just like light peppered moths on soot-blackened birches.

Genetic drift — evolution by chance

Who leaves offspring is also decided by plain luck: one individual gets crushed under a rock before it can reproduce. In a large population such accidents cancel out; in a small one they can change everything. The Wright–Fisher model: the population has N individuals, so 2N copies of the gene; each generation is drawn at random from the previous one. The allele frequency p wanders randomly:

Var(Δp) = p(1 − p)2N     Ht = H0·(1 − 12N)t

A neutral allele becomes fixed with a probability equal to its initial frequency p0, and the mean time to fixation or loss is t̄ = −4N[p0 ln p0 + (1 − p0) ln(1 − p0)] generations — for p0 = ½ that's about 2.8·N. When the allele has an advantage s, the chance that it becomes fixed is given by Kimura's formula:

u = 1 − e−4Nsp01 − e−4Ns for a single new mutation (p0 = 1/2N) in a large population that's only about 2s — even a beneficial mutation usually disappears!

The breeder's equation — how fast a trait changes

If the survivors' mean trait differs from the mean of the whole population by S (the selection differential), their offspring will shift by only part of that difference:

R = h2·S h² — heritability: how much of the differences between individuals is due to genes (for finch beak depth the Grants found it to be high — the demo assumes 0.8)

Darwin and Wallace

Charles Darwin and Alfred Russel Wallace arrived at this idea independently. Their papers were presented together on July 1, 1858, at the Linnean Society of London, and on November 24, 1859, Darwin's “On the Origin of Species” was published. Today we also know what they didn't: where variation comes from (mutations in DNA) and how traits are inherited (Mendelian genetics).

Simplifications: the creatures reproduce asexually (by dividing), so their genes don't mix; each trait is a single number rather than the effect of many genes; the world is a torus (whoever goes off one edge comes back on the other side); predators neither evolve nor reproduce. We tuned the energy-cost formula so the trade-offs are easy to see — in real animals the metabolic rate grows roughly as mass¾ (Kleiber's law). The peppered moth's coloring actually depends mainly on a single gene, while here color is a continuous trait. In the drift model, for large populations we approximate binomial sampling with a normal distribution. The numbers in the “Evolution in nature” cards are approximate.

Did you know…?

  • Summing up the year 1858, the president of the Linnean Society, Thomas Bell, remarked that it had brought no striking discoveries. Yet that was exactly the year the theory of natural selection was presented at a meeting of the Society.
  • In Richard Lenski's lab, 12 populations of E. coli bacteria have been evolving nonstop since 1988 — over 70,000 generations so far. After about 31,500 generations, one of them learned to eat citrate in the presence of oxygen, which E. coli normally can't do.
  • The dark form of the peppered moth is caused by a piece of “jumping” DNA inserted into the cortex gene. Researchers estimated that this mutation arose around 1819 — several decades before the first dark peppered moth was caught.

Challenges

  1. Race: mean speed +50%Raise the mean speed by half compared with the start (try scenario 1).not completed
  2. Trigger industrial melanismStart with a light population (mean color ≤ 0.35), darken the bark, and push the mean color to ≥ 0.65 — with predators present.not completed
  3. Island: 50 generations on scarce foodWith food ≤ 0.35 per step for the whole run, keep the population alive until the mean generation reaches 50.not completed
  4. Bad luck beats selectionIn drift mode, set the advantage s ≥ 5% and wait until the beneficial allele A disappears from one of the populations.not completed