All Labs

Hardy-Weinberg & Natural Selection Lab

Investigate how allele frequencies change across generations under different evolutionary forces. Start with a population in Hardy-Weinberg equilibrium, then apply selection, drift, mutation, or migration to observe evolution in action.

Guided Experiment: Testing Hardy-Weinberg Equilibrium

If a population meets all five Hardy-Weinberg conditions (no selection, no drift, no mutation, no migration, random mating), what do you predict will happen to allele frequencies over 50 generations?

Write your hypothesis in the Lab Report panel, then click Next.

Controls

Population Size (N)500
Initial p (A freq)0.50
Generations50

Results

Run the simulation to see results. Adjust parameters on the left and click Run.

Allele Frequency Over Generations

Run the simulation to see the allele frequency trajectory.

Data Table

(0 rows)
#TrialGenerationp (A)q (a)Freq AAFreq AaFreq aaChi-SquareIn Equilibrium?
0 / 500
0 / 500
0 / 500

Reference Guide

Hardy-Weinberg Principle

In a non-evolving population, allele and genotype frequencies remain constant across generations.

p+q=1p + q = 1
p2+2pq+q2=1p^2 + 2pq + q^2 = 1

Where p is the frequency of the dominant allele (A) and q is the frequency of the recessive allele (a).

Conditions for Equilibrium

Five conditions must hold for a population to stay in Hardy-Weinberg equilibrium.

  • No natural selection (all genotypes equally fit)
  • No genetic drift (infinitely large population)
  • No mutation (alleles do not change)
  • No migration (no gene flow in or out)
  • Random mating (no sexual selection)

Violating any condition causes allele frequencies to change, which means evolution is occurring.

Chi-Square Test

The chi-square goodness-of-fit test determines whether observed genotype frequencies match HW expectations.

χ2=(OiEi)2Ei\chi^2 = \sum \frac{(O_i - E_i)^2}{E_i}

With df = 1. If the p-value is greater than 0.05, the population is consistent with Hardy-Weinberg equilibrium.

Evolutionary Forces

Natural Selection favors alleles that increase fitness. Genotypes with higher w contribute more offspring.

Genetic Drift causes random changes in allele frequencies, especially in small populations.

Mutation introduces new alleles or converts existing ones, slowly shifting frequencies.

Migration (gene flow) brings alleles from other populations, moving frequencies toward the migrant pool.