ThisCalculator

Biology

Expected Hardy-Weinberg Genotypes: How to Calculate Them

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Expected Hardy-Weinberg Genotypes: How to Calculate Them

This calculator estimates the expected numbers of each genotype under Hardy-Weinberg equilibrium from the frequencies of two alleles and the population size. Enter the frequency of allele A and the number of individuals; the results are expected AA, Aa, and aa counts, plus the frequency of allele a.

Formula

For a population with two alleles, A and a, Hardy-Weinberg genotype frequencies are p² for AA, 2pq for Aa, and q² for aa. The allele frequencies satisfy p + q = 1. To convert genotype frequencies to expected individual counts, multiply each frequency by the population size N:

  • Expected AA count = N × p²
  • Expected Aa count = N × 2pq
  • Expected aa count = N × q²
  • Frequency of a: q = 1 − p

Here, p and q are proportions from 0 to 1, not percentages; N is the number of individuals. The counts are estimates and can be fractional before rounding. The calculator displays counts to two decimal places, so rounded outputs may not add to exactly N.

Worked Example

Use the calculator’s default values: p = 0.6 and N = 100 individuals. First find q:

q = 1 − 0.6 = 0.4

Then calculate each expected genotype count:

  • AA = 100 × 0.6² = 100 × 0.36 = 36.00 individuals
  • Aa = 100 × 2 × 0.6 × 0.4 = 100 × 0.48 = 48.00 individuals
  • aa = 100 × 0.4² = 100 × 0.16 = 16.00 individuals

The expected allele-a frequency is 0.40. The expected counts sum to 36 + 48 + 16 = 100 individuals.

What You’ll Need

  • The frequency of one allele, measured as a proportion between 0 and 1. This could be p, the frequency of A.
  • The population size, N, expressed as a count of individuals from the population being studied.
  • A reason to assume Hardy-Weinberg equilibrium, or a clear understanding that the calculation is a theoretical comparison rather than a prediction guaranteed to match observed data.

Step-by-Step

  1. Define the population and gene. Decide which population, generation, and gene or genetic marker you are analyzing. The model applies to allele frequencies at a particular locus; do not combine unrelated populations or loci.
  2. Get an allele frequency. Use a reliable estimate for one of the two alleles. If you have genotype counts for a diploid population, calculate p for A as (2 × number of AA individuals + number of Aa individuals) ÷ (2 × total individuals). Each individual contributes two copies of the gene, which is why the denominator is 2N.
  3. Check the input scale. Convert percentages to proportions: for example, 60% becomes 0.60. Make sure the value is not below 0 or above 1. If your source gives q rather than p, you can use q directly in the formulas, or enter p = 1 − q into this calculator.
  4. Enter the population size. Use the number of individuals in the population to which your allele frequency applies. Do not enter the number of allele copies unless you have intentionally converted the calculation to a chromosome-copy count.
  5. Calculate the other allele frequency. Find q = 1 − p. Confirm that p + q equals 1. For example, if p is 0.6, q is 0.4.
  6. Square each allele frequency and calculate the heterozygote frequency. The expected frequencies are p² for AA, 2pq for Aa, and q² for aa. The factor of 2 accounts for the two possible allele orders in a heterozygote: A from one parent and a from the other, or vice versa.
  7. Convert frequencies to expected counts. Multiply each genotype frequency by N. Keep extra decimal places during calculations, then round the final counts to a sensible precision for the population size.
  8. Check the result. The genotype frequencies should sum to 1, and the expected counts should sum to N before rounding: p² + 2pq + q² = (p + q)² = 1. A mismatch usually points to a conversion, entry, or rounding error.
  9. Compare with observed data carefully. Expected counts alone do not show whether a population is in equilibrium. If you have observed genotype counts, compare observed and expected values using an appropriate statistical test, such as a chi-square test when its assumptions and expected-count requirements are met.

Common Mistakes

  • Entering a percentage as a whole number: enter 60% as 0.60, not 60. A frequency above 1 is invalid.
  • Using p², pq, and q²: the heterozygote term must be 2pq. Without the 2, the three genotype frequencies will not generally sum to 1.
  • Confusing individuals with alleles: N is the number of diploid individuals in this calculator. The population has 2N gene copies, but the expected genotype counts are still scaled by N.
  • Rounding too early: retain the original allele frequency and round only the final results. Early rounding can make totals drift.
  • Treating expected values as observed counts: Hardy-Weinberg calculations give model-based expectations. Real samples can differ because of chance or because equilibrium assumptions are not met.

Tips

  • Label alleles consistently and state which one is p; swapping A and a swaps the homozygote labels but leaves the heterozygote expectation unchanged.
  • For genotype data, calculate allele frequency from the genotype counts rather than estimating it by eye.
  • Keep the population definition and sampling method consistent when estimating allele frequencies and choosing N.
  • Use exact or unrounded values for a statistical test. The two-decimal calculator display is for readability, not a substitute for full-precision calculations.

Troubleshooting

The calculator rejects a frequency: check that you entered a decimal between 0 and 1. If your value is a percentage, divide it by 100 first.

Expected counts do not add to the population size: check the inputs and the formula, especially the 2 in 2pq. Small discrepancies after display rounding are normal; recalculate with unrounded values to verify the total.

You have three or more alleles: the two-allele version is not sufficient. For allele frequencies p₁, p₂, and so on, genotype expectations are pᵢ² for each homozygote and 2pᵢpⱼ for each distinct pair, under the relevant equilibrium assumptions.

Your observed counts differ substantially: do not change the expected values just to make them fit. Check data quality, sampling, population structure, relatedness, and whether the biological assumptions are plausible. Use an appropriate formal test and interpretation for your study.

Frequently Asked Questions

What does expected Hardy-Weinberg mean?
It means the genotype frequencies predicted from allele frequencies under the Hardy-Weinberg model: p², 2pq, and q².

Can I calculate expected genotypes from a recessive phenotype frequency?
If the phenotype is fully recessive and the model is appropriate, its frequency estimates q². Take the square root to estimate q, then calculate p = 1 − q. This inference can be unreliable if the phenotype is not completely penetrant or other genetic effects are involved.

Do expected genotype counts have to be whole numbers?
No. They are mathematical expectations and may be fractional. Observed counts are whole individuals; round expected values only when presenting them, and use unrounded values for calculations.

Does matching the expected counts prove equilibrium?
No. A close match is consistent with the model but does not prove its assumptions. Sampling variation and study design also matter, and a suitable statistical test may be needed.

What assumptions does Hardy-Weinberg equilibrium use?
The standard model assumes random mating, a sufficiently large population, and no meaningful effects from selection, migration, or mutation at the locus. Real populations may depart from one or more assumptions.

Related

Formula used
in p | Frequency of allele A | - | 0.6 | 0
in N | Population size | individuals | 100 | 0
out AA | Expected AA individuals | individuals | N * p ^ 2 | 2
out Aa | Expected Aa individuals | individuals | N * 2 * p * (1 - p) | 2
out aa | Expected aa individuals | individuals | N * (1 - p) ^ 2 | 2
out q | Frequency of allele a | - | 1 - p | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.