The law stating that, provided certain conditions are met, the gene (allele) frequencies in a Population of organisms will remain constant and be distributed as p^{2}, 2pq, and q^{2} for the genotypes AA, Aa, and aa respectively where p = the frequency of the dominant allele and q = the frequency of the recessive allele, such that p + q = 1 (i.e. A and a are the only alleles). The law only holds providing that: the population is large (theoretically infinite); the population has been produced by random breeding; there is no natural selection for or against any particular genotype; there is no differential migration into or from the population; and there is no mutation. Despite these conditions, Hardy and Weinberg's law is the basic theorem of population genetics. From it can be calculated the frequencies of A and a, even though a significant proportion of the a alleles are masked in heterozygotes. Thus the frequency of a (q) = √(frequency of homozygous recessives), and the frequency of A (p) = 1  q. If a population does not fit the distribution p^{2} + 2pq + q^{2} then one or more of the conditions stated above are not being fulfilled. The usual reason is natural selection against a particular phenotype. The theorem can be extended to enable the effects of natural selection on gene frequencies to be calculated. In effect, this provides a yardstick by which the rate of evolution can be measured and quantitatively defined.
