Skip to main content
Virtual Laboratory
Biology Simulations Free · No Account Free & source-available · CC BY-NC-SA 4.0

How Natural Selection Changes Population Allele Frequencies

Natural selection drives evolution by shifting population allele frequencies, whereas continuous selfing without selection alters genotype frequencies without changing p or q. Under Hardy–Weinberg equilibrium, random mating preserves p(S) and maintains p² + 2pq + q² = 1 across generations. In this 3D lab, switch bark color, compare selection and selfing, and track p(S).

How Natural Selection Changes Population Allele Frequencies — 3D Bench Preview

Interactive 3D Lab Preview

Runs right on this page in fullscreen · No account required

  • Calculate autosomal and X-linked allele frequencies accurately using p(S) = f(SS) + ½·f(Ss), always multiplying the heterozygote frequency by 1/2
  • State the five ideal conditions for Hardy–Weinberg equilibrium and apply (p + q)² = p² + 2pq + q² = 1 to calculate recessive carrier probabilities (distinguishing the whole population from phenotypically normal individuals)
  • Distinguish directional allele frequency change under natural selection (evolution) from continuous selfing that alters genotype frequencies without changing allele frequencies (no evolution), avoiding the directed-mutation misconception

Press Esc or your browser Back button anytime to return to the guide.

Principle, Mechanism & Key Concepts

How Natural Selection Changes Population Allele Frequencies

What You Will Investigate
Goal 01

Calculate autosomal and X-linked allele frequencies accurately using p(S) = f(SS) + ½·f(Ss), always multiplying the heterozygote frequency by 1/2

Goal 02

State the five ideal conditions for Hardy–Weinberg equilibrium and apply (p + q)² = p² + 2pq + q² = 1 to calculate recessive carrier probabilities (distinguishing the whole population from phenotypically normal individuals)

Goal 03

Distinguish directional allele frequency change under natural selection (evolution) from continuous selfing that alters genotype frequencies without changing allele frequencies (no evolution), avoiding the directed-mutation misconception

In mid-19th-century industrial Manchester, coal soot darkened pale lichen-covered birch bark, and within decades dark peppered moths rose from rare to the vast majority (melanic frequencies exceeding 80% in industrial areas). Did coal soot cause light moths to mutate directionally into the dark allele S?

