How this calculation works
Enter the observed counts of AA, AB, and BB genotypes. They must be nonnegative integers from unrelated diploid individuals at the same autosomal locus, with a positive total. Allele names are arbitrary, but the heterozygote category must represent one copy of each allele. Combining several loci or populations into a single count vector changes the interpretation and is not supported.
P(h | N,m) ∝ 2ʰ/[((m−h)/2)!h!((2N−m−h)/2)!], for feasible h of matching parity; normalize then sum the selected exact tail.A worked example
AA30,AB40,BB30 gives probability-ordering exact two-sided p≈0.046855212 and deficit p≈0.031536695.
Good to know
One autosomal biallelic locus with AA,AB,BB nonnegative integer counts, total 1–100000 and support <=20000. Probability-ordering two-sided conditional p plus prespecified excess/deficit alternatives; monomorphic case explicitly uninformative. No X-linked loci, multi-allelic locus, population mixture correction or association diagnosis.
Begin with one autosomal biallelic locus
Enter the observed counts of AA, AB, and BB genotypes. They must be nonnegative integers from unrelated diploid individuals at the same autosomal locus, with a positive total. Allele names are arbitrary, but the heterozygote category must represent one copy of each allele. Combining several loci or populations into a single count vector changes the interpretation and is not supported.
The page permits up to one hundred thousand individuals, subject to a twenty-thousand-outcome conditional support limit. The exact calculation is about genotype counts given allele counts, not a test on separately supplied allele frequencies. A monomorphic sample has only one possible conditional outcome and is explicitly uninformative for detecting an equilibrium departure, even though its conditional p can be one.
Compare this with the Exact binomial test calculator with two-sided p-value. Uses the conditional heterozygote-count distribution given the allele count, which is not binomial. Returns expected genotype counts, heterozygote excess/deficit and exact conditional test.
Condition on the observed allele count
For total N and A-allele copy count m equal to twice AA plus AB, the possible heterozygote counts have the same parity as m and range over feasible values. Each heterozygote count determines both homozygote counts. The test evaluates this finite collection under random pairing conditional on N and m, avoiding a large-sample chi-square approximation that can be poor for rare alleles.
An outcome with h heterozygotes receives relative weight proportional to two to the power h divided by AA factorial, h factorial, and BB factorial. Normalizing those weights over feasible outcomes gives the conditional probability distribution. Computing in log scale or by stable recurrences avoids enormous factorials and underflow. The calculation does not require every possible genotype count to have a large expected frequency.
Specify which exact tail answers the question
The default two-sided p sums conditional probabilities no greater than the observed outcome's probability, with a tolerance for numerical ties. This probability-ordering definition can differ from twice a one-sided tail because the discrete distribution is not necessarily symmetric. The page does not silently substitute a mid-p value, which would give half weight rather than full weight to the observed probability.
A deficit alternative sums feasible heterozygote counts at or below observed; an excess alternative sums those at or above observed. These alternatives should reflect a question chosen before examining the sample. Switching tails after seeing which is smaller changes the testing procedure. The displayed expected heterozygosity may aid interpretation, but the p is computed from the conditional distribution, not from a normal approximation around that expectation.
Check counts thirty, forty, thirty
The default sample has thirty AA, forty AB, and thirty BB individuals. N is one hundred and each allele appears one hundred times among two hundred copies, giving estimated allele frequency one half. The familiar fitted equilibrium proportions would produce expected counts twenty-five, fifty, and twenty-five, so the observed forty heterozygotes represent a deficit relative to that descriptive benchmark.
The conditional probability of the observed outcome is approximately 0.019740445. Summing outcomes at least as unlikely gives a probability-ordering two-sided p near 0.046855212. The deficit tail is approximately 0.031536695 and the excess tail approximately 0.988203749. These different values demonstrate why the two-sided calculation must be identified explicitly rather than described merely as an exact test without its ordering convention.
Read the conditional support diagram
The horizontal axis in the figure represents feasible heterozygote counts, not independent people or allele positions. Only counts of the correct parity appear. Bar heights represent normalized conditional probabilities, and the observed count is marked separately. Two-sided shading follows probability height: it can select outcomes in both tails without being exactly symmetric around the most probable count.
A deficit shaded region includes the observed count and smaller feasible counts, while an excess region includes the observed count and larger ones. Those inclusive definitions explain why opposite one-sided probabilities need not sum to one: the observed probability is included twice. The drawing is an explanation of finite-support inference and should not be interpreted as a histogram of individual genotype measurements.
Equilibrium is not a complete biological diagnosis
A small p can arise from population mixture, inbreeding, selection, genotyping errors, or sampling features, among other explanations. The test does not identify which mechanism applies. Likewise, a large p does not confirm random mating or certify assay quality. The model addresses a narrow conditional pattern of genotype counts at one locus and does not establish absence of all biological structure.
X-linked loci, multiallelic markers, pedigrees, and related individuals need appropriate extensions. The calculator does not apply a population stratification correction or adjust for examining many loci. If thousands of markers are screened, multiplicity and assay-specific quality procedures remain necessary. Counts produced after outcome-dependent filtering may also require a different interpretation from the nominal unselected conditional experiment.
Use exact support when discreteness matters
The Pearson equilibrium chi-square approximation uses fitted expected genotype counts and can behave differently in sparse settings. This page instead enumerates the feasible conditional support, making discreteness visible and avoiding an asymptotic reference. Exact refers to that conditional probability model and enumeration; it does not mean the biological assumptions are certain or the sample is free of errors.
Save the three original counts, total, allele count, alternative, two-sided ordering rule, observed probability, and p. Document sampling population and whether genotypes were selected or filtered. When a locus is monomorphic, state its lack of conditional information instead of presenting p equal to one as strong confirmation of equilibrium. When a support cap is reached, obtain a suitable larger-scale implementation rather than reporting an incomplete probability sum.
A few questions, answered
Which two-sided exact p is reported?
The sum of conditional probabilities no greater than the observed outcome probability, with tied probabilities included.
Is this a mid-p calculation?
No. The observed probability receives full weight in the selected tail.
Can I test an X-linked locus?
No. This page uses an autosomal diploid biallelic conditional model.
Why is a monomorphic sample uninformative?
Conditioning leaves only one feasible genotype outcome, so the test cannot detect an equilibrium departure from that sample.