Bioinformatics Concepts

Hardy-Weinberg Equilibrium

The Hardy-Weinberg Equilibrium is a fundamental principle in population genetics that describes how allele and genotype frequencies remain constant from generation to generation in an idealized population. This equilibrium holds under specific conditions: no mutation, random mating, no gene flow, infinite population size, and no selection. The Hardy-Weinberg equation:

\[ p^2 + 2pq + q^2 = 1 \]

expresses the expected genotype frequencies in a population, where \( p \) and \( q \) are the allele frequencies of a given gene.

This simulation allows users to explore how the Hardy-Weinberg equilibrium works by choosing different values for allele frequencies \( p \) and \( q \) (where \( p + q = 1 \)). The simulation then generates a population of 1000 based on these allele ratios and compares the observed genotype frequencies to the theoretical Hardy-Weinberg expectations. By running multiple trials, users can visualize how genotype distributions align with mathematical predictions, reinforcing the principle that allele frequencies remain stable under equilibrium conditions.