College Statistics • Probability Foundations

Variance of a Random Variable

Quantifying the spread of probability distributions through expected squared deviations from the mean.

College Statistics subject emblem with a scatter plot, summation notation, and frequency columns.
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

Historical Context & Motivation

The idea of measuring how much observations scatter around a central value did not emerge overnight; it evolved over several centuries as mathematicians grappled with the problem of quantifying uncertainty. Early astronomers noticed that repeated measurements of the same celestial angle yielded slightly different numbers, and they sought a principled way to summarize the reliability of those measurements. The variance of a random variable ultimately became the dominant measure of dispersion in probability theory because it is analytically tractable, decomposes neatly across independent sources of randomness, and connects directly to the geometry of Hilbert spaces used in modern statistical theory.

Before variance was formalized, practitioners used cruder measures such as the mean absolute deviation or the probable error. While these quantities are intuitive, they lack the algebraic properties that make variance so powerful: it is additive for independent random variables, differentiable with respect to parameters, and expressible as the second central moment—an object that slots naturally into the moment-generating function framework. Understanding the historical trajectory of variance illuminates why, among all possible measures of spread, this particular one rose to prominence.

1733 • De Moivre's Normal Approximation

Abraham de Moivre derives the normal curve as an approximation to the binomial distribution, implicitly working with what we now call variance to characterize the bell curve's width.

1809 • Gauss and Least Squares

Carl Friedrich Gauss publishes Theoria Motus, formalizing the method of least squares and using the sum of squared residuals—an ancestor of sample variance—to fit planetary orbits.

1918 • Fisher Coins 'Variance'

Ronald A. Fisher introduces the term variance in his landmark paper on the correlation between relatives, giving the concept the name and notation used today.

1933 • Kolmogorov's Axioms

Andrey Kolmogorov publishes Foundations of the Theory of Probability, providing the measure-theoretic axioms that place variance on rigorous mathematical footing for arbitrary random variables.

1946 • Cramér–Rao Lower Bound

Harald Cramér and C. R. Rao independently establish a lower bound on the variance of any unbiased estimator, cementing variance as the fundamental yardstick for estimator efficiency.

This historical arc reveals a recurring theme: variance endures not because it is the only way to measure spread, but because its algebraic and geometric properties make it indispensable. The central question this lesson addresses is both simple and profound—how do we assign a single number to capture the degree to which a random variable's values deviate from its expected value?

SECTION 2

Core Principles & Definitions

Before diving into formulas, it is important to internalize the conceptual pillars that support the definition of variance. Variance is a measure of dispersion: it tells us, on average, how far the values of a random variable lie from the distribution's center. A variance of zero indicates that the random variable is a constant—every outcome equals the mean. A large variance signals that outcomes are widely spread, making prediction less precise. The following principles form the conceptual backbone of everything that follows.

1

Deviation from the Mean

Variance is built from deviations X − μ. Each deviation measures how far a single outcome falls from the expected value, capturing the direction and magnitude of departure.
2

Squaring Eliminates Sign

Positive and negative deviations would cancel in a straight average, yielding zero. Squaring each deviation ensures all contributions are nonnegative and penalizes large deviations disproportionately.
3

Expectation as a Weighted Average

Variance is the expected value of the squared deviations, meaning each squared deviation is weighted by its probability—not treated equally as in sample statistics.
4

Standard Deviation as Interpretation

Because squaring inflates units (e.g., dollars²), we often take the square root to obtain the standard deviation σ, which lives in the same units as X and is easier to interpret directly.
5

Additivity for Independents

If X and Y are independent random variables, then Var(X + Y) = Var(X) + Var(Y). This additivity makes variance the natural measure of spread in the Central Limit Theorem and ANOVA.
✦

KEY TAKEAWAY

Think of variance like the moment of inertia of a probability distribution. In physics, moment of inertia measures how mass is spread around a rotation axis; in statistics, variance measures how probability mass is spread around the mean. A distribution concentrated near its center has low variance, just as a compact flywheel has low moment of inertia. Spreading mass outward increases both quantities quadratically—and both govern how systems respond to perturbation.

SECTION 3

Visual Explanation

The following diagram compares two discrete probability distributions that share the same mean (μ = 3) but have very different variances. Visually inspecting how the probability mass concentrates or spreads gives immediate geometric intuition for what variance captures.

