# Equilibrium Hardy-Weinberg

Hardy-Weinberg equilibrium law states that allele and genotype frequencies in a population will remain constant from one generation to next generation in the absence of disturbing factors. In this calculator, Hardy-Weinberg equilibrium can be used to calculate the expected common homozygotes, expected heterozygotes, expected rare homozygotes and the frequency range of the 2 (p and q) alleles from the observed genotypes.

### Calculator of Hardy-Weinberg equilibrium

Common Homozygotes
Heterozygotes
Rare Homozygotes

### Formula of Hardy-Weinberg equilibrium

pfreq = (CH + (0.5 * H)) / (CH + H + RH)

qfreq = (RH + (0.5 * H)) / (CH + H + RH)

ECH = pfreq * pfreq * (CH + H + RH)

EH = 2 * pfreq * qfreq * (CH + H + RH)

ERH = qfreq * qfreq * (CH + H + RH)

chi1 = ((CH - ECH) * (CH - ECH)) / ECH

chi2 = ((H - EH) * (H - EH)) / EH

chi3 = ((RH - ERH) * (RH - ERH)) / ERH

chi2 = chi1 + chi2 + chi3

• CH = Common Homozygotes
• H = Heterozygotes
• RH = Rare Homozygotes
• ECH = Expected Common Homozygotes
• EH = Expected Heterozygotes
• ERH = Expected Rare Homozygotes
• pfreq = p Allele Frequency
• pfreq = q Allele Frequency

It is also known as Hardy-Weinberg principle, model, theorem.

### Example of Hardy-Weinberg equilibrium

If the observed common homozygotes is 21, heterozygotes is 10 and rare homozygotes is 2, then

Step 1 : p Allele Frequency

pfreq =

= (21 + (0.5 * 10)) / (21 +10 + 2)

= (21 + 5) / 33

= 0.7879

Step 2 : q Allele Frequency

qfreq =

= (2 + (0.5 * 10)) / (21 + 10 + 2)

= 7 / 33

= 0.2121

Step 3 : Expected CH

Expected CH =

= 0.78 * 0.2121 * (21 + 10 + 2)

= 20.48

Step 4 : Expected H

Expected H =

= 2 * 0.78 * 0.2121 * (33)

= 11.03

Step 5 : Expected RH

Expected RH = 1.4848

Step 6 : Chi Square

chi1 = ((CH - ECH) * (CH - ECH)) / ECH

chi1 = ((21 - 20.4848) * (21- 20.4848)) / 20.4848

chi1=0.0129

chi2 = ((H - EH) * (H - EH)) / EH
chi2 = ((10 - 11.0303) * (10 - 11.0303)) / 11.0303
chi2 = 0.0962

chi3 = ((RH - ERH) * (RH - ERH)) / ERH
chi3 = ((2 - 1.4848) * (2 - 1.4848)) / 1.4848
chi3 = 0.1787

chi2 = chi1 + chi2 + chi3
chi2 = 0.0129+0.0962+0.1787
chi2 =0.2879