calculator.onl
Categories50

Hardy–Weinberg genotype frequencies

Estimate allele frequencies from three diploid genotype counts and compare observed heterozygosity with random-pairing expectations.

A worked example

Keep 25 AA and 25 aa individuals. Add 50 Aa and compare observed with expected heterozygosity.

p(A)0.6q(a)0.4Observed heterozygosity H0.48Expected heterozygosity H0.48
AA

Aa

aa

Updates as you type

Use a dot or comma for decimals. No thousands separators.

YOUR RESULT

p(A)

0.6

Calculated from your inputs

q(a)0.4
E[AA]36
E[Aa]48
E[aa]16
Observed heterozygosity H0.48
Expected heterozygosity H0.48
The numbers, at a glance
E[Aa] / N · p(A)
p(A): 0 · E[Aa] / N: 0p(A): 0.02 · E[Aa] / N: 0.0392p(A): 0.04 · E[Aa] / N: 0.0768p(A): 0.06 · E[Aa] / N: 0.1128p(A): 0.08 · E[Aa] / N: 0.1472p(A): 0.1 · E[Aa] / N: 0.18p(A): 0.12 · E[Aa] / N: 0.2112p(A): 0.14 · E[Aa] / N: 0.2408p(A): 0.16 · E[Aa] / N: 0.2688p(A): 0.18 · E[Aa] / N: 0.2952p(A): 0.2 · E[Aa] / N: 0.32p(A): 0.22 · E[Aa] / N: 0.3432p(A): 0.24 · E[Aa] / N: 0.3648p(A): 0.26 · E[Aa] / N: 0.3848p(A): 0.28 · E[Aa] / N: 0.4032p(A): 0.3 · E[Aa] / N: 0.42p(A): 0.32 · E[Aa] / N: 0.4352p(A): 0.34 · E[Aa] / N: 0.4488p(A): 0.36 · E[Aa] / N: 0.4608p(A): 0.38 · E[Aa] / N: 0.4712p(A): 0.4 · E[Aa] / N: 0.48p(A): 0.42 · E[Aa] / N: 0.4872p(A): 0.44 · E[Aa] / N: 0.4928p(A): 0.46 · E[Aa] / N: 0.4968p(A): 0.48 · E[Aa] / N: 0.4992p(A): 0.5 · E[Aa] / N: 0.5p(A): 0.52 · E[Aa] / N: 0.4992p(A): 0.54 · E[Aa] / N: 0.4968p(A): 0.56 · E[Aa] / N: 0.4928p(A): 0.58 · E[Aa] / N: 0.4872p(A): 0.6 · E[Aa] / N: 0.48p(A): 0.62 · E[Aa] / N: 0.4712p(A): 0.64 · E[Aa] / N: 0.4608p(A): 0.66 · E[Aa] / N: 0.4488p(A): 0.68 · E[Aa] / N: 0.4352p(A): 0.7 · E[Aa] / N: 0.42p(A): 0.72 · E[Aa] / N: 0.4032p(A): 0.74 · E[Aa] / N: 0.3848p(A): 0.76 · E[Aa] / N: 0.3648p(A): 0.78 · E[Aa] / N: 0.3432p(A): 0.8 · E[Aa] / N: 0.32p(A): 0.82 · E[Aa] / N: 0.2952p(A): 0.84 · E[Aa] / N: 0.2688p(A): 0.86 · E[Aa] / N: 0.2408p(A): 0.88 · E[Aa] / N: 0.2112p(A): 0.9 · E[Aa] / N: 0.18p(A): 0.92 · E[Aa] / N: 0.1472p(A): 0.94 · E[Aa] / N: 0.1128p(A): 0.96 · E[Aa] / N: 0.0768p(A): 0.98 · E[Aa] / N: 0.0392p(A): 1 · E[Aa] / N: 00.5001p(A): 0 · E[Aa] / N: 0
Table and calculation details
p(A)E[Aa] / N
00
0.020.0392
0.040.0768
0.060.1128
0.080.1472
0.10.18
0.120.2112
0.140.2408
0.160.2688
0.180.2952
0.20.32
0.220.3432
0.240.3648
0.260.3848
0.280.4032
0.30.42
0.320.4352
0.340.4488
0.360.4608
0.380.4712
0.40.48
0.420.4872
0.440.4928
0.460.4968
0.480.4992
0.50.5
0.520.4992
0.540.4968
0.560.4928
0.580.4872
0.60.48
0.620.4712
0.640.4608
0.660.4488
0.680.4352
0.70.42
0.720.4032
0.740.3848
0.760.3648
0.780.3432
0.80.32
0.820.2952
0.840.2688
0.860.2408
0.880.2112
0.90.18
0.920.1472
0.940.1128
0.960.0768
0.980.0392
10

