By convention, the dominant allele is designated p while the recessive trait is denoted as q. All alleles in the gene pool must add up to 100 percent, p + q = 1.
The term p^2 corresponds to individuals with the homozygous dominant genotype and 2pq represents heterozygotes. Finally, the q^2 term represents the homozygous recessive genotype.
Hardy-Weinberg equilibrium equations apply to an ideal situation: Members of a large but completely isolated population mate at random. No individuals enter or leave the gene pool; otherwise, the allelic frequencies would deviate from those predicted by the equation. A real life population approximating the Hardy-Weinberg equilibrium would be the country of Iceland. After Norwegian Vikings colonized this island in the 9th century, no significant human migration from the outside world occurred again.
Suppose the allelic frequency for brown eyes in a population is 40 percent. The only other eye color allele is recessive and codes for blue eyes. The Hardy-Weinberg equilibrium equation determines the ratio of brown- and blue-eyed people in the population. Brown eyes are dominant; they are denoted p, and the frequency of this allele is 0.4. Because p + q = 1, the frequency of the q allele for blue eyes is 0.6. Plugging these values into p^2 + 2pq + q^2 = 1 results in 36 percent of the population having blue eyes while the other 64 percent having brown eyes.
Although the q allele is more common than p, brown eyes are the dominant phenotype (appearance) which includes the genotypes p^2 and 2pq. (0.4)^2 = 0.16 (16 percent) and 2(0.4)(0.6) = 0.48 (48 percent). Adding these two terms together, homozygous dominants and heterozygotes eye color make up 64 percent of the population. The remaining 36 percent are homozygous recessive, which can be determined by calculating (0.6)^2.