The equation you are working with is the Hardy-Weinberg equation, and it is used to study populations of organisms and how they are evolving. It is most useful when studying genetic traits that are controlled by two alleles, one being dominant and the other being recessive. Each variable, `p` and `q` represents the frequency of an allele in a population. `p` represents the frequency of the dominant allele, and `q` represents the frequency of the recessive allele. Because these two variables represent the entire gene pool for a certain trait in the population, `p+q=1` .
By squaring both sides of that equation, we get the Hardy-Weinberg equation, `p^2+2pq+q^2=1` . With this equation we can look at individuals in a population. `p^2` represents the frequency of homozygous dominant individuals, `2pq` represents the frequency of heterozygous individuals, and `q^2` represents the frequency of homozygous recessive individuals.
Let's look at an example. Suppose that in a population of mice, black fur is dominant to white fur. In this population of mice, 16% are white. This means that `q^2=0.16` . So, `q=0.4` and `p=0.6` . Putting these back into the Hardy-Weinberg equation, `p^2=0.36` and `2pq=0.48` . So, of the black mice, 36% are homozygous dominant and 48% are heterozygous.