Many students hear "adapting to the environment" and fall into the Lamarckian trap that the environment triggers directed mutations. In fact, before factories emitted soot, the melanic allele S already existed at low frequency in the peppered moth gene pool (as in this simulation's initial lesson setting: SS = 10%, Ss = 20%, ss = 70%, giving p(S) = 0.200). Coal soot did not create the S allele; it darkened tree trunks so bird predators easily spotted and ate conspicuous light moths (ss), leaving dark SS and Ss moths to survive and reproduce. Variation arises randomly before selection, and natural selection then shifts allele frequencies directionally.

Core principle: The sole criterion for biological evolution is whether population allele frequencies (p and q) change—continuous selfing halves heterozygotes each generation without changing p, so no evolution occurs. Under equilibrium, heterozygote frequency is 2pq (peaking at 50% when p = q = 0.5), and the probability that a phenotypically normal individual is a carrier equals 2pq / (p² + 2pq) = 2q / (1 + q).
A. Starting Gene Pool (F0 Lesson Setting: SS = 10%, Ss = 20%, ss = 70% ⇒ 30% Dark)Exact formula (Ss contributes 1/2 each):p(S) = 10% + ½ × 20% = 20.0% (0.200)q(s) = 70% + ½ × 20% = 80.0% (0.800)Bird predation on soot-darkened bark:• Pale ss moths stand out → low survival• p(S) rises, q(s) falls ⇒ Evolution!B. Dark Bark: 10-Gen Shift (Setting)p(S) 0.20→0.84q(s) 0.80→0.16F0→F101.00.50.0C. Hardy–Weinberg p² / 2pq / q²At p=0.5, 2pq=50%p²(SS)q²(ss)p(S) 0 → 11.00.50.0
2D Visual Guide & Diagram — How Natural Selection Changes Population Allele Frequencies

Cause-and-Effect Chain

Core Logic 01 · Random Mutation Builds Gene-Pool Diversity First
Condition: Spontaneous gene mutations, chromosomal variations, and genetic recombination occur in natural populations

Variation arises randomly and without direction before any environmental shift; it supplies raw material for evolution but does not set its direction

→ Both S and s alleles already coexisted in the peppered moth gene pool prior to industrial pollution
Core Logic 02 · Predation Acts on Phenotypes and Rewrites the Gene Pool
Condition: Coal soot blackens lichen-covered birch trunks while visual bird predators hunt resting peppered moths

Natural selection acts directly on individual phenotypes—exposed light moths (ss) are eaten more often while dark SS and Ss moths share camouflage—so survivors pass more S alleles to offspring

→ Population allele frequency p(S) rises directionally across generations, producing adaptive evolution
Core Logic 03 · Five Ideal Conditions Maintain Hardy–Weinberg Equilibrium
Condition: Very large population, random mating, no mutation, no gene flow (immigration or emigration), and no natural selection

Male and female gametes combine independently at probabilities p(S) and q(s), immediately yielding offspring genotypes (p + q)² = p² + 2pq + q²

→ Next-generation allele frequency p′ = p² + ½(2pq) = p(p + q) = p stays constant across generations with no evolution

Core Formulas & Quantitative Relations

Formula 1 · Allele Frequency Conversion (Autosomal vs. X-Linked)
Autosomal: p(S) = f(SS) + ½·f(Ss) | X-linked: p(Xᴮ) = (2N_XᴮXᴮ + N_XᴮXᵇ + N_XᴮY) / (2N_female + N_male)

For X-linked loci, females carry 2 X chromosomes while males carry only 1 X chromosome (the Y chromosome lacks that allele), so the denominator is 2N_female + N_male rather than 2N_total.

Formula 2 · Hardy–Weinberg Equation & Carrier Probability
p + q = 1 | f(AA) = p², f(Aa) = 2pq, f(aa) = q²

Given an autosomal recessive trait incidence aa = q² (for example, 1 / 10000 ⇒ q = 1 / 100, p = 99 / 100): ① carrier probability in the whole population is 2pq; ② carrier probability among phenotypically normal individuals is 2pq / (p² + 2pq) = 2q / (1 + q) = 2 / 101.

Criterion 3 · Random Mating vs. Continuous Selfing Without Selection
Random mating (no selection): p and q stay constant, and genotypes lock at p² : 2pq : q² within 1 generation | Continuous selfing (no selection): Ss halves each generation, yet p and q stay unchanged

Because biological evolution is defined as a change in population allele frequencies, continuous selfing without selection increases homozygotes and depletes heterozygotes while leaving p and q unchanged—so no evolution occurs.

From the 3D Chamber to 2D Graphs: Distinguishing Selfing from Random Mating

Population genetics graphs often plot allele frequency curves alongside genotype frequency curves. Always check what the vertical axis measures first:

  • Check ① (Look at whether p and q move to decide if evolution occurred): As long as p(S) and q(s) remain flat horizontal lines—even if AA and aa climb while Aa drops toward 0 under continuous selfing—the population is not evolving. When p and q move in opposite directions symmetrically around 0.5 while summing to 1, evolution is occurring.
  • Check ② (Random mating reaches equilibrium in a single generation): Even when an initial population is out of equilibrium—such as this simulation's F0 lesson setting of SS = 10%, Ss = 20%, ss = 70% (p = 0.2, q = 0.8, where p² = 4% ≠ 10%)—just 1 generation of random mating under ideal conditions shifts F1 genotypes directly to SS = 0.2² = 4%, Ss = 2 × 0.2 × 0.8 = 32%, and ss = 0.8² = 64%, where they remain fixed.
Model A · Continuous Selfing (p=0.5, No Evolution)Model B · Random Mating Reaches H-W in 1 Gen1.00.50p=q=0.5 constant (no evolution)AA, aa → 50%Heterozygotes Aa = (1/2)ⁿ → 0Parent F0 (Lesson setting, non-H-W):SS=10%, Ss=20%, ss=70% ⇒ p=0.2, q=0.8Random mating for 1 gen to F1 (no sel.):SS = p² = 4% | Ss = 2pq = 32% | ss = 64%F1, F2… stay locked at p=0.2, q=0.8

Concept Breakdown

01

Each diploid peppered moth carries 2 alleles at the locus, and an Ss heterozygote splits them half dark and half light.

Why multiply heterozygote Ss by 1/2 when calculating allele frequency?

Consider a population of 100 diploid peppered moths carrying 200 total alleles (matching the proportions of this simulation's F0 lesson setting): 10 homozygous dark moths (SS, contributing 20 S alleles), 20 heterozygous dark moths (Ss, contributing 20 S and 20 s alleles), and 70 light moths (ss, contributing 140 s alleles). By definition, the frequency of S among all alleles is p(S) = (20 + 20) / 200 = 40 / 200 = 20.0%, which simplifies in genotype percentages to f(SS) + ½·f(Ss) = 10% + ½ × 20% = 20.0%. Omitting the factor of 1/2 gives 10% + 20% = 30%, which mistakenly counts the s allele in every Ss moth as S—30% is the dark phenotype frequency, not the S allele frequency.

Try in the 3D bench: In Step 1, toggle the left calibration switch or click "Omit 1/2 (Error)" and "SS% + 1/2·Ss%" to compare F0 values; in Step 7, click "Genotype lens" to tell dark SS and Ss moths apart.
02

Predatory birds do not sequence DNA—they eat whichever moth stands out against the tree bark.

Does natural selection act directly on alleles or on phenotypes?

On soot-darkened industrial birch trunks, homozygous SS and heterozygous Ss moths share the same dark wing coloration (complete dominance). Insectivorous birds cannot tell SS from Ss; they selectively prey on high-contrast pale ss moths instead. Thus, natural selection acts directly on individual phenotypes. Because each eaten ss moth removes two s alleles while surviving dark moths pass on a larger fraction of S alleles, p(S) rises directionally in the gene pool. Moreover, because heterozygotes (Ss) look dark and escape heavy predation, the recessive s allele stays sheltered inside Ss carriers and does not drop to 0 in just a few generations.

Try in the 3D bench: In Steps 5–6, switch to "Soot-darkened" bark and "Selection", then click "Breed" repeatedly past F5 (under this lesson setting, p(S) reaches 0.704 at F5 and 0.841 at F10, while q(s) remains above 0 in Ss carriers).
03

Whenever allele frequencies shift—even back toward their earlier values—that is still biological evolution.

When clean-air laws restored pale lichen bark, did the moths evolve again?

After Britain enacted clean-air regulations in the late 20th century, pale gray lichen regrew on birch trunks and reversed the selective landscape. Dark moths became conspicuous targets for birds, pale ss moths regained camouflage, and both melanic phenotype frequency and p(S) declined while q(s) climbed again (under this simulation's Step 8 lesson setting, switching from F6 at p(S) = 0.746 back to light lichen bark brings p(S) down to 0.224 by F10). This reversal is not "devolution": any directional shift in allele frequency—whether p(S) increases or decreases—is adaptive evolution. Still, without reproductive isolation, dark and light moths remain a single species rather than forming a new one.

Try in the 3D bench: In Step 8, starting from the soot-darkened F6 state (p(S) = 0.746), switch the trunk back to "Light lichen" under "Selection" and breed across generations to watch the p(S) and q(s) curves cross and reverse.

Reference & Comparison Table

Effects of four mating and environmental mechanisms on genotype frequencies, allele frequencies, evolution, and speciation (lesson setting start: SS = 10%, Ss = 20%, ss = 70%)
Mechanism / ScenarioOffspring Genotype Frequency ChangeAllele Frequencies p(S) / q(s)Evolution Occurred?New Species Formed?
Random mating in an ideal large populationLocks from F1 onward at SS = 4%, Ss = 32%, ss = 64%Constant at p = 0.200, q = 0.800No (allele frequencies unchanged)No (no reproductive isolation)
Continuous selfing without selectionSs halves each generation toward 0; homozygotes riseConstant at p = 0.200, q = 0.800No (allele frequencies unchanged)No (no reproductive isolation)
Bird predation on soot-darkened barkss drops sharply; SS and Ss increase stronglyp(S) rises directionally; q(s) fallsYes (allele frequencies shift directionally)No (dark and light moths still produce fertile offspring)
Long-term geographic isolation + divergent selectionGene pools diverge until interbreeding fails or offspring are sterileGene pools diverge completely between sitesYesYes (reproductive isolation marks speciation)
Common Misconceptions

Common Misconceptions

Did industrial coal smoke cause light peppered moths to mutate directionally into the dark allele S?

No. Genetic mutations arise randomly without direction, and the dark allele S already existed in the gene pool before coal pollution began. Smoke darkened the birch bark so bird predators selectively favored existing dark phenotypes (SS and Ss) over light ones (ss). Use the "Mutation myth" button in Step 7 to review this distinction.

If a pea population self-pollinates continuously until heterozygote Aa drops from 100% to 3.125%, has it evolved?

No. Evolution is defined by a change in allele frequencies (p and q), not genotype frequencies alone. Under continuous selfing without selection, Aa halves each generation to 3.125% while p = q = 0.5 remains unchanged, so no evolution has occurred. Verify this in Step 4 by switching Mode to Selfing.

Did the shift from mostly light to mostly dark peppered moths in Manchester create a new species?

No. Microevolution is not the same as speciation. Dark and light peppered moths can still interbreed and produce fertile offspring without reproductive isolation, so they remain two phenotypes of the same species.

Practice Quiz

Test your understanding with 6 diagnostic questions

Check concepts, graphs, and experimental error reasoning with immediate feedback for every choice.

Embed & Source Availability

Embed this simulation

Paste this iframe snippet into your non-commercial course page or learning platform.

Free & Source-Available (CC BY-NC-SA 4.0)

This simulation is licensed under CC BY-NC-SA 4.0 for non-commercial educational use, embedding, and adaptation with attribution.

Browse All 159 Free Labs →
Sources, Revision & Feedback

Sources, Revision & Feedback

Quiz →