Why the sample variance divides by n − 1

The question
Move the observations, compare the scores, then account for the center you estimated.
- 1 SeeMove points and compare two sums.
- 2 TryCount outcomes across repeated samples.
- 3 ProveAccount for the fitted mean.
- 4 ApplyChoose the right variance formula.
Before you start · 3 quick checks on means, squared distances, and unbiasedness
Two ideas before you start
2 ideasA squared distance needs a reference point
An observation and a reference mark on a number line.
Choose a point. Measure its signed distance from the reference, then square that distance.
Exact definition
For observed real numbers \(x_1,\ldots,x_n\), let \(\bar x\) be their arithmetic mean. Define the sum of squared distances from a reference \(c\) by
\[D(c)=\sum_{i=1}^n(x_i-c)^2.\]The reference has the same units as each observation. The score has squared units. Write \(Q=D(\bar x)\) for the score around the sample's own mean. This is a sum, not yet an average or a variance estimate.
A sample center changes when the sample changes
Sample observations and their mean, beside a fixed population mean.
The population mean stays fixed across samples. The sample mean is computed again from each new set of observations.
Exact definition
Before sampling, write the observations as random variables \(X_i\) and their mean as \(\bar X\). The population has mean \(\mu=E[X_i]\) and finite variance \(\sigma^2=E[(X_i-\mu)^2]\). Lowercase letters describe one realized sample.
Our repeated-sampling claims assume independent and identically distributed observations, abbreviated iid. Each draw has the same distribution and is independent of the others. Normality is not required. The draggable points in See are chosen data, so that activity itself requires no probability model.
Refresher: the target and the estimator
The target here is the population variance, not the variance of the sample mean. An estimator is a rule based on observed data. Its expectation averages the rule's output over fresh samples from the same population.
As in bias and variance, unbiased means that this expectation equals the target for every population in the stated model. It does not promise that one observed estimate equals the truth. Review expectation and variance for probability-weighted averaging, and sampling distributions for what changes across samples.
Can you reverse the two scores?
- Drag a point horizontally, or focus it and use the arrow keys.
- Try to make the score around the sample mean exceed the score around the fixed reference. Check your layout.
- If you think the target cannot be reached, choose “No layout works” to see the algebra.
Write each distance as \(x_i-\mu=(x_i-\bar x)+(\bar x-\mu)\). Expand the square and sum. The cross term vanishes because \(\sum_i(x_i-\bar x)=0\). The remaining extra term is a nonnegative square, so no layout reverses the inequality. Equality holds exactly when the sample mean equals the reference.
The mean is fitted to these observations. Measuring around it never gives a larger squared-distance sum than measuring around the population mean, and it gives a strictly smaller one whenever \(\bar x\ne\mu\). This statement holds for each dataset; it is not a claim about which side of the true variance a particular estimate falls on.
For iid sampling, averaging this identity will quantify what was removed. Define two candidate estimators, with \(n\ge2\):
\[V_n=Q/n,\qquad S^2=Q/(n-1).\]The first is the variance of the empirical distribution that assigns equal weight to each observed entry. The second is the usual sample variance for estimating population variance. Both use the same fitted center and the same numerator; only the divisor changes. The next activity examines their outputs across samples.
Count what happens across samples
Compute \(S^2=Q/(n-1)\) in each sample. Before revealing the table, consider how often this estimate can miss the population spread completely.
| k | Count | Q/n ≈ | S² ≈ |
|---|
The table is an enumeration, not a simulation. Every ordered sample receives equal probability under independent fair draws. The count column tells you how many ordered samples share each result. Use those counts as weights; giving every row equal weight would describe a different sampling rule.
Unbiasedness concerns the average across the entire sampling distribution. Some individual estimates are below the truth and others are above it. Repeating samples reveals the estimator's average behavior; it does not change the realized estimate from the sample you already collected.
Use the averages to meet a target
The relative shortfall is \((\sigma^2-E[V_n])/\sigma^2\). Find the smallest allowed sample size that meets each target. Check a size, then advance; the next goal starts from the smallest size again.
Average the amount removed
Let \(X_1,\ldots,X_n\) be iid, where \(n\ge2\) is an integer, with finite mean \(\mu\) and finite positive variance \(\sigma^2\). Define
\[\begin{aligned}A&=\sum_i(X_i-\mu)^2,\\B&=n(\bar X-\mu)^2,\\Q&=\sum_i(X_i-\bar X)^2=A-B.\end{aligned}\]Then \(E[Q]=(n-1)\sigma^2\), so \(E[S^2]=\sigma^2\) and \(E[V_n]=(n-1)\sigma^2/n\). No normal distribution is assumed.
Build the expectation calculation. From the sample mean lesson, iid observations give \(E[\bar X]=\mu\) and \(\operatorname{Var}(\bar X)=\sigma^2/n\). That is the independence-dependent step. Linearity of expectation itself does not require independence.
What “degrees of freedom” counts
The deviations from the fitted mean must sum to zero. Once all but the last deviation are chosen, the last is forced to be the negative of their sum. Thus the residual vector has \(n-1\) freely adjustable coordinates. No observation was discarded. Every observation still contributes to the mean and to the squared-distance sum.
This constraint explains the name, but the expectation calculation establishes the divisor. The residuals are not generally independent. Normal sampling gives additional distributional results; none of those results is needed for this unbiasedness proof.
Known means, standard deviations, and boundary cases
If the true population mean is known and used, \(A/n\) is unbiased for population variance under iid sampling. A convenient reference or a manufacturer’s target is not automatically the true mean. An incorrect fixed center adds squared bias to the expected squared distance.
The theorem also extends to zero population variance: all observations then equal the mean with probability one and both estimates are zero. Positive variance keeps the proof choices distinct. At a sample size of one, the centered sum is zero and the usual corrected sample variance is undefined.
Taking a square root does not preserve unbiasedness. Although \(S=\sqrt{S^2}\) uses the original units, it is generally biased as an estimate of \(\sigma\). Because the square root is concave, Jensen's inequality gives \(E[S]\le\sqrt{E[S^2]}=\sigma\), with equality only when \(S\) takes one value with probability one. So \(S\) underestimates \(\sigma\) on average whenever it varies across samples. Nor does unbiasedness alone establish the smallest mean squared error. The bias–variance lesson explains why another estimator may trade bias for less variation. Dependence, unequal weights, or sampling without replacement requires checking the sampling model separately.
Keep the target and the center straight
Enter a decimal without units. Each answer accepts an absolute error of at most the tolerance shown. Work from the unrounded squared-distance sum. Each problem has hints and a complete solution.
Further reading
- G. Casella and R. L. Berger, Statistical Inference, chapter 5, “Properties of a Random Sample,” and chapter 7, “Point Estimation.”