Computing Variance Using the Shortcut Formula
You'll learn a faster way to calculate variance that avoids repeated subtraction from the mean.
Why We Need a Shortcut
You already know variance measures spread by computing the expected squared deviation from the mean: Var(X) = E[(X - μ)²]. While conceptually clear, this "definitional formula" requires you to subtract the mean from every possible value of X, square each difference, then take the expectation—tedious for complicated distributions.
The Computational Formula
There's an algebraically equivalent but computationally simpler formula:
Var(X) = E[X²] - (E[X])²
Read this as: "the expected value of X-squared, minus the square of the expected value of X."
This formula lets you:
- Calculate E[X] (the mean) once
- Calculate E[X²] (expectation of the squared random variable) separately
- Subtract the square of the first from the second
Why it works: When you expand E[(X - μ)²] algebraically using linearity of expectation, the cross terms collapse, leaving exactly E[X²] - μ². The algebra is tedious but valid—trust it!
Practical Example
Suppose X has values {1, 2, 3} each with probability 1/3.
- E[X] = (1 + 2 + 3)/3 = 2
- E[X²] = (1² + 2² + 3²)/3 = (1 + 4 + 9)/3 = 14/3
- Var(X) = 14/3 - 2² = 14/3 - 4 = 14/3 - 12/3 = 2/3
No repeated subtractions needed!
Memory Aid
Think of it as: "mean of squares minus square of mean."
Key Takeaway: The shortcut formula Var(X) = E[X²] - (E[X])² simplifies variance calculations by avoiding explicit deviations from the mean—just compute two expectations and subtract.