What you'll investigate
Why does the allele for cystic fibrosis stay in human populations even though people with two copies are seriously ill? Why is polydactyly (extra fingers) rare even though its allele is dominant? To answer questions like these, population biologists build mathematical models of gene pools.
In this lab you will build a spreadsheet model of a population, step by step, the way scientists build models: draw gametes at random from a gene pool, join them into zygotes, count genotypes and calculate new allele frequencies. Then you will run many populations for many generations, switch on selection, mutation, migration and genetic drift, and design your own modeling experiment.
- EVO-1.K Describe the conditions under which allele and genotype frequencies will change in populations.
- EVO-1.L Explain the impacts on the population if any of the conditions of Hardy-Weinberg are not met.
- Science Practice 5.A Perform mathematical calculations: p + q = 1, p² + 2pq + q² = 1, and chi-square.
- Build, test and critique a model, and use it to test a hypothesis.
There are no chemical hazards here, but modelers have their own habits: record every assumption, test the model with values where you know the answer, and save versions as you go. Your tables and answers on this page save in your browser automatically.
Gene pools and the Hardy-Weinberg null model
- Evolution can be tracked as changes in allele frequencies: p + q = 1 for one gene with two alleles.
- Random mating in a Hardy-Weinberg population gives genotype frequencies p², 2pq and q².
- Hardy-Weinberg is a null model: with no drift, selection, mutation or migration, p and q never change.
- In a small population, random gamete choice (drift) makes allele frequencies wander by chance.
- Each force enters at a different life-cycle stage: mutation on gametes, selection on zygotes and juveniles, migration on adults.
Evolution happens in populations, not individuals. One way to track it is to follow the allele frequencies at one gene from generation to generation. Imagine a diploid organism with one gene that has two alleles, which we will call A and B (the spreadsheet handles letters more easily than A and a). Let
Every gamete carries either A or B. If gametes meet at random, the chance that an egg and a sperm are both A is p × p = p². Both B: q². One of each can happen two ways (A egg with B sperm, or B egg with A sperm), so heterozygotes make up 2pq. That gives the Hardy-Weinberg equation:
An idealized life cycle
To build a model you simplify. The model follows one life cycle: adults release gametes into one shared pool, gametes pair at random to form zygotes, zygotes grow into juveniles and then adults. Each arrow is a place where something could change allele frequencies.
The starting assumptions are strict: the gene pool is infinite, every gamete has the same chance of being used, all zygotes survive to be adults, nobody enters or leaves, and there is no mutation. Under those conditions p and q stay the same forever. That is the Hardy-Weinberg equilibrium. It is a null model: a description of "nothing is happening." When real allele frequencies change, or genotypes do not match p², 2pq and q², the model tells you that some force (selection, mutation, migration, nonrandom mating or drift) is at work.
A spreadsheet can mimic random gamete choice with the RAND() function, which returns a random decimal between 0 and 1. If RAND() ≤ p, the gamete is A; otherwise it is B. Because each draw is random, a small population will wander away from the expected numbers just by chance. That wandering is genetic drift, and it is the first thing your model will show you.
What this simulation models
- Process: How allele and genotype frequencies change, or stay at Hardy–Weinberg equilibrium, for one gene with two alleles (A and B) in a diploid population.
- Included: Random mating, population size (genetic drift), starting allele frequency, number of generations and populations, and optional selection (fitness of AA, AB and BB), mutation in both directions and migration. The card game adds its own cases, such as lethal BB and isolated groups.
- Simplified or left out: Generations do not overlap and fitness stays constant. Real populations have many genes, mate choice, age structure and changing environments, so their frequencies change less predictably.
Before you start
The class card simulation
Before you begin: Complete one round of random pairing, then record the AA, Aa and aa genotype counts before starting the next round.
Need a quick science reminder?
Genotype means an individual's pair of alleles (AA, Aa or aa). Allele frequency is calculated from all allele copies in the population.
Controls
More options
Full procedure
Before building a computer model, many classes act out a gene pool with cards. Every student starts as a heterozygote (AB) holding four cards: two A and two B, standing for the chromosomes they could pass on. Each round, students pair up at random. Each partner shuffles and hands over one card face-down, which makes one offspring; the pair does this twice. The two students then take on their two offspring's genotypes and the class repeats. Try the four cases below. Notice how a class-sized population behaves.
Build the spreadsheet: one generation
Controls
Full procedure
The modeling steps from Otto and Day: (1) formulate the question, (2) determine the basic ingredients, (3) describe the system qualitatively, (4) describe it quantitatively, (5) analyze the equations, (6) perform checks and balances, (7) relate the results back to the question. Steps 1–3 are in the Background. Here is step 4, built as a spreadsheet. Click any cell to see its formula.
- D2 holds p. D3 is
=1-D2. - E5 and F5 each draw one gamete:
=IF(RAND()<=D$2,"A","B"). The $ keeps the formula pointing at D2 when copied down. - G5 joins them into a zygote:
=CONCATENATE(E5,F5). - H5, I5, J5 put a 1 in the column that matches the zygote's genotype; I5 uses a nested IF to catch both AB and BA.
- Copy row 5 down for as many zygotes as you want, total each column with SUM, and calculate the new p.
Chi-square check: expected counts are p̂²N, 2p̂q̂N and q̂²N, using the allele frequency p̂ calculated from these zygotes. Three genotype classes minus one, minus one more for estimating p̂ from the data, leaves df = 1. Grey bars show what the gene pool value in D2 predicts.
Many generations, many populations
Controls
More options
Full procedure
Now copy the model forward: each generation's new p seeds the next generation's gene pool (each generation feeds the next). Running several populations side by side shows which results are predictable and which are luck. Start with drift only and compare small and large populations. Then turn on the other forces one at a time.
Model order each generation: gametes drawn from the gene pool (with mutation A→B at rate μ and B→A at rate ν) → N zygotes by random union → each zygote survives with probability w for its genotype (selection) → migrants from a source population with allele frequency pm make up a fraction m of the adults → the adults' alleles form the next gene pool. With drift switched off, the model uses the exact expected values (an infinite population).
Population 1, generation by generation. Adult genotype counts after selection and migration, with a chi-square test against Hardy-Weinberg proportions for that generation (df = 1, critical value 3.84). Long runs show every few generations.
Test your own hypothesis with the model
Controls
More options
Full procedure
Pick one factor that can change allele frequencies and ask a question about it. Examples: How small must a population be before drift regularly removes an allele within 50 generations? How fast does selection remove a recessive harmful allele compared with a dominant one? How much migration does it take to swamp selection? The experiment runner below changes one parameter across the levels you choose, runs replicate populations at each level, and graphs the result with ±2 SE error bars. All other parameters come from the model in the previous step, so set those first.
What does the model tell you?
Alleles: p + q = 1
Expected genotypes: p2 (AA), 2pq (Aa), q2 (aa).
Allele frequencies and genotype frequencies are different. Compare observed and expected counts before interpreting χ².
How do I interpret allele frequencies and the model?
- Distinguish alleles and genotypes. Use p and q for allele frequencies; use p², 2pq, and q² for expected genotype frequencies under Hardy-Weinberg conditions.
- Compare counts fairly. Convert expected genotype frequencies to expected counts using the same population size as the observed sample.
- Interpret model outcomes. Identify which assumptions were changed in your simulation and compare multiple generations or repeated runs before claiming a pattern.
- Use the chi-square result. Compare observed and expected counts, then interpret the statistic using the appropriate significance criterion.
A model helps test explanations; differences between model and observations may reflect sampling, violated assumptions, or both.
Chi-square test for Hardy-Weinberg proportions
Enter genotype counts from your model, a card simulation, or real data (for example, a class taste test where the intermediate phenotype marks heterozygotes).
EXAMPLE — not your data. Sample counts 19 / 53 / 28.
Questions
Claim, evidence, reasoning
Scientific reasoning self-check (optional)
Review your own explanation before submitting. These checkpoints are reminders, not automatic grading or evaluation of your writing.
- My claim identifies which Hardy-Weinberg assumption or model setting was tested.
- I cite allele or genotype frequencies across generations with correct units or proportions.
- I distinguish a model prediction from the observed simulation outcome.
- I explain whether drift, selection, or sampling could account for the observed pattern.
If something is missing, revisit your measurements and revise your explanation. Your writing is not automatically scored here.
Where can you go from here?
The best test of a model is the real world. Few human traits show a clear intermediate phenotype, but the ability to taste bitter compounds such as PTC (the "supertaster" trait) comes close: heterozygotes often taste moderately, so you can count all three genotypes in a class and test Hardy-Weinberg with chi-square.
Optional: build the same model yourself in a real spreadsheet such as Google Sheets, using the formulas in the Build step. More powerful free models exist, such as Jon Herron's AlleleA1.