Variance and Moments
How spread out is a random quantity around its average value? A weather forecaster who says "the expected rainfall is 2 inches" has told you almost nothing. You don't know whether to expect a drizzle or a flood. You need a second number that measures the typical deviation from that average. This is exactly the gap that variance fills. It is one of the most consequential ideas in all of probability and statistics. It underlies error bars, confidence intervals, risk management, and the entire theory of statistical estimation. The idea builds directly on Expectation. Instead of asking only for the average value of a random variable, we ask for something more. We ask for the average squared distance from that value, . Squaring is not arbitrary. It penalizes large deviations more than small ones. It treats positive and negative deviations symmetrically. Crucially, it also makes the resulting quantity algebraically tractable. It decomposes nicely for sums of variables. Variance is the second in an infinite hierarchy of numbers called moments. Each one captures progressively finer features of a distribution's shape. The third moment detects asymmetry (skewness). The fourth detects tail-heaviness (kurtosis), and so on. This article gives the rigorous definition of variance and standard deviation. It proves the core structural facts: the shortcut formula, scaling and shift rules, additivity for independent variables. It also situates variance within the broader family of moments. We also prove the two workhorse inequalities of the subject — Markov's and Chebyshev's. These convert "a bounded second moment" into quantitative control over how far a random variable can stray from its mean. By the end you will be able to compute variances confidently. You will know exactly which hypotheses each identity requires (independence is not optional for additivity!). You will also see how this single number — — sets up the machinery of Moment Generating Functions. These package all moments into a single analytic object.
- Variance measures average squared deviation from the mean .
- Standard deviation restores the original units, making it directly interpretable.
- The shortcut formula is the standard computational tool.
- Variance is not linear: , and additivity over sums needs independence (or zero covariance).
- Higher moments — third (skewness), fourth (kurtosis) — refine the picture of a distribution's shape beyond mean and spread.
- Key idea: variance quantifies dispersion by averaging squared distance from the mean, and this single number drives concentration inequalities like Chebyshev's.
Where this lives today
Variance is the workhorse of quantitative uncertainty across nearly every applied field.
- Statistics. The sample variance is the basic estimator of spread, feeding directly into
confidence intervals, hypothesis tests (t-tests, ANOVA), and regression diagnostics (residual variance, ).
- Finance. Portfolio variance (and covariance between assets) is the central object of
Markowitz mean-variance portfolio theory, where "risk" is literally defined as standard deviation of returns.
- Physics and engineering. Measurement uncertainty is reported as standard deviation;
signal processing quantifies noise power as variance, and Chebyshev-type bounds justify error-tolerance guarantees without assuming a specific noise distribution.
- Machine learning. The bias–variance decomposition of prediction error explains
overfitting versus underfitting, and variance reduction techniques (e.g. in Monte Carlo estimation) directly exploit the additivity and scaling rules proved here.
- Cryptography and randomized algorithms. Concentration inequalities built on variance
(Chebyshev, and its sharper descendants like Chernoff bounds) certify that randomized algorithms behave predictably with high probability.
- Foreshadowing. Packaging all moments simultaneously into one generating
function is exactly the idea behind Moment Generating Functions, where variance reappears as the second derivative (at ) of — a preview of how this article's toolkit scales up.
Ask the tutor: How does variance appear as a derivative of the moment generating function, and why does that make it easy to compute for sums of independent variables?
Let be a random variable on a probability space .
-th moment. For a positive integer , the -th moment of is
defined whenever . The first moment is the mean, often written .
-th central moment. Assuming , the -th central moment is
Variance. The variance of , denoted or , is the second central moment:
provided (so that and this expectation both exist and are finite).
Standard deviation. The standard deviation of is
the nonnegative square root, expressed in the same units as itself.
Skewness and kurtosis. When the relevant moments are finite and , define the (standardized) skewness and excess kurtosis
All of these definitions apply verbatim to discrete random variables (sums replacing integrals in the underlying expectations) and to continuous random variables with density , where for instance .
Intuition
Think of as the balance point of a distribution of mass along a line — if you cut a cardboard cutout shaped like the density and tried to balance it on a pin, the pin would go under . Variance then asks: on average, how far is the mass from that balance point, counted in squared distance? A distribution with all its mass piled near has small variance; a distribution with mass spread far out (even if still balanced at ) has large variance. Squaring the deviation serves two purposes. First, it eliminates the sign problem: always, so raw deviations cannot measure spread (positive and negative deviations cancel). Second, squaring emphasizes large deviations disproportionately — a deviation of contributes times more than a deviation of — which turns out to be exactly the right weighting to make variance behave beautifully under sums of independent variables, as the additivity theorem below shows. The standard deviation undoes the "squared units" problem: if is measured in meters, is in meters², which is hard to interpret, but is back in meters and can be compared directly to or to observed values of .
Let be random variables with and , and let be constants. Then: 1. (Nonnegativity) , with equality if and only if almost surely (i.e. is constant with probability ). 2. (Shortcut formula) . 3. (Affine transformation) . 4. (Bilinear expansion) , where . 5. (Additivity under independence) If and are independent, then .
We prove each part using only the linearity of expectation for Expectation and the definitions above; no part depends on later parts in a circular way. Throughout, and , both finite since implies (by Cauchy–Schwarz, ) that , and similarly for .
(1) Nonnegativity. The random variable is nonnegative for every outcome, so its expectation is nonnegative: . If almost surely, then almost surely, so its expectation is . Conversely, suppose . Since and , standard measure-theoretic fact ("nonnegative random variable with zero expectation is zero almost surely") gives almost surely, hence almost surely. (This underlying fact follows from Markov's inequality applied to , proved independently below, so there is no circularity: for any , ; letting along a sequence and using continuity of measure gives .)
(2) Shortcut formula. Expand the square and use linearity of expectation, valid because guarantees all terms below are finite:
Since , this is .
(3) Affine transformation. Let . Then , so
Hence
(4) Bilinear expansion. Let , so by linearity of expectation, and
Squaring,
Taking expectations (linearity, and each term has finite expectation since and Cauchy–Schwarz bounds the cross term: ):
(5) Additivity under independence. If are independent, then so are and (a measurable function of is independent of any measurable function of when ). For independent random variables with finite second moments, — this is the standard factorization property of expectation under independence, applied here with , . Since and ,
Substituting into part (4) gives .
∎If are pairwise independent with finite second moments, then
This follows from part (5) of the theorem by induction on : writing , one checks and are independent (a consequence of pairwise independence combined with the fact that only needs pairwise vanishing, since the bilinear expansion of only involves the single covariance term ), and the base case is trivial.
If is a random variable with , then for every ,
Let and let be its indicator. Since everywhere, and on we have , we get the pointwise inequality
valid on all of : on , the right side is ; off , the right side is since . Taking expectations, which preserves this inequality since expectation is monotone,
Dividing by gives the result.
∎Let be a random variable with mean and finite variance . Then for every ,
Apply Markov's Inequality (Lemma above) to the nonnegative random variable with threshold :
Finally observe the event equality
which holds because for real numbers, (both sides squaring the same nonnegative quantity ). Hence .
∎Worked examples
Example 1 — A biased, asymmetric die. Let be the outcome of a roll of a loaded six-sided die with probability mass function
(Check: . ✓) Mean.
Compute term by term: . Summing: ; ; ; ; . So . Second moment.
Term by term: ; ; ; ; ; . Summing: ; ; ; ; . So . Variance via the shortcut formula (Theorem, part 2).
Standard deviation.
Sanity check via Chebyshev. With , Chebyshev's inequality predicts
Directly: means or , i.e. (since ). This has probability , comfortably below the Chebyshev bound — consistent with the theorem (which gives an upper bound, not an exact value).
Example 2 — An exponential random variable and a linear rescaling. Let have the exponential distribution with rate , i.e. density for . Define (say represents a rescaled and shifted measurement, such as a temperature conversion of a failure time). Moments of . For an exponential() variable it is a standard computation (via integration by parts, or the Gamma function identity ) that
With :
Variance of .
(This matches the known general formula .) Variance and mean of . By linearity of expectation, . By the affine-transformation rule (Theorem, part 3), the additive shift does not affect variance, but the scale factor enters squared:
So . Cross-check by direct expansion. Alternatively, , so pointwise, and taking expectations reproduces exactly, confirming the theorem's formula without any shortcut-formula bookkeeping. Skewness sanity check. The exponential distribution is known to have skewness for every rate ; since skewness is scale invariant and shift invariant (as a ratio of an odd central moment to , unaffected by adding a constant, and both numerator and denominator scale identically under a positive scale factor — here preserves sign), has the same skewness as , illustrating that skewness (unlike variance) is a shape descriptor invariant under this class of transformations.
The additivity formula in part (5) of the Theorem requires independence (or, more generally, ). Here is a concrete case where it is dropped and the conclusion fails. Let be a random variable taking values each with probability , and define . Then and are manifestly dependent — knowing tells you , changing the conditional distribution of from its marginal. Compute the pieces. First, takes the value with probability (from ) and with probability (from ). So:
so . For with , :
so . Now consider . Its possible values: if , ; if , ; if , . So takes value with probability (from or ) and value with probability (from ).
so
Compare: . Remarkably the numbers match here — so let's instead directly check whether the covariance is zero, since that is the actual mechanism. Compute
, so in this particular symmetric example the covariance happens to vanish even though are dependent — a good reminder that zero covariance does not imply independence, and this example's coincidental agreement is not a proof that dependence is harmless. To see the additivity formula genuinely fail, perturb the example to break the symmetry: let take values with probabilities and again set . Then:
takes value w.p. , w.p. , w.p. :
Now . For : at , ; at , ; at , . So w.p. and w.p. .
Now compare against : they clearly disagree. This confirms that dropping independence breaks additivity — the "missing" term makes up the difference exactly as part (4) of the Theorem predicts, since here , and indeed . ✓
Scope, edge cases & common traps
| Situation | What happens | Why |
|---|---|---|
| Variance is undefined (or by convention) | Second moment must be finite for , to make the shortcut formula meaningful | |
| Cauchy distribution | Variance does not exist | itself fails to exist (integral not absolutely convergent), so variance is undefined, not merely infinite |
| but dependent | Additivity of variance can still coincidentally hold or fail | Zero covariance is weaker than independence; see counterexample |
| pairwise independent variables | Variance still adds | Corollary only needs pairwise independence, not full mutual independence |
| Constant random variable | Degenerate case of nonnegativity theorem, equality condition | |
| Negative "variance" from arithmetic | Signals a computational error | Variance is a sum/integral of squares — always |
The mathematician behind it
Origins · 1 minPafnuty Lvovich Chebyshev and how this was discovered
Chebyshev was a towering figure of 19th-century Russian mathematics, working across number theory, approximation theory, and probability. His inequality — proved in the 1867 paper Des valeurs moyennes — gave the first fully general, distribution-free bound on how far a random variable can deviate from its mean, using only the existence of a finite variance. It transformed variance from a descriptive statistic into a rigorous tool for proving limit theorems, most famously an early general form of the Law of Large Numbers via variance bounds. Chebyshev founded an influential school (students included Andrei Markov, after whom Markov's inequality is named) that shaped Russian probability for generations.
Why do we square deviations instead of taking absolute values?
Both and (the "mean absolute deviation") are legitimate measures of spread, but squaring has major structural advantages. It makes the function differentiable everywhere (absolute value has a kink at ), which matters for optimization — the mean is exactly the constant minimizing , a clean fact with no analogue as clean for absolute deviation. Squaring also produces the beautiful additivity law under independence, because cross terms vanish in expectation; no such simple identity holds for mean absolute deviation. Finally, variance connects directly to the geometry of (Hilbert) spaces, enabling projection and orthogonality arguments used throughout statistics.
Is standard deviation always more meaningful than variance?
For interpretation, generally yes: standard deviation is in the same units as , so you can compare directly to or to a tolerance threshold (e.g. "the machine's output is grams" makes sense with , not ). However, variance is usually the more convenient quantity for algebra: the additivity theorem, the bias-variance decomposition, and covariance matrices are all naturally stated in terms of variance because it is linear in the underlying squared-deviation expectations, whereas taking a square root does not commute with addition.
Does a distribution always have a finite variance?
No. A classic counterexample is the Cauchy distribution, whose density decays only like for large — too slowly for even the first moment to converge absolutely, so neither the mean nor the variance exists. Even distributions with a finite mean can have infinite variance, such as certain heavy-tailed Pareto distributions with shape parameter between and . In such cases, tools like Chebyshev's inequality simply do not apply, and alternative descriptors (median, interquartile range) are used instead.
What exactly does Chebyshev's inequality guarantee, and how tight is it?
It guarantees that for any random variable with finite variance , the probability of straying standard deviations from the mean is at most — for example, at most chance of being or more standard deviations away, and at most chance of being or more away. This bound holds for every distribution with finite variance, which is its strength, but it is usually very loose for well-behaved distributions (e.g. the true probability for a normal distribution at is about , far below Chebyshev's bound). Its value lies in universality, not sharpness.
How does variance relate to skewness and kurtosis mentioned in the definition?
Variance (second central moment) measures spread but says nothing about shape asymmetry or tail weight. Skewness (third standardized central moment) measures whether the distribution leans left or right: positive skewness means a longer right tail. Kurtosis (fourth standardized central moment, often reported as excess kurtosis relative to the normal's value of ) measures how heavy the tails are relative to a normal distribution, controlling how often extreme outliers occur. Together, mean, variance, skewness, and kurtosis form the first four "moments" describing location, spread, asymmetry, and tail behavior — a progressively finer description of a distribution's shape.
Why does the proof of Chebyshev's inequality route through Markov's inequality?
Markov's inequality is the more primitive, more general fact: it requires only nonnegativity and a finite mean of the variable in question, with no reference to variance at all. Applying it to the specific nonnegative random variable — whose expectation is by definition the variance — instantly produces Chebyshev's bound as a special case. This "reduce to Markov" technique is a standard and reusable strategy: many concentration inequalities (Chernoff bounds, for instance) are proved by applying Markov's inequality to a cleverly chosen transformed random variable, such as .
Can two different distributions have the same mean and variance but look completely different?
Yes, easily — mean and variance are only two numbers and cannot pin down an entire distribution. A symmetric bimodal distribution and a unimodal bell-shaped distribution can share identical mean and variance while having very different skewness and kurtosis, or even identical first four moments while differing in the fifth. This is precisely why the moment hierarchy continues indefinitely, and why, in the limit, one considers the full moment generating function or characteristic function to (under suitable conditions) uniquely pin down a distribution — the natural next topic after moments themselves.