The Sample Mean and Sample Variance
Suppose a factory produces bolts whose true diameter has some unknown mean and unknown variance . You cannot measure every bolt ever made. Instead, you measure a sample of of them and compute two numbers. These are their average, and how spread out they are around that average. These two numbers — the sample mean and sample variance — are the workhorses of statistical inference. Almost every downstream method (confidence intervals, hypothesis tests, regression diagnostics) is built by asking how these two quantities behave as random variables in their own right. The central subtlety is this: the sample mean and sample variance are not fixed numbers waiting to be discovered. They are functions of a random sample. Therefore they are themselves random variables with their own distributions, expectations, and variances. Understanding how they fluctuate from sample to sample — not just what they equal for one particular dataset — is the entire content of statistical inference. This article answers the question precisely: what are , , , and (for normal populations) ? The big picture is a bridge between two worlds. On one side sits the population, described by an unknown distribution with parameters and . On the other side sits data, described by empirical summaries and . The theorems here are the precise dictionary translating properties of the population into properties of these summaries. They explain a famous fact that surprises many students on first sight. Dividing by , rather than , in the sample variance is not an arbitrary convention. It is a mathematically forced correction. This article gives rigorous definitions. It proves the key expectation and variance identities without any distributional assumption beyond independence. It then specializes to the normal population case to compute exactly. It closes the loop toward the machinery — , , and distributions — that make these facts usable for confidence intervals and tests. It also points toward the general theory of Point Estimation and Estimators.
- The sample mean and sample variance are statistics: functions of a random sample, hence random variables.
- For any i.i.d. sample with finite mean and variance : and .
- Dividing by instead of in is exactly what makes — this is Bessel's correction.
- These two facts hold for any population distribution with two finite moments; no normality is needed.
- Under normality, and are independent, and , giving .
- Key idea: the sample mean and sample variance are random variables whose own mean and variance can be computed exactly from those of the parent population — this computation is the foundation of statistical inference.
Where this lives today
The sample mean and sample variance are the entry point to essentially all of applied statistics and much of applied mathematics beyond it. In statistical quality control, control charts (like the classical -chart and -chart used on factory floors) are built directly from the sampling distributions derived here, flagging processes whose observed mean or variance drifts beyond the natural fluctuation predicted by and . In experimental physics, reporting a measurement as "" is a direct application of , quantifying the precision gained by repeated trials. In machine learning, mini-batch statistics (batch normalization layers in neural networks) compute running sample means and variances whose bias and variance properties determine training stability. In finance, estimating volatility (variance of returns) from historical price data uses exactly , and the formula quantifies how much estimation error to expect in a volatility estimate from a finite historical window. In genomics and clinical trials, sample-size calculations for detecting a treatment effect are built by combining with hypothesis-testing theory to decide how many subjects are needed. And in pure probability, this article's identities are the seed from which the t, Chi-Squared, and F Distributions grow — the -distribution arises precisely from studentizing by using the independence and chi-squared results proved here, and the -distribution compares two independent sample variances built the same way, both central to the general theory of Point Estimation and Estimators and to confidence-interval construction built on Sampling Distributions.
Ask the tutor: How does the independence of and under normality get used to derive the Student -distribution?
Let be a random sample: independent and identically distributed (i.i.d.) random variables drawn from a population (a distribution) with finite mean and finite variance . The sample mean is the statistic
The sample variance is the statistic
defined for . The quantity is called the sample standard deviation. A statistic is any function of the sample that does not depend on unknown population parameters; since and are computable from data alone, they are statistics, and being functions of random variables, they are themselves random variables with their own probability distributions — called sampling distributions.
Intuition
Picture the population as an urn with an unknown but fixed "chemical composition" — a mean around which values cluster, and a spread describing how loosely they cluster. Each time you draw a sample of size , you get a slightly different snapshot: a different collection of numbers, hence a different and a different . If you repeated the whole experiment many times — drawing sample after sample of size — the resulting sequence of values would itself trace out a distribution, and likewise for . The theorem below identifies the center and spread of that distribution, in terms of the population's and . The key geometric fact behind the divisor is that the sample mean is itself estimated from the data, so the deviations are not free to vary independently: they are constrained to sum to zero. This costs exactly one degree of freedom, which is why rather than appears in the denominator of — using would systematically underestimate .
Central results
Let be i.i.d. with and , and let and be as in the Sample mean and sample variance definition, with . Then: 1. . 2. . 3. . No assumption beyond i.i.d.-ness and finiteness of the first two moments is required; in particular normality of the is not needed for these three identities.
We prove each part in turn, using only linearity of expectation, the definition of variance, and independence.
Part 1. By linearity of expectation,
Linearity of expectation requires no independence assumption at all; it holds for any finite collection of random variables with finite means, so this step is fully general.
Part 2. Since the are independent, the variance of a sum of independent random variables equals the sum of the variances (a standard fact: for independent , , because ). Applying this to , and using for a constant ,
This step uses independence essentially: without it, cross-covariance terms would remain and the clean formula would fail (see the counterexample below).
Part 3. We first establish the algebraic identity
which follows by expanding: , using by definition of . Now take expectations of both sides. For each , the identity gives , so
Similarly, applying the same identity to itself (which has mean by Part 1 and variance by Part 2),
so
Subtracting,
Dividing both sides by gives
as claimed. This computation used only linearity of expectation, the variance-decomposition identity applied to each and to , and Parts 1–2 already proved (no circularity, since Parts 1–2 do not depend on Part 3).
∎Define the "naive" (uncorrected) estimator . From the proof above, for every finite . Thus is a biased estimator of that systematically underestimates it, while is unbiased: exactly, for every . The correction factor is known as Bessel's correction.
Let be i.i.d. , . Then: (a) and are independent random variables. (b) , a chi-squared distribution with degrees of freedom.
(Sketch of a standard argument, stated in full but relying on one linear-algebra fact about the multivariate normal, proved separately in the theory of <a class="wiki-link" href="/wiki/math-probstat-t-chisq-f-distributions" data-track="wiki_article.body.wiki_link">The t, Chi-Squared, and F Distributions</a>.) Write . Since the are i.i.d. , the vector is jointly Gaussian with mean and covariance matrix , where . Let be the orthogonal projection onto the one-dimensional subspace spanned by (so ), and let be the projection onto the orthogonal complement, the -dimensional subspace of vectors summing to zero. Note is exactly the vector of centered observations , and
Because is Gaussian with covariance (a scalar multiple of the identity, hence isotropic), and are orthogonal projections onto orthogonal complementary subspaces, the random vectors and are jointly Gaussian and uncorrelated:
using since is a projection. For jointly Gaussian vectors, zero covariance implies independence (a standard property of the multivariate normal distribution). Hence is independent of , and since is a function of alone while is a function of alone, and are independent. This proves (a). For (b): is the projection of a mean-, covariance- Gaussian vector onto an -dimensional subspace orthogonal to ; since ... more precisely because lies in the span of , which annihilates. So has mean zero and, after an orthonormal change of basis for the range of , its coordinates are i.i.d. variables. Therefore
is a sum of independent squared standard normals, which is by definition .
∎Let be i.i.d. , . Then
By the preceding lemma, . A chi-squared distribution with degrees of freedom has and — this is a standard, directly verifiable fact from the moment generating function of the distribution, for , whose first two derivatives at give and , hence . Here , so . Since ,
This uses only the scaling property and the previously established distributional fact , with no circularity.
∎Worked examples
Example 1 (asymmetric numeric sample; illustrating , , and the bias correction directly). Consider the sample of measurements (in some unit), deliberately asymmetric and non-round:
Step 1: sample mean.
Step 2: deviations and squared deviations.
| 2.1 | ||
| 5.4 | ||
| 3.0 | ||
| 9.7 | ||
| 4.8 |
Sum of squared deviations: . (Check: the deviations sum to , confirming as required by the algebra in the proof.) Step 3: sample variance with .
Step 4: compare to the naive divide-by- estimate.
Indeed , matching the theorem's bias factor exactly. This single sample cannot show unbiasedness (that is a statement about the average over repeated sampling, not about one dataset) — but it verifies the algebraic relationship between and predicted by the corollary. Step 5: standard deviation and standard error of the mean. . If this population had a known variance (treating the sample value as if it were the truth, purely for illustration of the formula), the theorem gives
This quantity, the standard deviation of , is called the standard error of the mean and shrinks like as sample size grows — the quantitative content of Part 2 of the theorem.
Example 2 (using the theorems to predict sampling behavior before collecting data — normal population). A quality-control engineer knows from decades of production data that bolt diameters (in mm) are very well modeled as with (so mm), though itself is unknown and will be estimated from a fresh sample of bolts. Question A: What is the standard error of for this sample size? By Part 2 of the theorem,
So even though individual bolts vary with standard deviation mm, the average of 10 bolts varies with standard deviation only about mm — roughly times tighter, exactly as predicts. Question B: What is for the sample variance the engineer will compute? By Part 3, regardless of what particular bolts are drawn,
so on average, across many hypothetical batches of 10 bolts, the computed centers exactly on the true variance — this is the precise sense in which is the "right" estimator, not the naive (which would average to , a downward bias). Question C: How much does itself fluctuate from batch to batch? Using the normal-population theorem with ,
So the standard deviation of itself is , meaning a single computed can quite plausibly land anywhere in roughly (two standard deviations) purely from sampling noise with only — a concrete illustration of why from small samples is a noisy estimate of , even though it is unbiased. Increasing to would shrink to , an order of magnitude tighter, illustrating the rate of concentration.
The hypothesis of independence in Part 2 of the theorem is essential — dropping it (while keeping identical marginal distributions and finite variance) can make arbitrarily far from , even exceed itself. Construct a degenerate example: let be a single random variable, and define (every "sample point" is a copy of the same draw — perfectly correlated, not independent). Each individually still has mean and variance , satisfying the marginal-moment hypotheses of the theorem. But
so
not . Averaging did nothing to reduce variability, because there was no new independent information in each additional "observation" — they were all copies of one underlying random draw. More generally, for a sample with common pairwise correlation (an equicorrelated structure, as arises e.g. from a shared random effect), the exact formula is
which converges to as rather than to . This shows precisely how independence is used in the proof (to kill the cross-covariance terms ) and what fails without it: with dependent data, more observations do not guarantee a shrinking standard error, a fact of central importance in time series and clustered-data analysis.
Scope, edge cases & common traps
| Situation | What holds | What can fail |
|---|---|---|
| I.i.d. sample, any distribution with finite | , , | Nothing — these three hold universally under the stated hypotheses |
| I.i.d. normal sample | Additionally: ; ; | The exact independence of and is special to normal populations — it can fail for other distributions |
| Non-independent sample (e.g. time series, clustered data) | still holds by linearity | generally fails; extra covariance terms appear |
| Infinite variance population (e.g. Cauchy, or heavy-tailed with ) | may still be defined as a statistic | is meaningless/undefined since ; need not even concentrate as |
| , so trivially | is undefined ( in the denominator); at least observations are needed to estimate spread |
The mathematician behind it
Origins · 1 minFriedrich Wilhelm Bessel and how this was discovered
Bessel was a self-taught astronomer and mathematician who became director of the Königsberg Observatory. Though best known for Bessel functions (arising from his work on planetary perturbations) and for the first reliable measurement of stellar parallax (61 Cygni, 1838), his name is permanently attached to the "Bessel correction" — the factor that converts a biased mean-squared-deviation into an unbiased estimator of variance. His work sat at the intersection of practical observational astronomy, where instruments produced noisy repeated measurements, and the emerging theory of errors developed alongside Gauss and Laplace; the drive to correctly combine and summarize many imperfect telescope readings is precisely the setting in which the distinction between a population variance and its unbiased sample estimate first became practically indispensable.
Why isn't the sample variance just defined with divisor n, like a plain average of squared deviations?
Dividing by gives , whose expectation is , strictly less than for every finite . The reason is that is itself estimated from the same data, so the deviations are constrained (they must sum to zero), giving effectively only "free" pieces of information about spread rather than . Dividing by exactly compensates for this constraint, yielding an unbiased estimator . This is Bessel's correction, and it is a mathematical necessity for unbiasedness, not a stylistic choice.
Does Var(X̄) = σ²/n require the population to be normally distributed?
No. The identities , , and hold for any i.i.d. sample from any population with finite mean and variance — Bernoulli, exponential, uniform, or otherwise. Normality is only needed for the stronger results: that and are exactly independent, that is exactly chi-squared, and hence that exactly. For non-normal populations these last facts generally fail or hold only approximately for large .
Is S² the only reasonable estimator of σ², or just the unbiased one?
is the standard unbiased estimator, but it is not the only reasonable one and not always the "best" by every criterion. For instance, under normality, the maximum likelihood estimator of is exactly (the divide-by- version), which is biased but has smaller variance and in fact smaller mean-squared error than for finite . Choosing between estimators involves trading off bias and variance, a theme developed fully in Point Estimation and Estimators; unbiasedness is a desirable property but not the sole criterion for a "good" estimator.
Why does Var(S²) matter if S² is already unbiased?
Unbiasedness only guarantees that is correct on average across hypothetical repeated sampling; it says nothing about how far a single computed might land from in any particular dataset. quantifies exactly that spread for normal populations, showing it shrinks like — so small samples give noisy variance estimates even though they are unbiased. This variance is exactly what feeds into building valid confidence intervals for using the chi-squared distribution, and into deriving the -distribution for confidence intervals on when is unknown.
What happens to these formulas when n = 1?
With , exactly, so and still hold trivially (consistent with ). But is undefined, since its denominator : with only one observation there is no way to estimate spread around an unknown mean, because a single point offers zero information about variability. At least two observations are the minimum requirement for the sample variance to exist.
Can the sample mean and sample variance be dependent for non-normal populations?
Yes, and in general they typically are. The proof that relies specifically on properties of the multivariate normal distribution (that zero covariance implies independence for jointly Gaussian vectors, and that projections of an isotropic Gaussian onto orthogonal subspaces are independent). For a non-normal population — say, exponential or uniform — and are generally correlated, sometimes strongly so, and no analogous clean chi-squared result for holds exactly (only asymptotically, via the Central Limit Theorem-type approximations)
How do these results connect to hypothesis testing and confidence intervals?
The confidence interval for when is unknown is built from the statistic , whose distribution is derived precisely from the facts proved here: numerator behavior from , and denominator behavior from together with the independence of and . Combining an numerator with an independent denominator (suitably scaled) is exactly the construction of the -distribution with degrees of freedom, covered in The t, Chi-Squared, and F Distributions. Every -test and -confidence-interval formula ultimately traces back to the identities proved in this article.