Same mean, different spread
A random variable X takes the values 4, 5 and 6 with probabilities , and . Its mean is .
A second variable Y takes the values 1, 5 and 9 with probabilities , and . Its mean is as well.
The two means are the same, but the variables are not alike. X always lands within 1 of its mean. Y lands 4 away from its mean four times out of five. A second number is needed to describe how far the values spread out from the mean.
X as five equally likely tickets: one 4, three 5s and one 6, on a scale from 0 to 10. They balance at 5, and none is more than 1 away.
Y on the same scale: two 1s, one 5 and two 9s. They also balance at 5, but four of the five tickets are 4 away from it.
Why the distances are squared
The obvious measure is the average distance from the mean. For Y, the distances are 1 − 5 = −4, 5 − 5 = 0 and 9 − 5 = 4. Weighted by their probabilities they give .
That is no accident. The mean is the balance point, so the distances below it always cancel the distances above it, for every distribution. The average distance is always 0 and says nothing about spread.
Squaring stops the canceling, because a square is never negative. The squared distances for Y are 16, 0 and 16. Their average, weighted by the probabilities, is .
This is the variance of Y: Var(Y) = 12.8. In general, Var(X) is the expected squared distance from the mean, , where .
The narrow one
For X the distances from 5 are −1, 0 and 1, and their squares are 1, 0 and 1. So Var.
The two variances, 0.4 and 12.8, say in numbers what the beams show: Y is far more spread out than X.
A variance is in squared units. If X is a number of minutes, Var(X) is in minutes squared. Its square root, the standard deviation , is back in the units of X: for X is , and for Y is .
Two values, equally likely
Let X be 4 or 6, each with probability . The mean is 5. Both values are 1 away from it, so the distances are −1 and +1 and both squares are 1. Var.
Move the values further apart: X is 2 or 8, each with probability . The mean is still 5, but both values are now 3 away from it, so each squared distance is 9 and Var.
For any two equally likely values, h on either side of the mean, the variance is . The gap between the values is 2h, but the distance that is squared is h, measured from the mean.
X is 2 or 8 with probability each. Each value is 3 from the balance point at 5, so each squared distance is 9, and Var(X) = 9.
A shortcut: the mean of the squares minus the square of the mean
Var(X) can also be found as Var. Here is worked out like E(X), but with each value squared and each probability left as it is.
For Y: . Then Var, the same as before.
The shortcut avoids working out every distance, which helps when the mean is not a whole number, as in the application below.
The usual mistakes
Leaving the distance unsquared. For X equal to 2 or 8, the distance 3 is not the variance; is.
Using the gap between the two values. The gap from 2 to 8 is 6, but each distance is measured from the mean 5, so it is 3.
Subtracting the mean instead of its square. is not the variance: the mean must be squared first.
Squaring the probabilities. In the values are squared; each square is still weighted by its own probability.
Worked example: Deliveries to a Bakery Each Morning, Where One Probability Is Missing and the Spread Is Asked For
Question The number of deliveries X that a bakery receives in one morning has P(X = 0) = 0.1, P(X = 1) = 0.3, P(X = 2) = p and P(X = 3) = 0.2, and no other values are possible. (a) Find p and E(X). (b) Find Var(X) and the standard deviation of the number of deliveries.
1.The probabilities add up to 1: 0.1 + 0.3 + p + 0.2 = 1, so p = 1 − 0.6 = 0.4.
The four probabilities add up to 1, so the missing bar is p = 0.4. 2.(a) p = 0.4, and E(X) = 0 × 0.1 + 1 × 0.3 + 2 × 0.4 + 3 × 0.2 = 0 + 0.3 + 0.8 + 0.6 = 1.7 deliveries.
(a) E(X) = 1 × 0.3 + 2 × 0.4 + 3 × 0.2 = 1.7 deliveries. 3.Find the mean of the squares, each square weighted by its own probability: E(X2) = 02 × 0.1 + 12 × 0.3 + 22 × 0.4 + 32 × 0.2 = 0 + 0.3 + 1.6 + 1.8 = 3.7.
The mean of the squares weights 0, 1, 4 and 9 by the same probabilities: E(X2) = 3.7. 4.Subtract the square of the mean: Var(X) = 3.7 − 1.72 = 3.7 − 2.89 = 0.81.
Var(X) = E(X2) − [E(X)]2 = 3.7 − 2.89 = 0.81. 5.(b) Var(X) = 0.81, and the standard deviation is √0.81 = 0.9 deliveries. Check from the distances to the mean: 2.89 × 0.1 + 0.49 × 0.3 + 0.09 × 0.4 + 1.69 × 0.2 = 0.289 + 0.147 + 0.036 + 0.338 = 0.81.
(b) The variance is 0.81 and the standard deviation is √0.81 = 0.9 deliveries.
Answer: (a) p = 0.4 and E(X) = 1.7; (b) Var(X) = 0.81, standard deviation 0.9 deliveries
Common mistakes
- Writing Var(X) = E(X2) − E(X) = 3.7 − 1.7 = 2. The mean must be squared before it is subtracted: 1.72 = 2.89.
- Squaring the probabilities instead of the values in E(X2). The value 2 becomes 4, and it is still weighted by its own probability, 0.4 and not 0.16.
More probability distributions problems, worked step by step →