SME
Genetics · Problem type

Testing for Hardy–Weinberg equilibrium

Use this for “A sample has 380 AA, 440 Aa and 180 aa. Is it in Hardy–Weinberg equilibrium?”

Diagram

100 alleles: p = 0.6observed, expected dashedAA380 / 360Aa440 / 480aa180 / 1600263.841χ² = 6.944χ², 1 df
Expected
from
p
=
0.6:
N
p
2
,
N
2pq,
N
q
2
=
360,
480,
160.
χ
2
=
Σ
(O − E)
2
÷
E
=
6.944
with
1
df;
the
critical
value
at
α
=
0.05
is
3.841.
It is past the critical value: reject Hardy–Weinberg equilibrium.
This is an example. Type your own values to start a new problem.
nAA
Individuals AA
example
nAa
Individuals Aa
example
nₐₐ
Individuals aa
example
N
Sample size
worked out (not typed)
p
Frequency of A
worked out (not typed)
q
Frequency of a
worked out (not typed)
EAA
Expected AA
worked out (not typed)
EAa
Expected Aa
worked out (not typed)
Eₐₐ
Expected aa
worked out (not typed)
χ²
Chi-square statistic
worked out (not typed)

Formulas

N
=
nAA
+
nAa
+
nₐₐ
1,000 = 380 + 440 + 180
p
=
2 × nAA + nAa
2 ×
N
0.6
=
2 × 380 + 440
2 × 1,000
q
=
2 × nₐₐ + nAa
2 ×
N
0.4000
=
2 × 180 + 440
2 × 1,000
EAA
=
N
×
p
2
360
=
1,000
×
0.6
2
EAa
=
N
×
2
×
p
×
q
480 = 1,000 × 2 × 0.6 × 0.4000
Eₐₐ
=
N
×
q
2
160
=
1,000
×
0.4000
2
χ
2
=
(nAA − EAA)
2
÷
EAA
+
(nAa − EAa)
2
÷
EAa
+
(nₐₐ − Eₐₐ)
2
÷
Eₐₐ
6.9444
=
(380 − 360)
2
÷
360
+
(440 − 480)
2
÷
480
+
(180 − 160)
2
÷
160

Assumptions

•
H₀: the population is in Hardy–Weinberg equilibrium, so N × p², N × 2pq and N × q² are expected.
•
p and q are counted from the alleles: AA carries two A and Aa one, aa two a and Aa one, out of 2N alleles.
•
df = 3 classes − 1 − 1 for p estimated from the sample = 1; at α = 0.05 the critical χ² is 3.841.
•
Every expected count should be at least 5.

Step-by-step

WE KNOW
nAA = 380, nAa = 440, nₐₐ = 180
FIND
sample size (N), frequency of A (p), frequency of a (q), expected AA (EAA), expected Aa (EAa), expected aa (Eₐₐ), chi-square statistic (χ²)
Step 1 · Find sample size (N)
Use N = nAA + nAa + nₐₐ
Add the three genotype counts.
N
=
380
+
440
+
180
N
=
1,000
Step 2 · Find frequency of A (p)
Use p = (2 × nAA + nAa) ÷ (2 × N)
Two
A
in
each
AA
individual
and
one
in
each
Aa,
out
of
all
2
N
alleles.
p
=
2 × 380 + 440
2 × 1,000
p
=
760 + 440
2,000
p
=
1,200
2,000
p
=
0.6
Step 3 · Find frequency of a (q)
Use q = (2 × nₐₐ + nAa) ÷ (2 × N)
Two
a
in
each
aa
individual
and
one
in
each
Aa,
out
of
all
2
N
alleles.
q
=
2 × 180 + 440
2 × 1,000
q
=
360 + 440
2,000
q
=
800
2,000
q
=
0.4000
Step 4 · Find expected AA (EAA)
Use EAA = N × p²
Under
H₀
a
share
p
2
of
the
sample
is
AA.
EAA
=
1,000
×
0.6
2
EAA = 1,000 × 0.36
EAA = 360
Step 5 · Find expected Aa (EAa)
Use EAa = N × 2 × p × q
Under H₀ a share 2pq of the sample is Aa.
EAa = 1,000 × 2 × 0.6 × 0.4000
EAa = 2,000 × 0.6 × 0.4
EAa = 1,200 × 0.4
EAa = 480
Step 6 · Find expected aa (Eₐₐ)
Use Eₐₐ = N × q²
Under
H₀
a
share
q
2
of
the
sample
is
aa.
Eₐₐ
=
1,000
×
0.4000
2
Eₐₐ = 1,000 × 0.16
Eₐₐ = 160
Step 7 · Find chi-square statistic (χ²)
Use χ² = (nAA − EAA)² ÷ EAA + (nAa − EAa)² ÷ EAa + (nₐₐ − Eₐₐ)² ÷ Eₐₐ
Add
(O − E)
2
÷
E
over
the
three
genotypes.
χ
2
=
(380 − 360)
2
÷
360
+
(440 − 480)
2
÷
480
+
(180 − 160)
2
÷
160
1.1111 + 3.3333 + 2.5 = 6.9444
χ
2
=
6.9444
→
6.9444
>
3.841:
does
not
fit;
the
population
is
not
in
equilibrium
Check
Put the numbers back in. Both sides should match.
1,000 = 380 + 440 + 180 ✓
0.6
=
2 × 380 + 440
2 × 1,000
✓
0.4000
=
2 × 180 + 440
2 × 1,000
✓
360
=
1,000
×
0.6
2
✓
480 = 1,000 × 2 × 0.6 × 0.4000 ✓
160
=
1,000
×
0.4000
2
✓
6.9444
=
(380 − 360)
2
÷
360
+
(440 − 480)
2
÷
480
+
(180 − 160)
2
÷
160
✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.

Related lessons

© 2026 SME. All rights reserved.