# Hardy Weinberg Equation  This equation is used to predict or explain the relative freqencies of alleles and different phenotypes/genotypes in a stable population, i.e one in which which the frequencies of different forms of genes - alleles - are constant; effectively in equilibrium from generation to generation.
The steady-state explanation depends on various conditions (see below), and  if  the equilibrium is affected it implies that selection is affecting gene frequency, as occurs during evolution and formation of new species (speciation).

It is important to have a clear understanding of the concepts of allele frequencygenotype frequency and phenotype frequency, and the differences between them!

The simplest case: consider a gene which exists in only 2  forms (alleles) :  A (dominant) and a (recessive).

Let the frequency of the A allele  be p and
let the frequency of the  a allele  be q.

Since both of these add up to 100%  (frequency ranges from 0 to 1),   p + q  = 1  .

There are 3 genotypes: AA, Aa and aa

When considering genetic crosses, it is normal to consider these as potential parents and to use genetic diagrams or the Punnett square method to express the possible outcome from a pair of individuals, in terms of the likelihood of each possible genotype in the next generation.

In a population
AA could mate with another AA, or Aa or aa.
Aa could mate with another Aa, or AA or aa.
aa could mate with another aa, or Aa or AA.
The possible outcomes from each of these 9 combinations can be individually predicted using normal genetic techniques, but the number of permutations is rather daunting.

For instance, using  just one of these examples: The frequencies of genotypes resulting from Aa  mating with another Aa is given by

 parental gametes A a parental gametes A AA Aa a Aa aa
Here the alternative alleles from each individual parent are shown as single letters, and the resulting possible genotypes in the next generation from this single interaction are shown as paired letters.

However by a slightly different use of the square format, the possible frequencies of genotypes in a population can be calculated, by multiplying the individual probabilities:

 allele freqencies p q allele freqencies p p2 pq q pq q2
Here the alternative allele frequencies in the population are shown as single letters, and the resulting genotype frequencies in the population as their mathematical products (pxp, pxq, qxp, qxq). Of course pxq is the same as qxp, and they become 2pq.

p2 + 2pq + q2 = 1
[This is in fact (p+q)2 = 12]

p2   represents the genotype frequency for AA in the population
2pq represents the genotype frequency for Aa in the population
q2    represents the genotype frequency for aa in the population

If AA and Aa are indistinguishable, they will both show the same phenotype due to dominance, so it will be difficult to count them directly in the population.
However, the double recessives aa will be countable, so their frequency in the population can be calculated. This recessive phenotype frequency (= aa genotype frequency) is equal to q2, so by taking its square root q can be calculated. From this p can be calculated  (it is 1-q).

By substituting  the values for p and q into p2 and  2pq,  it is then possible to work out the frequencies of the homozygous (double dominant -  AA) and heterozygous (Aa) genotypes, which together with the homozygous (double recessive -  aa) should all add up to 1.00!

When analysing sex-linked allele and phenotype frequencies by the Hardy-Weinberg methodology, calculations must be modified to reflect the situation caused by the single X chromosome in males:
Male allele frequencies for affected and unaffected are identical to phenotype frequencies, typically p and q, not squared. There are no heterozygotes.
In females phenotype frequencies are the 'normal' 3 categories: p2, 2pq and q2, as there are 2 copies of the X chromosome.

### Assumptions that this equilibrium is based upon

A large population
Random mating
Equal viability of all genotypes (not likely if some are at an advantage/disadvantage - leading to directional or disruptive selection and hence new species formation)
No immigration/emigration
Diploid chromosomes - sex linkage requires different treatment (see above)