Statistical expectation and biased estimates

The concept of statistical expectation is actually quite an easy
one. It is an arithmetic average, just one calculated from
probabilities instead of being calculated from samples. So, for
example, if is the probability that we find alleles
in our sample, the *expected number* of alleles in
our sample is just

where is the total number of alleles in our sample and is the frequency of in our sample.

Now consider the expected value of our sample estimate of the population allele frequency, , where now refers to the number of alleles we actually found.

Because , is said to be an

What about estimating the frequency of heterozygotes within a population? The obvious estimator is . Well,

Because , is a

If you've ever wondered why you typically divide the sum of squared deviations about the mean by instead of when estimating the variance of a sample, this is why. Dividing by gives you a (slightly) biased estimator.