Population Genetics & Allele Frequency Calculator
Calculate how allele frequencies change over generations under natural selection, model fitness coefficients, and understand the forces that drive evolution.
As an Amazon Associate and CJ Affiliate publisher we earn from qualifying purchases. Prices and availability may vary.
Population Genetics Guide
What should I know about Natural Selection on Allele Frequencies?
After one generation of selection: p' = (p² × w_AA + p×q × w_Aa) / w̄. Where w̄ = p²×w_AA + 2pq×w_Aa + q²×w_aa is mean fitness. Change in p: Δp = p(p × w_AA + q × w_Aa − w̄) / w̄. For a recessive lethal (w_aa = 0): selection removes aa individuals but cannot easily purge the a allele from Aa carriers. This is why recessive genetic disorders persist in populations — heterozygotes (carriers) are invisible to selection.
What should I know about Selection Coefficient and Dominance?
Selection coefficient s = 1 − relative fitness of disadvantaged genotype. For a fully recessive deleterious allele: aa has fitness 1−s, AA and Aa have fitness 1.0. Selection is slow for recessive alleles at low frequency — most copies are hidden in heterozygotes. A dominant beneficial mutation (w_AA, w_Aa > 1): spreads rapidly because selection acts on heterozygotes (frequency 2pq). This explains why dominant adaptations spread faster than recessive ones initially — they are 'visible' to selection in every generation, even in heterozygous individuals.
What's the key thing to understand about Genetic Drift?
Genetic drift is random fluctuation of allele frequencies due to finite population size. The variance in allele frequency change per generation: Var(Δp) = p(1-p) / (2Ne). Where Ne = effective population size. For small populations, drift can override selection. Fixation probability of a new mutation by drift alone: 1/(2Ne). In a population of 100: a neutral new mutation has only a 0.5% chance of reaching fixation. Bottlenecks: brief severe reductions in population size cause dramatic allele frequency swings, since a small surviving population carries only a random subset of the original gene pool's variation — the cheetah's famously low genetic diversity is attributed to one or more historical population bottlenecks that left the entire modern population descended from a small founding group.
What should I know about Forces of Evolution?
Five forces change allele frequencies: Natural selection (differential reproduction by genotype). Genetic drift (random fluctuation — dominant in small populations). Mutation (introduces new alleles — typically very low rate, 10⁻⁸ per base per generation). Gene flow (migration between populations). Non-random mating (assortative mating, inbreeding). Hardy-Weinberg equilibrium is the null model — all frequencies are constant when none of these forces acts. Real populations always depart from H-W equilibrium to some degree, since at least one of mutation, selection, drift, migration, or non-random mating is almost always acting — Hardy-Weinberg is most useful as a baseline for detecting evolution, by comparing observed allele frequencies against what the equilibrium model predicts and treating significant deviation as evidence that a specific evolutionary force is at work.
What do I need to know about a Worked Selection Example?
Consider a recessive allele causing reduced fitness, starting at frequency q0 = 0.5, with relative fitness values w_AA = 1.0, w_Aa = 1.0 (fully recessive), w_aa = 0.5. Mean fitness w-bar = p^2(1.0) + 2pq(1.0) + q^2(0.5) = 0.25 + 0.5 + 0.125 = 0.875. New frequency: p' = [p^2 w_AA + pq w_Aa]/w-bar = [0.25+0.25]/0.875 = 0.571. So p rises from 0.5 to 0.571 in a single generation, and q falls from 0.5 to 0.429. Repeating this generation after generation shows selection against a recessive allele slows dramatically once q becomes small, because at low frequency most copies of a are hidden inside heterozygotes (Aa), which have full fitness and so are not selected against — this is why fully recessive deleterious alleles are never completely eliminated by selection alone, and can persist at low frequency indefinitely.
What's the key thing to understand about Hardy-Weinberg as a Baseline?
The Hardy-Weinberg principle is often described as the null model of population genetics — it describes what happens to allele and genotype frequencies when no evolutionary forces are acting at all (infinite population, random mating, no selection, no mutation, no migration). This is deliberately an idealised scenario; its value is as a baseline for comparison. Models like selection and drift describe departures from that baseline — selection changes allele frequencies systematically favouring fitter genotypes, drift changes them randomly due to finite population size, mutation introduces new variation, and migration mixes allele frequencies between populations. Real populations are rarely in perfect Hardy-Weinberg equilibrium, because at least one assumption is always violated to some degree — but the principle remains the essential reference point: without it, there is no way to distinguish 'this population is evolving' from 'this is simply what a stable, non-evolving population looks like', which is why Hardy-Weinberg analysis is the standard first step in almost any population genetics investigation.
What should I know about Effective Population Size and Drift Strength?
The strength of genetic drift in a population depends not on the headcount you can see (the census size) but on the effective population size, Ne — a theoretical number representing an idealised population that would lose genetic diversity at the same rate as the real one. Ne is almost always smaller than the census size because several factors reduce it: an unequal breeding sex ratio, large variation in how many offspring different individuals produce, overlapping generations, and historical bottlenecks all shrink Ne relative to the number of individuals alive. Because drift's impact on allele frequencies scales inversely with population size, a species with a small Ne — even if millions of individuals exist — can lose alleles to chance at a surprising rate, which matters for endangered species management and for interpreting genetic diversity in domesticated or heavily harvested populations. This is a key reason small, isolated populations behave very differently from the large, freely interbreeding populations that the basic Hardy-Weinberg model assumes.
Mutation-Selection Balance for a Recessive Deleterious Allele
Natural selection constantly removes a deleterious allele, while mutation constantly reintroduces it — at equilibrium, these two forces balance at a predictable frequency. For a fully recessive deleterious allele (only harmful in homozygotes), the equilibrium frequency is q(eq) = √(μ/s), where μ is the mutation rate per generation and s is the selection coefficient against homozygotes. Worked example: with a mutation rate μ = 1×10⁻⁵ and a strongly deleterious recessive allele (s = 0.8, meaning affected homozygotes have 80% reduced fitness), q(eq) = √(1×10⁻⁵ / 0.8) = √(1.25×10⁻⁵) ≈ 0.00354, or about 0.35% — a low but non-zero equilibrium frequency maintained indefinitely by new mutations, even though selection is removing the allele every generation.
Equilibrium Allele Frequency by Selection Strength
| Selection coefficient (s) | Equilibrium frequency q=√(μ/s), μ=1×10⁻⁵ | Example context |
|---|---|---|
| 1.0 (fully lethal, recessive) | 0.0032 (0.32%) | Recessive lethal genetic disease |
| 0.5 | 0.0045 (0.45%) | Moderately deleterious recessive |
| 0.1 | 0.0100 (1.0%) | Mildly deleterious recessive |
| 0.01 | 0.0316 (3.16%) | Nearly neutral recessive variant |
Worked Example: Hardy-Weinberg Genotype Frequencies From an Allele Frequency
Suppose the frequency of a recessive allele 'a' in a population is q = 0.3, meaning the dominant allele frequency is p = 1 - 0.3 = 0.7. Under Hardy-Weinberg equilibrium, genotype frequencies are given by p^2 (homozygous dominant), 2pq (heterozygous), and q^2 (homozygous recessive). Homozygous dominant (AA): p^2 = 0.7^2 = 0.49, or 49% of the population. Heterozygous (Aa): 2pq = 2 × 0.7 × 0.3 = 0.42, or 42% of the population. Homozygous recessive (aa): q^2 = 0.3^2 = 0.09, or 9% of the population. As a check, these three frequencies sum to 0.49 + 0.42 + 0.09 = 1.00, accounting for the entire population. Notably, even though only 9% of the population shows the recessive phenotype, a much larger 42% are heterozygous carriers of the recessive allele without displaying it -- a gap between visible trait frequency and hidden carrier frequency that is central to genetic counseling for recessive conditions.
Forces That Push a Population Away From Hardy-Weinberg Equilibrium
Hardy-Weinberg equilibrium is a theoretical baseline that only holds when five strict conditions are met; real populations deviate from it whenever one or more of these assumptions is violated.
| HW assumption | What violating it causes | Example |
|---|---|---|
| No mutation | Introduces new alleles, slowly shifting frequencies | A new resistance allele arising in a pest population |
| No migration (gene flow) | Mixes allele frequencies between populations | Pollen or seed dispersal between separated plant populations |
| Random mating | Non-random mating skews genotype ratios without changing allele frequency | Assortative mating by a visible trait |
| No selection | Allele frequencies shift toward favored alleles | The selection-coefficient scenario covered above |
| Infinite population size | Finite size introduces genetic drift, random frequency changes | Small, isolated populations founder-effect scenarios |
In practice, essentially every real population violates at least one of these five assumptions to some degree, which is exactly why Hardy-Weinberg is used as a null hypothesis -- a comparison baseline -- rather than a description of how real allele frequencies actually behave; a population's measured genotype frequencies deviating from the p^2 : 2pq : q^2 ratio is itself evidence that one of these five evolutionary forces is actively at work.