Calculations run in your browser.
UNDERSTAND THE RESULT

A little context. A clearer answer.

↑ Back to calculator

When this calculator is useful

Changing the heterozygote count changes both the number of allele copies and the size of the sample used to estimate frequency. Change “Aa” from 48 to 24 and keep the other inputs from the worked example. The value for “p(A)” goes from 0.6 to 0.6316. For a related calculation, try Binomial probability calculator.

A field team records a genotype for each individual sampled at one genetic locus. Three categories are possible when every sampled individual has two copies and the locus has two alleles. The counts in those categories are the starting point here. Count an AA individual once in the AA box, even though it carries two A copies. Count an individual with one copy of each allele once in the central box. The order in which the laboratory lists the two alleles in a heterozygote makes no difference.

To estimate the A frequency, count both A copies in each AA individual and one in each Aa individual. Divide by twice the number of individuals that have a recorded genotype. An equivalent count for the alternative allele should give a frequency that completes the total to one. This check is useful when the data came from several columns of a spreadsheet. In particular, a missing genotype has no known allele contribution. Putting it into the aa column would lower the estimated A frequency without any biological observation behind the change.

Under random pairing, two A copies together have probability p squared. Two a copies have probability q squared. A mixed pair can arise in two orders, accounting for the factor of two in the central genotype probability. Multiplying each probability by the sample size gives an expectation on the same numerical scale as the observed counts. It is worth retaining the displayed decimals until the final comparison. Rounding each expected category independently can make the rounded counts add to one individual more or less than the sample size.

Consider two samples of one hundred individuals. The first contains twenty-five AA, fifty Aa and twenty-five aa. The second contains fifty AA and fifty aa with no heterozygotes. In each sample the count of A copies equals the count of a copies. Both therefore generate the same random-pairing expectations. Their observed heterozygosities differ sharply. This is why a pair of allele frequencies alone cannot reconstruct the observed genotype table unless an additional model is assumed. A heterozygote deficit describes that comparison without identifying the mechanism behind it.

The curve traces the expected fraction of heterozygotes as the A frequency varies. At its maximum, half of random diploid pairs are mixed. Move towards either end and a copy of the rare allele is increasingly unlikely to be paired with another copy of the same rare allele. The two ends are mirror images because swapping the A and a names leaves the mixed category unchanged. Changing only the sample size while keeping all genotype proportions constant scales expected counts and leaves this frequency curve in place.

Interpret the model in the context of the sampling design. Counting the same specimen more than once can make the observed proportion of its genotype too high. Combining independently sampled subpopulations can change the comparison even if each group separately has random pairing. Related individuals or a scoring error can also affect observed proportions. This page does not calculate a significance probability. Small counts in particular call for a carefully chosen test when a formal inference is needed. The three input categories refer to one diploid locus across individuals. A mating cross between a specified pair of parents answers a different question about the possible genotypes of their offspring.

What to enter

InputWhat it meansExample value
AAAA36
AaAa48
aaaa16

How the calculation works

  1. Count the typed individuals in the AA, Aa and aa categories; exclude missing genotypes.
  2. Enter nonnegative whole-number counts and compare the two allele frequencies with the expected genotype counts.
  3. Compare observed and expected heterozygosity, using the curve to see how random-pairing heterozygosity changes with allele frequency.
The formulap = (2nAA+nAa)/(2N), q = 1−p, E = N × (p², 2pq, q²)

A worked example

36 AA, 48 Aa and 16 aa individuals contain 120 copies of allele A and 80 copies of allele a, for 200 allele copies in total. The expected genotype counts are 36, 48 and 16.

Example you can load

What to enter
Result for this example · p(A)0.6
Result for this example · E[AA]36

This is a fixed example; changing the form above does not change these numbers.

Assumptions & limits

One diploid locus with two alleles and a positive number of typed individuals. The expectations are descriptive and do not include a significance test or identify causes of departures.

Frequently asked questions

Does agreement prove equilibrium?

Sampling variation and several biological processes may produce similar counts. The displayed expectations are descriptive.

How should I handle an individual whose genotype is unknown?

Do not include individuals with an unknown genotype in any of the three genotype counts. Record how many individuals were excluded.

Why do expected counts have decimals?

A model expectation averages across hypothetical samples. Observed individuals still have whole-number counts.