Hardy-Weinberg principle given by Hardy and Weinberg states that frequencies of alleles tend to remain constant from one generation to the next in sexually reproducing populations under certain conditions.
The Hardy-Weinberg equation is an algebraic equation which is an expression of the Hardy-Weinberg principle.
According to Hardy Weinberg equation, if there are two alleles for a particular gene where A represents the dominant allele and a represents the recessive allele, then the frequency of A is p and a is q.
Combined frequencies of all alleles for a gene in a population is equal 1.
Therefore, p+q=1.
The frequency of homozygous dominant individuals (AA) in the population would be equal to pxp or p2
The frequency of homozygous recessive individuals (aa) in the population would be equal to qxq or q2
Since there are two ways of forming the heterozygote Aa, (allele A from the father and a from mother and vice versa) the frequency of heterozygous dominant individuals (Aa) in the population would be 2pq.
The sum of all three genotypic frequencies is p2+2pq+q2=1 which is a binomial expansion of (p+q)2
p = frequency of the dominant allele (A)
q = frequency of the recessive allele(a)
p2 = frequency of homozygous dominant individuals (AA)
q2 = frequency of homozygous recessive individuals (aa)
2pq = frequency of heterozygous dominant individuals (Aa)