Allele frequencies p and q, expected p², 2pq and q², and a chi-square test of equilibrium from genotype counts, checked against OpenStax Biology 2e
How p and q Are Calculated
- Count alleles. 500 plants carry 1,000 alleles. Y alleles: 2 × 245 + 210 = 700; y alleles: 2 × 45 + 210 = 300.
- Divide: p = 700 ÷ 1,000 = 0.7 and q = 300 ÷ 1,000 = 0.3. They add to 1.
- Predict genotypes: p² = 0.49 (YY), 2pq = 0.42 (Yy), q² = 0.09 (yy), which add to 1.
- Expected counts: multiply by 500 to get 245, 210 and 45. Here they match the observed counts exactly.
OpenStax’s follow-up question uses p = 0.8 and q = 0.2 in 500 plants: 0.64 × 500 = 320 VV, 0.32 × 500 = 160 Vv and 0.04 × 500 = 20 vv, so 480 violet and 20 white flowers. Choose “dominant allele frequency p” to reproduce it.
Testing for Equilibrium with Chi-Square
Compare observed and expected genotype counts with χ² = Σ (observed − expected)² ÷ expected. There are three genotype classes, minus 1 for the total and minus 1 because p was estimated from the same data, which leaves 1 degree of freedom. The 5% critical value is 3.84.
The Cornell Statistical Consulting Unit’s handout works the 725 / 123 / 7 example to χ² ≈ 0.49 and says the population is consistent with equilibrium. Its printed p-value, “about 0.104,” does not match: a χ² of 0.49 on 1 degree of freedom has an upper-tail p-value of about 0.48. The conclusion is the same either way. With an expected count near 5 in the rare genotype class, an exact test is the safer choice, as the handout also notes.
From a Recessive Trait to Carrier Frequency
When only the recessive phenotype can be seen, its frequency is q². Take the square root for q, then 2pq gives the share of carriers. These rows are illustrative frequencies, not data for a particular disease:
Carriers far outnumber affected people for rare recessive traits: at 1 in 2,500, about 1 person in 26 carries the allele.
Common Mistakes
- Taking q from the recessive phenotype directly. The recessive frequency is q², so q is its square root: 0.09 means q = 0.3, not 0.09.
- Counting individuals instead of alleles. Each diploid individual carries two alleles, so divide by 2n.
- Using 2 degrees of freedom. Estimating p from the data costs one, leaving 1.
- Reading “not significant” as proof of equilibrium. A small sample may simply lack the power to detect a departure.
- Applying it where the assumptions fail. OpenStax lists them: a very large population, random mating, and no mutation, migration or selection.
What This Calculator Does Not Cover
It handles one gene with two alleles in a diploid population. Multiple alleles, X-linked genes, exact tests for small samples and inbreeding coefficients need other methods.
Frequently Asked Questions
How do you calculate p and q in Hardy-Weinberg?
p = (2 × homozygous dominant + heterozygous) ÷ (2 × total individuals), and q = 1 − p. For 245 YY, 210 Yy and 45 yy, p = 700 ÷ 1,000 = 0.7 and q = 0.3.
What does 2pq represent?
The expected frequency of heterozygotes (carriers) under Hardy-Weinberg equilibrium.
How do you find q from the recessive phenotype?
The recessive phenotype frequency is q², so take its square root. If 9% show the recessive trait, q = 0.3.
How many degrees of freedom does a Hardy-Weinberg chi-square test have?
One, for two alleles: three genotype classes minus one for the total and one for the estimated allele frequency.
What are the Hardy-Weinberg assumptions?
A very large population, random mating, and no mutation, migration or natural selection, per OpenStax Biology 2e.
What does it mean if a population is not in Hardy-Weinberg equilibrium?
Something is changing allele or genotype frequencies, such as selection, non-random mating, migration or genotyping errors.
How to Use This Calculator
- Choose what you know — genotype counts, the dominant allele frequency p, or the recessive phenotype frequency q².
- Enter the numbers — counts for each genotype, or p or q² as a decimal or 1/N.
- Set a population size — for expected counts when starting from a frequency.
- Read the results — p, q, p², 2pq, q², expected counts and, from counts, the chi-square test.
📚 Sources & References- [1] OpenStax. Biology 2e, 19.1 Population Evolution (2018; accessed October 2026). openstax.org
- [2] Cornell Statistical Consulting Unit. Jing Yang, The Hardy-Weinberg Principle in Population Genetics (2013, updated April 2022). cscu.cornell.edu
✅
Editorial Standards — Every calculator is built from peer-reviewed formulas and official data sources, editorially reviewed for accuracy, and updated regularly.
Read our full methodology ·
About the author