Combinatorial probability provides the foundations of the Hardy-Weinberg ratio. Imagine flipping two coins and asking what the chances are of flipping two heads, or two tails, or one head and one tail.
The chance of two heads is (1/2)2 and of two tails (1/2)2; the chance of a head and a tail is 2 x (1/2)2, or 1/2 (a tail then a head, and a head then a tail, both give one head and one tail).
The head is analogous to allele A , the tail to a ; two heads to producing an AA genotype, one head and one tail to a heterozygote Aa .
The coin produces heads with probability 1/2, and is analogous to a gene frequency of p = 1/2. The frequency 2pq for heterozygotes is analogous to the chance of one head and one tail, 1/2. The two arises because there are two ways of obtaining one head and one tail. Likewise there are two ways of producing an Aa heterozygote: either the A gene can come from the father and the a from the mother, or the a gene from the father and the A from the mother: the offspring is Aa either way.