Same Mean, Different VarianceLow Variance (σ² = 0.5)00.10.20.30.4P(X = x)10.0520.2030.5040.2050.05μ = 3High Variance (σ² = 2.0)00.10.20.30.410.2020.2030.2040.2050.20μ = 3
Left: a distribution concentrated around the mean (σ² = 0.5). Right: a uniform distribution with the same mean but much higher variance (σ² = 2.0). The dashed vertical line marks μ = 3 in each case. Notice that the low-variance distribution allocates 50% of its probability mass to the mean itself, while the high-variance distribution spreads mass equally across all five outcomes.

The visual contrast is striking: both distributions have identical expected values, yet their shapes convey very different levels of uncertainty. In the left panel, a prediction of X = 3 is reasonably reliable; in the right panel, every outcome from 1 to 5 is equally likely, and predicting the mean is no better than chance. Variance condenses this visual spread into a single number, enabling rigorous comparison even when distributions have complex shapes that resist casual visual inspection.

SECTION 4

Mathematical Framework

The formal definition of variance proceeds from the notion of the expected value (mean) of a random variable. We denote the expected value of X by E[X] = μ, and define variance as the expected squared deviation from that mean. Two equivalent computational forms are widely used: the definition form and the raw-moment shortcut.

DEFINITION OF VARIANCE

Var(X)=σ2=E[(X−μ)2]Var(X) = σ² = E[(X − μ)²]

X is the random variable, μ = E[X] is its expected value, and σ² denotes the population variance. The operator E[·] computes a probability-weighted average over all possible outcomes.

COMPUTATIONAL SHORTCUT

Var(X)=E[X2]−(E[X])2Var(X) = E[X²] − (E[X])²

This equivalent form is often computationally simpler. E[X²] is the second raw moment (the expected value of the square), and (E[X])² is the square of the first raw moment. This identity follows from expanding (X − μ)² and taking expectations term by term.

Derivation of the Shortcut Formula

Starting from the definition, expand the square inside the expectation: E[(X − μ)²] = E[X² − 2μX + μ²]. By linearity of expectation, this equals E[X²] − 2μ·E[X] + μ². Since E[X] = μ, the middle term becomes −2μ² and the expression simplifies to E[X²] − 2μ² + μ² = E[X²] − μ². This confirms the shortcut: Var(X) = E[X²] − (E[X])². The derivation relies solely on the linearity of expectation, which holds for any random variable with finite second moment.

DISCRETE RANDOM VARIABLE

Var(X)=Σi(xi−μ)2⋅P(X=xi)Var(X) = Σᵢ (xᵢ − μ)² · P(X = xᵢ)

For a discrete random variable, the expectation is a weighted sum over all possible values xᵢ with weights P(X = xᵢ). Each term contributes a nonnegative amount proportional to the squared distance from the mean.

CONTINUOUS RANDOM VARIABLE

Var(X)=∫−∞∞(x−μ)2f(x)dxVar(X) = ∫₋∞^∞ (x − μ)² f(x) dx

For a continuous random variable with probability density function f(x), the sum is replaced by an integral. The interpretation is identical: we average the squared deviations, weighted by probability density.

Key Properties of Variance

  • Non-negativity: Var(X) ≥ 0, with equality if and only if X is a constant (degenerate) random variable.
  • Scaling: Var(aX + b) = a²·Var(X). Adding a constant shifts the mean but does not change spread; multiplying by a scales the spread quadratically.
  • Additivity under independence: If X and Y are independent, Var(X + Y) = Var(X) + Var(Y). More generally, Var(X + Y) = Var(X) + Var(Y) + 2·Cov(X, Y).
  • Relation to standard deviation: σ = √Var(X). The standard deviation restores the original units and is often preferred for interpretation.

SECTION 5

Variance Across Common Distributions

Different families of probability distributions have closed-form expressions for variance in terms of their parameters. Recognizing these formulas is essential for applied work: once you identify a distribution, you can read off the variance without computing any sums or integrals. The table below summarizes the variance formulas for the distributions most commonly encountered in an introductory probability course.

