Variance, Standard Deviation and Sums
Measure spread with variance and standard deviation, rescale random variables, add independent risks, and bound tail probabilities with Chebyshev.
Welcome back!
Step 1 of 14Learn
Same average, different risk
Two investments each have an expected one-year gain of $100.
- A pays exactly $100, guaranteed.
- B pays $1,100 with probability 0.1 and loses $11.11 otherwise. (Check: 0.1 × 1100 − 0.9 × 11.11 ≈ 100.)
Same mean, completely different experience. The expected value hides how spread out the outcomes are. To capture that, we use variance: the expected squared distance from the mean.
Var(X) = E[(X − μ)2], where μ = E[X].
A more convenient formula for calculation is
Var(X) = E[X2] − (E[X])2
The standard deviation is the square root, σ = √Var(X). It is measured in the same units as X, which makes it easier to interpret: roughly, a typical distance of outcomes from the mean.
Fair die. E[X] = 3.5 and E[X2] = 91/6 ≈ 15.17. So Var(X) = 15.17 − 12.25 = 2.92 and σ ≈ 1.71.
Why square the distances instead of just averaging them? Because the plain average distance E[X − μ] is always exactly zero: values above and below the mean cancel. Squaring makes every deviation count positively and gives extra weight to large deviations, and it leads to the tidy rules for sums you'll see shortly.
Step 2 of 14Chart
Same mean, very different outcomes
Both investments average $100, but B's possible results sit far from that average. Variance measures exactly this distance.
Step 3 of 14Practice · Work it out
A random variable takes the value 0 with probability 0.5 and the value 10 with probability 0.5. What is its standard deviation?
Step 4 of 14Learn
Shifting and scaling
Random variables often get converted: dollars to euros, Celsius to Fahrenheit, scores to curved scores. Two rules tell you what happens to the mean and spread under a linear change Y = aX + b:
E[aX + b] = a·E[X] + b Var(aX + b) = a2·Var(X), so SD(aX + b) = |a|·SD(X)
Adding a constant b shifts every value by the same amount, which moves the mean but leaves the spread untouched. Multiplying by a stretches all distances by |a|, so the standard deviation scales by |a| and the variance by a2.
Example. Daily temperatures in a city have mean 20 °C and SD 5 °C. In Fahrenheit, F = 1.8C + 32:
- Mean: 1.8 × 20 + 32 = 68 °F
- SD: 1.8 × 5 = 9 °F (the +32 does not affect spread)
Example. A salesperson earns a $500 base plus $50 per sale. Sales per week have mean 8 and SD 3. Weekly pay has mean 500 + 50 × 8 = $900 and SD 50 × 3 = $150.
A common mistake is to add the constant to the standard deviation, or to multiply the variance by a instead of a2.
Step 5 of 14Practice · Work it out
Exam scores have a mean of 60 and a standard deviation of 8. The teacher curves them with Y = 1.25X + 5. What is the standard deviation of the curved scores?
Step 6 of 14Learn
Adding random variables
Means always add: E[X + Y] = E[X] + E[Y]. Variances add too, but only when the variables are independent (or, more generally, uncorrelated):
Var(X + Y) = Var(X) + Var(Y) for independent X and Y.
Note what does not add: standard deviations. If X and Y are independent with SD 3 and 4, then Var(X + Y) = 9 + 16 = 25 and SD(X + Y) = 5, not 7. Spreads combine like the sides of a right triangle, because independent ups and downs partly cancel.
Also, Var(X − Y) = Var(X) + Var(Y) for independent variables. Subtracting does not cancel uncertainty; it adds it. If you weigh a full box (SD 3 g) and an empty box (SD 4 g) separately to find the contents, the difference has SD 5 g.
Averages and diversification. For n independent variables each with variance σ^2, the sum has variance nσ^2, so its SD is √n·σ. The average divides that by n:
SD(average) = σ / √n
Average 100 independent measurements and the spread shrinks tenfold. This is the mathematics behind diversification in investing and repeated measurement in science. It only works for independent risks: if the variables move together, as stocks do in a crash, the benefit shrinks.
Step 7 of 14Practice · Work it out
X and Y are independent with SD(X) = 6 and SD(Y) = 8. What is SD(X − Y)?
Step 8 of 14Explore
Spread of a sum of n independent values
Add n independent values, each with mean m and SD s. The mean of the total grows like n, but the SD grows only like √n, because variances (not SDs) add.
- SD of a sum of 25
- 50
- Mean of a sum of 25
- 500
- SD of a sum of 100
- 100
Step 9 of 14Note
Step 10 of 14Chart
Chebyshev's guarantee vs a normal distribution
Share of values within k SDs of the mean. Chebyshev's floor holds for every distribution, so it is far more cautious than what a bell curve actually delivers.
Step 11 of 14Practice · Match the pairs
Match each quantity to its value, for independent X and Y with E[X] = 4, Var(X) = 9, E[Y] = 1, Var(Y) = 16.
Tap an answer, then tap the place where it belongs (or drag it there).
- E[3X − 2]
- Var(3X − 2)
- Var(X + Y)
- SD(X − Y)
- E[2X + Y]
Step 12 of 14Practice · What would you do?
What would you do?
An investor can put $10,000 into one stock with an expected annual return of 8% and an SD of 30%, or split it equally across 25 stocks with the same expected return and SD, whose returns are independent. What happens to the portfolio's expected return and risk?
Step 13 of 14Tap to reveal
Variance step by step
1. List values and probabilities
X takes 0, 1 and 2 with probabilities 0.2, 0.5 and 0.3. The probabilities add to 1, so this is a valid PMF.
2. Find the mean
E[X] = 0(0.2) + 1(0.5) + 2(0.3) = 1.1.
3. Find E[X2]
Square each value, keep the probabilities: 0(0.2) + 1(0.5) + 4(0.3) = 1.7.
4. Subtract the squared mean
Var(X) = 1.7 − 1.12 = 1.7 − 1.21 = 0.49. A negative result would signal an arithmetic error, since variance can never be negative.
5. Take the square root
SD = √0.49 = 0.7, in the same units as X. Typical outcomes sit about 0.7 away from the mean of 1.1.
Step 14 of 14Practice · Choose one
Using Chebyshev's inequality, what is the largest possible fraction of a distribution that can lie 3 or more standard deviations away from its mean?
Lesson complete!