Learn
Lesson · Discrete Probability · Random variables

Variance and Standard Deviation

Variance is the expected squared deviation from the mean, and it measures spread. It adds over independent variables, and its square root has the same units as X.

Var(X) = E[(X − E[X])²] = E[X²] − (E[X])² σ(X) = √Var(X) same units as X Var(aX + b) = a²·Var(X) shifts do not matter Var(X + Y) = Var(X) + Var(Y) only when INDEPENDENT
Spread, and its one caveat

Core ideas

What this lesson establishes

Expectation locates a distribution; variance says how tightly it is packed around that location.

1

Squaring makes deviations positive

E[X − E[X]] = 0 always, so deviations must be squared before averaging or they cancel.

2

The computational formula is faster

Var(X) = E[X²] − (E[X])². Two expectations rather than a new distribution of deviations.

3

Variance adds only for independent variables

Unlike expectation. Var(X + X) = 4Var(X), not 2Var(X) — and that is the case where dependence is total.

The material

Measuring spread

The definition, the shortcut, the rules, and what a standard deviation buys you.

Definition · Variance and standard deviation

Var(X) = E[(X − μ)²] where μ = E[X]. The standard deviation is σ(X) = √Var(X).

Theorem · Computational formula

Var(X) = E[X²] − (E[X])².

E[(X − μ)²] = E[X² − 2μX + μ²] = E[X²] − 2μE[X] + μ² = E[X²] − 2μ² + μ² = E[X²] − μ², using linearity and E[X] = μ.

□

Two consequences drop out. Variance is non-negative, so E[X²] ≥ (E[X])² always — the inequality noticed in “Expected Value”. And Var(X) = 0 exactly when X is constant.

Theorem · Scaling and shifting

Var(aX + b) = a²Var(X). Adding a constant moves the distribution without changing its spread; scaling by a scales the spread by |a| and the variance by a².

Theorem · Variance of a sum

If X and Y are independent, Var(X + Y) = Var(X) + Var(Y). Without independence, Var(X + Y) = Var(X) + Var(Y) + 2Cov(X,Y), where the covariance Cov(X,Y) = E[XY] − E[X]E[Y] is the amount by which the product rule fails — “Linearity of Expectation” showed it is 0 when X and Y are independent, which is where the first form comes from.

This is the difference from expectation, and it is worth stating plainly: sums of expectations never need independence, sums of variances always do. Adding X to itself makes the point — Var(2X) = 4Var(X), not 2Var(X).

Example · A fair die

E[X] = 3.5 and E[X²] = (1+4+9+16+25+36)/6 = 91/6 ≈ 15.167. So Var(X) = 91/6 − 49/4 = 35/12 ≈ 2.917 and σ ≈ 1.708.

Example · Two bets, one expectation

Bet A wins £1 or loses £1 on a fair coin: E = 0, Var = 1. Bet B wins £1000 or loses £1000: E = 0, Var = 1 000 000. Equal expectations, and no one would treat them as equivalent. Expectation alone cannot distinguish them; variance can.

Why variance shrinks when you average

Theorem · Variance of an average

For independent X₁, …, X_n each with variance σ², the average X̄ = (X₁ + ⋯ + X_n)/n has Var(X̄) = σ²/n and standard deviation σ/√n.

The sum has variance nσ² by independence, and dividing by n scales the variance by 1/n², giving σ²/n.

□

The √n is why the insurer of “Expected Value” sells many policies. It also explains why halving the uncertainty of an estimate requires four times the data — the most consequential single fact in applied statistics.

Theorem · Chebyshev's inequality

For any k > 0, P(|X − μ| ≥ kσ) ≤ 1/k². At most a quarter of any distribution lies more than two standard deviations from its mean, and at most a ninth beyond three.

Chebyshev is weak — for most real distributions the true tails are far thinner — and it holds for every distribution with a finite variance, with no shape assumption at all. That generality is what makes it worth having.

Interactive

Distribution, expectation, variance

Definition first, formula second

Distribution
P(X = k)E[X]

Method

Computing a variance

Two expectations, then subtract.

1

Compute E[X]

The weighted average, as in “Expected Value”.

2

Compute E[X²]

Same distribution, values squared: Σ k²P(X = k). Not (E[X])².

3

Subtract

Var(X) = E[X²] − (E[X])². If the result is negative, one of the two expectations is wrong.

4

Take the square root for interpretation

σ is in the same units as X and is what to quote. Variance is in squared units and is what adds.

Variance

Score 0 / 0

Variance of a sum, with and without independence

Two fair dice, X and Y, each with variance 35/12.

INDEPENDENT — X and Y are two separate dice: Var(X + Y) = Var(X) + Var(Y) = 35/12 + 35/12 = 35/6 ≈ 5.833 σ(X+Y) ≈ 2.415 DEPENDENT — the same die counted twice, so Y = X: X + Y = 2X Var(2X) = 4·Var(X) = 4 · 35/12 = 35/3 ≈ 11.667 σ(2X) ≈ 3.416 Both sums have expectation 7. Their spreads differ by a factor of two in the variance, because in the second the two contributions cannot cancel.

This is the concrete reason variance needs independence and expectation does not. Two independent dice can offset each other — a high one with a low one — while a doubled die cannot, so the spread is strictly larger. Notice also what adding the standard deviations would have given: 1.708 + 1.708 = 3.416, which is σ(2X), the dependent line. Standard deviations add only when the variables move in lockstep; it is variances that add for independent variables, and √(35/6) ≈ 2.415 is what the independent sum actually has.

Common mistakes

1
Computing (E[X])² where E[X²] is wantedThey differ by exactly the variance. Squaring the values and then averaging is not averaging and then squaring.
2
Adding variances of dependent variablesVar(X + Y) needs the covariance term unless they are independent. This is the main asymmetry with expectation.
3
Quoting variance where a standard deviation is meantVariance is in squared units. σ is comparable with the values themselves and is what to report.

Check your understanding

✓
Finish when you can say why averaging reduces spread by √n.

Compute the variance of the average of n independent fair dice, and state what happens to σ as n grows. That single fact underlies polling margins, insurance, and repeated measurement.

Note: Chebyshev's inequality is the bridge from variance to the law of large numbers: as n grows, Var(X̄) = σ²/n → 0, so Chebyshev forces the average to concentrate at the mean. That is a proof of the weak law, in two lines, from this lesson's material.

Kept in this browser only, for you. Nothing is sent anywhere and nothing checks it. Carry it to another device.

Feedback and recommendations

Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.

No recommendations yet for this lesson.