DistributionParametersMean (μ)Variance (σ²)
Bernoullip ∈ (0,1)pp(1 − p)
Binomialn, pnpnp(1 − p)
Poissonλ > 0λλ
Geometricp ∈ (0,1)1/p(1 − p)/p²
Uniform (cont.)a, b(a + b)/2(b − a)²/12
Exponentialλ > 01/λ1/λ²
Normalμ, σ²μσ²

Variance formulas for common probability distributions

Normal Distributions with Different Variancesxf(x)−3−2−10123σ² = 0.25 (σ = 0.5)σ² = 1.00 (σ = 1.0)σ² = 4.00 (σ = 2.0)All three curves share μ = 0. Larger σ² → wider, flatter bell curve.
Three normal distributions centered at μ = 0 with variances σ² = 0.25 (cyan), σ² = 1.00 (violet), and σ² = 4.00 (pink). As variance increases, the curve becomes shorter and wider, spreading probability mass over a larger range of outcomes. The total area under each curve remains 1.

The three normal curves above offer a powerful visual mnemonic: variance directly controls the width of a distribution. Since the area under each density must integrate to 1, a wider curve necessarily has a lower peak. For the normal distribution in particular, roughly 68% of probability mass lies within one standard deviation of the mean, and about 95% within two—these benchmarks are direct consequences of the variance parameter. Distributions with other shapes (exponential, Poisson) have their own variance-dependent geometry, but the qualitative lesson holds universally: higher variance means greater uncertainty.

SECTION 6

Worked Example

Let us compute the variance of a discrete random variable using both the definition form and the computational shortcut, then verify they yield the same result. Consider a random variable X representing the number of heads obtained when flipping two fair coins.

Variance of the Number of Heads in Two Coin Flips

  1. 1

    Step 1 — Define the Probability Distribution

    The sample space is {TT, TH, HT, HH}. Let X count the number of heads. The possible values and their probabilities are: P(X = 0) = 1/4, P(X = 1) = 2/4 = 1/2, P(X = 2) = 1/4. This is a Binomial(n = 2, p = 1/2) distribution.
    X ∈ {0, 1, 2} with P = {1/4, 1/2, 1/4}
  2. 2

    Step 2 — Compute the Expected Value E[X]

    E[X] = Σ xᵢ·P(X = xᵢ) = 0·(1/4) + 1·(1/2) + 2·(1/4) = 0 + 1/2 + 1/2 = 1. Alternatively, for a Binomial(2, 0.5), E[X] = np = 2 × 0.5 = 1.
    μ = E[X] = 1
  3. 3

    Step 3 — Compute Var(X) via the Definition

    Var(X) = Σ (xᵢ − μ)²·P(X = xᵢ) = (0 − 1)²·(1/4) + (1 − 1)²·(1/2) + (2 − 1)²·(1/4) = 1·(1/4) + 0·(1/2) + 1·(1/4) = 1/4 + 0 + 1/4 = 1/2.
    Var(X) = 1/2 (via definition)
  4. 4

    Step 4 — Verify via the Shortcut Formula

    First compute E[X²] = 0²·(1/4) + 1²·(1/2) + 2²·(1/4) = 0 + 1/2 + 4/4 = 0 + 1/2 + 1 = 3/2. Then apply the shortcut: Var(X) = E[X²] − (E[X])² = 3/2 − 1² = 3/2 − 1 = 1/2. Both methods agree.
    Var(X) = 1/2 (verified)
  5. 5

    Step 5 — Compute Standard Deviation and Interpret

    σ = √(1/2) = 1/√2 ≈ 0.707. This means the number of heads in two flips typically deviates from the mean (1 head) by about 0.707 heads. We can also verify against the binomial formula: Var(X) = np(1 − p) = 2 × 0.5 × 0.5 = 0.5, which matches perfectly.
    σ ≈ 0.707 heads

SECTION 7

Strengths, Limitations & Comparisons

Variance is the most widely used measure of dispersion, but it is not the only one, and it is not always the most appropriate. Understanding its strengths and limitations, especially relative to alternatives, is essential for choosing the right tool in any given analytical context. The table below compares variance with other common measures of spread.

