Interactive simulation of natural selection driving beak evolution in Darwin's finches under environmental pressure
Natural selection is the core mechanism of evolution. Individuals with favorable traits survive and reproduce more successfully in a given environment, passing those traits to offspring. Darwin's finch beaks are a classic example—different food sources (hard seeds require deep, strong beaks; soft seeds suit shallow, slender beaks) create different selection pressures driving beak evolution across generations. The fitness function uses a Gaussian model: w = exp(-s × (z - θ)²), where s is selection strength, z is the individual's trait value, and θ is the environmental optimum.
Fitness measures an individual's survival and reproductive success in a specific environment. In this simulation, the closer a finch's beak depth is to the environmental optimum, the higher its fitness. Selection strength controls the steepness of the fitness curve—stronger selection means individuals deviating from the optimum suffer sharply reduced fitness. Reproduction uses roulette wheel selection: individuals with higher fitness are more likely to become parents, but low-fitness individuals also have a small chance of being selected.
The Hardy-Weinberg principle states that allele and genotype frequencies remain constant across generations in the absence of selection, mutation, migration, and genetic drift. When the environment changes dramatically, natural selection breaks this equilibrium and the population rapidly evolves toward a new adaptive optimum. This simulation demonstrates H-W equilibrium disruption—environmental change introduces selection pressure, and allele frequencies (represented by the beak depth distribution) shift across generations until reaching a new equilibrium.
Genetic drift is the random fluctuation of allele frequencies in a population, with effects being especially pronounced in small populations. Mutation is the ultimate source of genetic variation, providing raw material for natural selection. In this simulation, mutation rate controls the probability that each offspring develops a phenotypic variant, while mutation effect controls the magnitude of variation. High mutation rates maintain genetic diversity, enabling rapid response to environmental change; low mutation rates mean evolution depends primarily on existing variation.
In 1835, 26-year-old Darwin visited the Galápagos Islands aboard HMS Beagle, collecting various finch specimens. He noticed that finches on different islands had distinct beak shapes, though he didn't fully appreciate their significance at the time. Later, while organizing his specimens, these finches became key evidence for his theory of natural selection. The birds are collectively known as 'Darwin's finches,' though taxonomically they belong to the tanager family (Thraupidae), not the true finch family (Fringillidae).
Princeton biologists Peter and Rosemary Grant studied Darwin's finches on Daphne Major Island in the Galápagos for over 40 years starting in 1973. Their work represents one of the longest-running field studies in evolutionary biology history, directly observing natural selection occurring in real time in the wild, providing irrefutable evidence for evolution.
In 1977, the Galápagos suffered a severe drought with rainfall only 1/5 of normal. The medium ground finch (Geospiza fortis) population crashed from ~1200 to ~180 individuals. Small, soft seeds disappeared, leaving only large, hard seeds. Finches with deeper, stronger beaks could crack hard seeds and survived. In just one year, average beak depth increased by about 4%—a dramatic example of natural selection observed in real time by the Grants.
① Watch the histogram peak shift across generations—this is selection pressure made visible. ② Switch to drought mode and see the population rapidly narrow and shift toward deeper beaks—mirroring the real 1977 event. ③ Use drought cycle mode to observe oscillating adaptation—beak distribution swings back and forth with the environment. ④ Reduce population to ~50 and notice stronger genetic drift—random fluctuations become more apparent. ⑤ Set mutation rate to 0 and watch diversity gradually deplete—all individuals converge, losing ability to adapt to new environments.
Experiment 1 (Directional Selection): Run 20 generations at optimal=5, then suddenly change to optimal=9. Observe the speed of evolutionary response. Experiment 2 (Stabilizing Selection): Set optimal to current population mean and watch variation decrease. Experiment 3 (Drift Rate): Minimize selection strength, compare drift magnitude with pop=50 vs pop=500. Experiment 4 (Mutation Bottleneck): Run 50 generations to accumulate variation, then set mutation=0 and observe diversity loss. Experiment 5 (Cyclic Oscillation): Use drought cycle mode, adjust parameters, and see if the population can track the changing environment.