Genetics & Inheritance

Hardy–Weinberg Expectations & Exact Comparison Calculator

Calculate equilibrium genotype expectations from allele or genotype proportions, preserve ambiguous inverse solutions, or compare observed counts with a conditional exact test.

Biology · experimental measurements

Distinguish observed genotype counts, equilibrium expectations and statistical evidence about their agreement.

Private calculations in your browser · explicit inputs and model boundaries
Example preview · Known allele frequencyEquilibrium genotype counts for every valid solution
Solution 1 · AA640 expected individuals
Solution 1 · Aa320 expected individuals
Solution 1 · aa40 expected individuals

The displayed counts are expectations under the chosen equilibrium input. Two inverse branches can share the heterozygote count while swapping their homozygote counts.

  1. 1EnterProvide the known values
  2. 2CalculateResults update automatically
  3. 3VerifyReview the details and units
Try an example

Use a fraction from 0 to 1, not a percentage. HWE heterozygote proportions cannot exceed 0.5.

Used for expected counts only.

Calculation result

Enter valid values to see the result.

Your entries are calculated in this browser and are not submitted to 365CALCS.COM.

Feedback

Understand the relationship

The reasoning behind the result

The square connects allele probabilities to genotype expectations

(p+q)² = p² + 2pq + q² = 1

Under the model, independently sampled parental alleles have probabilities p for A and q for a. Two A alleles give p², two a alleles give q², and the two orders A/a and a/A contribute 2pq to heterozygotes. Multiplying these proportions by N produces expected counts.

These are model expectations, not measured genotype frequencies. Hardy–Weinberg reasoning assumes an appropriate randomly mating, diploid, two-allele population model; population structure, related sampling, selection and observation error affect interpretation.

An inverse solve can have two valid answers

Given H=2q(1−q): q=(1±√(1−2H))/2

If the aa proportion is supplied under HWE, q is its nonnegative square root. If the heterozygote proportion H is supplied, the quadratic is symmetric in p and q: H=0.32 supports q=0.2 and q=0.8. The calculator retains both and swaps their homozygote proportions.

H cannot exceed 0.5 in this model. Calling heterozygotes carriers does not choose the rarer-allele branch or establish a disease model; carrier-frequency searches resolve here as explicit heterozygote arithmetic.

Observed data require their own comparison

Observed AA, Aa and aa counts determine the allele frequencies and fitted expected counts. The table reports each observed-minus-expected difference. The exact comparison conditions on the sample size and observed allele-copy totals and considers all compatible heterozygote counts.

The reported two-sided P value adds configurations whose conditional probabilities are no greater than the observed configuration's probability, including ties. It is an ordinary conditional exact P value, with no mid-P adjustment and no automatic pass/fail threshold.

A statistical comparison cannot establish the cause

A small P value describes discordance with the specified null model under its sampling assumptions. It cannot distinguish population mixture, genotype error, related sampling, selection or another cause. A large P value does not prove equilibrium or validate a dataset.

The comparison is for one autosomal, biallelic, diploid record. Multiple-testing control, uncertain genotype likelihoods, sex-chromosome models and related-individual methods require a different analysis. Extremely small P values are accompanied by their base-10 logarithm.

Follow the numbers

A 32% heterozygote expectation has two branches

  1. Set 2q(1−q)=0.32, so q²−q+0.16=0.
  2. The discriminant is 1−0.64=0.36 and its square root is 0.6.
  3. The two solutions are (1−0.6)/2=0.2 and (1+0.6)/2=0.8.
  4. For 1000 individuals, the first branch expects 640 AA, 320 Aa and 40 aa; the second expects 40 AA, 320 Aa and 640 aa.

The same heterozygote proportion supports different allele identities and homozygote expectations; both solutions must be retained.

Quick guide

How to use this calculator

  1. Choose an observed-count comparison or an explicitly assumed equilibrium input.
  2. Enter proportions on a 0–1 scale. Observed-count mode accepts 1–100000 typed individuals in total.
  3. Inspect both inverse branches when only heterozygote proportion is known. In observed mode, a P value is not the probability that equilibrium is true.

Calculation method

Calculation and interpretation

Distinguish observed genotype counts, equilibrium expectations and statistical evidence about their agreement.

p+q=1; E[AA]=Np², E[Aa]=2Npq, E[aa]=Nq². For observed counts, p=(2nAA+nAa)/(2N); exact-test P sums conditional configurations no more probable than observed.

Worked example

A 32% heterozygote expectation has two branches

The same heterozygote proportion supports different allele identities and homozygote expectations; both solutions must be retained.

p+q=1; E[AA]=Np², E[Aa]=2Npq, E[aa]=Nq². For observed counts, p=(2nAA+nAa)/(2N); exact-test P sums conditional configurations no more probable than observed.

Supported inputs

Precision and limits

Population model, not individual risk

No genotype, clinical carrier status, disease probability, ancestry or reproductive risk is inferred for an individual. Equilibrium assumptions must be justified independently.

Exact comparison scope

One autosomal, biallelic, diploid locus with independent, accurately typed observations. The two-sided conditional test includes equal-probability configurations, uses no mid-P adjustment and supplies no automatic rejection threshold. At most 100000 typed individuals.

Continue calculating

Related calculators