Skip to main content
Pearson+ LogoPearson+ Logo
All Calculators & ConvertersAll calculators

Enter values

What do you have?

Tip: If you have counts, we can compute p, q, expected counts, and optionally χ².

We use: p = (2·AA + Aa) / (2N) and q = 1 − p.

χ² uses Σ (O − E)² / E. (We show df=1 as the common intro-bio convention.)

Options:

Result:

No results yet. Enter values and click Calculate.

How to use this calculator

  1. Pick what you have: counts, allele frequency, or genotype frequencies.
  2. Enter values (and N if you want expected counts).
  3. Click Calculate. Turn on Step-by-step to see the exact math.
  4. If using counts, keep χ² checked to compare observed vs expected.

Quick tip: if your allele frequencies don’t add to 1 exactly (rounding), this tool will normalize.

How this calculator works

  • Alleles → genotypes: AA=p², Aa=2pq, aa=q²
  • Counts → alleles: p=(2AA+Aa)/(2N), q=1−p
  • χ² check: χ²=Σ(O−E)²/E

Note: χ² is a quick check. In real bio/stats work, interpretation depends on assumptions, sample size, and how the test is taught in your course.

Formula & Equation Used

Hardy–Weinberg: p + q = 1

Expected genotype frequencies: , 2pq,

Expected counts: E(AA)=Np², E(Aa)=N·2pq, E(aa)=Nq²

Allele freq from counts: p=(2AA+Aa)/(2N)

Chi-square: χ² = Σ (O − E)² / E

Example Problem & Step-by-Step Solution

Example 1 — genotype counts

Observed: AA=48, Aa=32, aa=20.

  1. Total N = 48 + 32 + 20 = 100
  2. p = (2·48 + 32)/(2·100)=0.64, q=0.36
  3. Expected freqs: p²=0.4096, 2pq=0.4608, q²=0.1296

Example 2 — allele frequency given

Given allele frequency p = 0.70 in a population of N = 200.

  1. Compute q = 1 − p = 1 − 0.70 = 0.30
  2. Expected genotype frequencies: AA = p² = 0.49, Aa = 2pq = 0.42, aa = q² = 0.09
  3. Expected genotype counts: AA = 200·0.49 = 98, Aa = 200·0.42 = 84, aa = 200·0.09 = 18

Example 3 — genotype frequencies (%)

Given genotype frequencies: AA = 40.96%, Aa = 46.08%, aa = 12.96% (sample size N = 250).

  1. Convert percentages to proportions: AA = 0.4096, Aa = 0.4608, aa = 0.1296
  2. Compute allele frequencies: p = AA + ½Aa = 0.4096 + 0.2304 = 0.64, q = 1 − p = 0.36
  3. Expected genotype frequencies: p² = 0.4096, 2pq = 0.4608, q² = 0.1296
  4. Expected counts: AA = 250·0.4096 = 102.4, Aa = 115.2, aa = 32.4

Frequently Asked Questions

Q: Do p and q have to add to 1?

Yes. If your inputs are slightly off due to rounding, we’ll normalize them.

Q: What does χ² tell me?

It measures how far observed counts are from Hardy–Weinberg expected counts. Bigger χ² means bigger deviation, but interpretation depends on your class conventions and assumptions.

Q: Can I compute expected counts without N?

You can always compute expected frequencies. Counts require a sample size N.