CriterionVariance / Std DevMean Absolute DeviationInterquartile Range
Mathematical tractabilityExcellent — differentiable, additive under independence, connects to moment-generating functionsModerate — absolute values are not differentiable, harder to analyze algebraicallyLow — defined by quantiles, not amenable to algebraic manipulation
Sensitivity to outliersHigh — squaring amplifies extreme deviations, making variance sensitive to outliersModerate — linear in deviations, less affected by extremesLow — depends only on the middle 50%, highly robust to outliers
Interpretability of unitsVariance has squared units (e.g., dollars²); standard deviation restores original unitsSame units as the data — directly interpretableSame units as the data — directly interpretable
Role in key theoremsCentral: CLT, Chebyshev's inequality, ANOVA, Cramér–Rao boundLimited theoretical role in classical inferenceUsed in nonparametric and exploratory statistics (box plots)
Existence requirementRequires E[X²] < ∞ (finite second moment); fails for heavy-tailed distributions like CauchyRequires E[|X|] < ∞ (finite first moment)Always exists as long as the distribution has well-defined quantiles

Comparison of variance with alternative measures of spread

✦

KEY TAKEAWAY

Variance is to spread what the least-squares regression line is to prediction: it is not always the most robust choice, but it is the most algebraically fertile one. Its dominance in statistical theory stems not from being the most intuitive measure of dispersion, but from its deep connections to optimization, linear algebra, and the Central Limit Theorem. When working with heavy-tailed data or small samples with outliers, robust alternatives like the IQR or MAD (median absolute deviation) may be more appropriate.

SECTION 8

Connection to Advanced Theory

The concept of variance serves as a gateway to several advanced topics in probability and statistics. In this section, we sketch the connections between the basic variance of a single random variable and the broader theoretical landscape that awaits in upper-division and graduate coursework.

Foundational ConceptAdvanced Extension
Var(X) = E[(X − μ)²] — the second central momentHigher-order central moments: skewness (3rd) and kurtosis (4th) describe asymmetry and tail heaviness beyond what variance captures.
Var(X + Y) = Var(X) + Var(Y) + 2Cov(X,Y)The covariance matrix Σ generalizes variance to multivariate settings; its eigenvalues power Principal Component Analysis (PCA).
σ/√n as the standard error of the sample meanThe Central Limit Theorem: √n(X̄ − μ)/σ → N(0,1), establishing the foundational role of variance in asymptotic inference.
Var(X) as a measure of estimator qualityThe Cramér–Rao lower bound: Var(T) ≥ 1/I(θ), where I(θ) is Fisher information. Minimum variance unbiased estimators (MVUEs) achieve this bound.
Chebyshev's inequality: P(|X − μ| ≥ kσ) ≤ 1/k²Concentration inequalities (Hoeffding, Bernstein, sub-Gaussian bounds) provide exponentially tighter bounds by exploiting distributional assumptions beyond second moments.

From foundational variance to advanced theory

💡

Looking Ahead

In a mathematical statistics or machine learning course, you will encounter variance decomposition results like the bias-variance tradeoff, which states that the expected prediction error of a model can be decomposed into three terms: (bias)² + variance + irreducible noise. Mastering the probabilistic definition of variance in this lesson is the essential first step toward understanding these powerful decompositions.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

Explain why Var(X) = 0 if and only if X is a constant random variable. In your explanation, address why the squaring operation in the definition prevents positive and negative deviations from canceling, and discuss what this implies about the degenerate distribution.
Show answer
Since Var(X) = E[(X − μ)²] and each squared deviation (X − μ)² is nonnegative, the expectation of a nonnegative quantity is zero only if that quantity is zero with probability 1. This means P(X = μ) = 1, so X equals its mean with certainty—i.e., X is a constant. The squaring is critical because E[X − μ] = 0 always (by definition of the mean), so raw deviations always cancel regardless of spread. Squaring prevents this cancellation and ensures that any genuine spread contributes a strictly positive amount to the variance.

Question 2: BASIC CALCULATION

A discrete random variable Y has the following distribution: P(Y = 1) = 0.3, P(Y = 2) = 0.5, P(Y = 3) = 0.2. Compute E[Y], E[Y²], and Var(Y) using the computational shortcut formula.
Show answer
First, E[Y] = 1(0.3) + 2(0.5) + 3(0.2) = 0.3 + 1.0 + 0.6 = 1.9. Next, E[Y²] = 1²(0.3) + 2²(0.5) + 3²(0.2) = 0.3 + 2.0 + 1.8 = 4.1. Applying the shortcut: Var(Y) = E[Y²] − (E[Y])² = 4.1 − (1.9)² = 4.1 − 3.61 = 0.49. The standard deviation is σ = √0.49 = 0.7, indicating that outcomes typically deviate from the mean of 1.9 by about 0.7 units.

