We have seen the terms allele, dominant, recessive, genotype, phenotype, etc. Consider a population with five individuals with the following gene pairs. Assume they dictate the hair colour. So, the red gene is for red hair colour and black for black. But red is recessive, and black is dominant. That means.
red-red = red hair
red-black = black hair
black-black = black hair
So we have two people with red hair (homozygous recessive) and three with black hair (two heterozygous and one homozygous dominant).
Hardy Weinberg rule
The rule states that allele and genotype frequencies in a population will remain constant in the absence of other evolutionary processes such as migration, mutation, selection, etc.
To estimate the allele frequency, we create the gene pool, the aggregate of all alleles of the population. Our gene pool has ten alleles, with six reds and four blacks.
Let p represent the allele frequency of the dominant trait and q that of the recessive.
p = 4/10 = 0.4
q = 6/10 = 0.6
p + q = constant = 1
To estimate genotype frequency, consider the following. If we take one random gene from the pool, what is the probability that it is red? It will be q. What is the chance of picking two genes to form a homozygous recessive? It will be q x q = q2. Similarly, to pull out a black followed by another black is p2 and a black and a red is 2pq (black followed by red OR red followed by black; add them because of OR rule).
The genotype frequency is the sum of those three types, i.e., p2 + 2 pq + q2. Needless to say, that will be 1. To summarise, the following are the two governing equations.
p + q = 1
p2 + 2 pq + q2 = 1