Mathematical Modeling: Hardy-Weinberg
This lab is really about using math to figure out whether a population is evolving. You build a model of what allele and genotype frequencies should look like if nothing is driving change, then compare that to what you actually observe. If the numbers don't match, something evolutionary is happening.
The Hardy-Weinberg model acts as your null hypothesis: the baseline expectation for a non-evolving population. Learning to use it, test it, and explain deviations from it is exactly what the AP exam will ask you to do.

Why This Lab Matters for the AP Exam
Hardy-Weinberg shows up constantly on the AP Biology exam, and not just as a plug-and-chug calculation. The exam wants you to interpret what the numbers mean biologically. You need to be able to calculate allele and genotype frequencies, identify which Hardy-Weinberg conditions are being violated, and explain what evolutionary mechanism is responsible.
Free-response questions will often give you a population scenario and ask you to determine whether evolution is occurring, then explain why. This lab builds exactly that skill set.
CED Connections
This lab connects directly to Unit 7: Natural Selection, specifically Topics 7.4 and 7.5.
Topic 7.5 (Hardy-Weinberg Equilibrium) is the core of this lab. Learning Objective LO 7.5.A asks you to describe the conditions under which allele and genotype frequencies will change. EK 7.5.A.1 lays out the five conditions for Hardy-Weinberg equilibrium, and EK 7.5.A.2 connects the math: you can calculate allele frequencies directly from genotype frequencies.
Topic 7.4 (Population Genetics) gives you the mechanisms that explain why a population might deviate from equilibrium. LO 7.4.A and EK 7.4.A.1 cover the random processes that drive evolution, including genetic drift, the bottleneck effect, the founder effect, and gene flow through migration. LO 7.4.B and EK 7.4.B.1 connect those random processes to actual changes in allele frequencies. LO 7.4.C and EK 7.4.C.1 tie it together: changes in allele frequencies are your evidence that evolution is occurring.
What You Need to Be Able to Do
This lab builds several skills that appear directly on the AP exam.
- Calculate allele frequencies from given genotype data using
- Calculate expected genotype frequencies using
- Compare observed vs. expected frequencies to determine whether a population is in equilibrium
- Identify which Hardy-Weinberg condition is being violated based on a scenario description
- Connect deviations from equilibrium to specific evolutionary mechanisms like genetic drift, natural selection, or gene flow
- Use the Hardy-Weinberg model as a null hypothesis and explain what it means when data deviate from it
- Interpret simulated population data across multiple generations to track allele frequency change over time
Core Concepts
Hardy-Weinberg Equilibrium is a mathematical model that describes what allele and genotype frequencies look like in a population that is not evolving. It gives you a prediction to test against real data.
The two equations you need are:
Here, p is the frequency of one allele (usually the dominant one) and q is the frequency of the other allele (usually the recessive one). The genotype frequencies are:
p²= frequency of the homozygous dominant genotype2pq= frequency of the heterozygous genotypeq²= frequency of the homozygous recessive genotype
The homozygous recessive genotype is especially useful because it is the only genotype you can identify directly from phenotype alone (when the recessive trait is expressed). That makes q² your starting point in most Hardy-Weinberg problems.
Allele frequency refers to how common a particular allele is in a population, expressed as a proportion between 0 and 1. Genotype frequencies describe how common each genotype combination is in that same population.
A non-evolving population is a theoretical population where allele frequencies stay constant from generation to generation. No real population perfectly fits this description, but the model is still useful.
The null hypothesis in this context is the claim that the population is in Hardy-Weinberg equilibrium and therefore not evolving. When your data deviate from the expected frequencies, you have evidence to reject that null hypothesis.
The five conditions required for Hardy-Weinberg equilibrium are:
- Large population size
- No migration
- No new mutations
- Random mating
- No natural selection
When any of these conditions is violated, allele frequencies can change, which means evolution is occurring. Evolution, in the population genetics sense, simply means a change in allele frequencies over time.
Genetic drift is a change in allele frequencies caused by random chance, not selection. It has the biggest effect in small populations. Two specific types matter here:
- The bottleneck effect happens when a population is drastically reduced in size (by a disaster, for example), and the survivors carry only a subset of the original genetic variation.
- The founder effect happens when a small group breaks off from a larger population and starts a new one. The new population's allele frequencies reflect the founders, not the original group.
Gene flow is the movement of alleles into or out of a population through migration. It can introduce new alleles or change the frequencies of existing ones.
Mutations are random changes to DNA that introduce new genetic variation into a population. They are the original source of all new alleles.
Natural selection acts on phenotypes produced by genetic variation, favoring alleles that improve survival and reproduction in a given environment.
Genetic variation is the raw material for evolution. Without variation in alleles, selection has nothing to act on.
How the Lab Works
The investigation uses mathematical modeling and simulation to explore what happens to allele frequencies under different conditions. Rather than working with a real organism over many generations, you simulate a population and track how allele frequencies change (or stay the same) depending on which Hardy-Weinberg conditions are in place.
The core logic works like this: you start with a population that has known allele frequencies, then run the simulation under controlled conditions. In one scenario, all five Hardy-Weinberg conditions are met. In others, you introduce violations, like reducing population size to model genetic drift, or adding migration to model gene flow.
By comparing the allele frequencies you observe after multiple generations to the frequencies predicted by the Hardy-Weinberg equations, you can see whether the population is evolving and what might be causing it.
The simulation approach is important because it lets you isolate one variable at a time. If you change only population size and everything else stays constant, any deviation from equilibrium can be attributed to genetic drift. That kind of controlled comparison is exactly what the AP exam expects you to reason through.
Data and Analysis Moves
Starting from the homozygous recessive genotype
Most Hardy-Weinberg problems give you phenotype data, not genotype data. If you know the frequency of individuals showing the recessive phenotype, that frequency equals q². From there:
Then you can calculate expected genotype frequencies using p², 2pq, and q².
Comparing observed to expected
Once you have expected genotype frequencies, multiply each by the total population size to get expected counts. Compare those to your observed counts. If they are close, the population is likely in equilibrium. If they differ noticeably, something is driving evolution.
Tracking allele frequencies across generations
When your simulation runs for multiple generations, record p and q at each generation. Plot allele frequency on the y-axis and generation number on the x-axis. A flat line suggests equilibrium. A drifting or directional change suggests evolution is occurring.
Identifying the mechanism
Ask yourself which condition was changed in the simulation. Small population size points to genetic drift. A sudden reduction in population size followed by recovery points to the bottleneck effect. A new subgroup starting from a few individuals points to the founder effect. Movement of individuals between populations points to gene flow. Consistent directional change in allele frequency over generations points to natural selection.
Controls and variables
Your control condition is the simulation run with all five Hardy-Weinberg conditions met. Each experimental condition changes exactly one variable. This lets you attribute any observed change in allele frequency to that specific factor.
Common Mistakes
Confusing allele frequency with genotype frequency. These are not the same thing. p is the frequency of an allele across all copies of that gene in the population. p² is the frequency of individuals who are homozygous for that allele. Mixing these up will break your calculations.
Forgetting that q² is your entry point. When you are given phenotype data, the recessive phenotype frequency equals q², not q. Always square root first.
Thinking Hardy-Weinberg equilibrium means no genetic variation. It does not. A population in equilibrium still has multiple alleles. The frequencies just are not changing.
Treating the five conditions as a checklist rather than a model. The conditions are never perfectly met in real populations. The point is that the model gives you a null hypothesis. Deviations from it are meaningful, not failures of the model.
Assuming genetic drift only matters in tiny populations. Drift matters most in small populations, but the AP exam may ask you to compare its effect across different population sizes. Larger populations are more buffered against drift, but it still occurs.
Mixing up bottleneck effect and founder effect. Both are types of genetic drift, but the cause is different. A bottleneck is caused by a sudden reduction in an existing population. A founder effect is caused by a small group leaving to start a new population. The distinction matters for free-response explanations.
Saying a population "is evolving" without connecting it to allele frequency change. On the AP exam, evolution in a population genetics context means allele frequencies are changing over time. Always anchor your claim to that definition.
Quick Review Checklist
- Hardy-Weinberg equilibrium describes a non-evolving population and serves as the null hypothesis for detecting evolution
- The two equations are and , where
pandqare allele frequencies - Start Hardy-Weinberg calculations from
q²(the homozygous recessive genotype frequency) when only phenotype data is given - The five conditions for equilibrium are large population, no migration, no new mutations, random mating, and no natural selection
- Genetic drift, bottleneck effect, founder effect, gene flow, mutation, and natural selection are all mechanisms that can cause allele frequencies to deviate from Hardy-Weinberg predictions
- Bottleneck effect and founder effect are both types of genetic drift that occur in small populations, but through different scenarios
- A change in allele frequency over time is the definition of evolution at the population level
- Comparing observed genotype frequencies to expected Hardy-Weinberg frequencies is how you test whether evolution is occurring