Question 3: INTERMEDIATE

Let X ~ Binomial(n = 10, p = 0.4). Without computing any sums directly, use the known formulas for the binomial mean and variance to find Var(X). Then, if W = 3X − 5, find Var(W) and E[W] using the properties of expectation and variance under linear transformations.
Show answer
For a Binomial(10, 0.4) distribution, E[X] = np = 10 × 0.4 = 4 and Var(X) = np(1 − p) = 10 × 0.4 × 0.6 = 2.4. For the linear transformation W = 3X − 5: E[W] = 3·E[X] − 5 = 3(4) − 5 = 7, and Var(W) = 3²·Var(X) = 9 × 2.4 = 21.6 (the additive constant −5 does not affect variance). Thus σ_W = √21.6 ≈ 4.65. Note how multiplying X by 3 inflates the variance by a factor of 9 (= 3²), reflecting the quadratic scaling property.

Question 4: APPLIED

A manufacturing process produces components whose lengths (in mm) follow a normal distribution with μ = 50.0 and σ² = 0.04. Quality control rejects any component whose length deviates from the mean by more than 2σ. (a) What is the standard deviation? (b) What percentage of components are rejected? (c) If each rejected component costs the company $12, and 10,000 components are produced daily, estimate the daily rejection cost.
Show answer
(a) σ = √0.04 = 0.2 mm. (b) For a normal distribution, the probability of falling within ±2σ of the mean is approximately 95.45%, so approximately 4.55% of components are rejected. (c) Daily rejections ≈ 10,000 × 0.0455 = 455 components. Daily cost ≈ 455 × $12 = $5,460. This problem illustrates how variance directly drives operational costs: reducing σ² (e.g., by improving machinery precision) would decrease the rejection rate and save money. Halving σ to 0.1 mm would make the ±2σ window cover ±0.2 mm, and the fraction outside ±4 original-σ would drop to about 0.006%, slashing costs dramatically.

Question 5: CRITICAL THINKING

Prove that for any random variable X with finite second moment and any constant c, the expression E[(X − c)²] is minimized when c = E[X]. Interpret this result in the context of prediction: why does the mean minimize expected squared prediction error, and how does this connect to the definition of variance?
Show answer
Define g(c) = E[(X − c)²]. Expand: g(c) = E[X² − 2cX + c²] = E[X²] − 2c·E[X] + c². This is a quadratic in c with positive leading coefficient (1), so it has a unique minimum. Taking the derivative: g'(c) = −2E[X] + 2c = 0, yielding c* = E[X] = μ. The second derivative g''(c) = 2 > 0 confirms this is a minimum. The minimum value is g(μ) = E[X²] − μ² = Var(X). This result has a profound interpretation: if forced to predict X with a single number c and penalized by squared error, the optimal prediction is the mean, and the unavoidable expected loss equals the variance. Variance therefore represents the irreducible expected squared prediction error when using the best constant predictor. This connects directly to the bias-variance decomposition in regression: variance measures the fundamental unpredictability that no constant can eliminate.

SUMMARY

Lesson Summary

Summary

The variance of a random variable, defined as Var(X) = E[(X − μ)²], measures the average squared deviation from the expected value. An equivalent and often more convenient form is the shortcut formula E[X²] − (E[X])². Key algebraic properties include non-negativity, quadratic scaling under linear transformations (Var(aX + b) = a²Var(X)), and additivity for independent random variables. The standard deviation σ = √Var(X) restores the original units of measurement and is often preferred for interpretation.

Introduced by Ronald Fisher in 1918 and placed on rigorous foundations by Kolmogorov's axioms, variance occupies a central position in the architecture of modern statistics. It appears in the Central Limit Theorem, the Cramér–Rao lower bound, and the bias-variance tradeoff in statistical learning. While alternative dispersion measures like the mean absolute deviation and interquartile range offer greater robustness to outliers, variance remains the theoretical cornerstone because of its unmatched algebraic and geometric properties.

Varsity Tutors • College Statistics • Variance of a Random Variable