Sub topic 7
Deviations from the mean
This chapter assumes you can compute a mean, work with negative numbers, and solve a one-variable linear equation. It also assumes you know what squaring a number does. Deviations are the building block for standard deviation, so the habits you form here carry straight into the next chapter.
What a deviation is
A deviation from the mean is the signed distance between one value and the mean of its data set:
deviation = value − mean
- A positive deviation means the value is above the mean.
- A negative deviation means the value is below the mean.
- A deviation of zero means the value equals the mean.
The sign tells you the direction. The size tells you how far away the value is.
Throughout this chapter we use the data set 2, 4, 4, 4, 5, 5, 7, 9. Its sum is 40 and it has 8 values, so the mean is 5.
| Value | Deviation (value − 5) |
|---|---|
| 2 | −3 |
| 4 | −1 |
| 4 | −1 |
| 4 | −1 |
| 5 | 0 |
| 5 | 0 |
| 7 | 2 |
| 9 | 4 |
The value 9 sits 4 above the mean. The value 2 sits 3 below it. Each 4 is only 1 below the mean.
The deviations always sum to zero
Add the deviations in the table: −3 − 1 − 1 − 1 + 0 + 0 + 2 + 4 = 0. This is true for every data set, not just this one.
The reason follows from the definition of the mean. For n values, the mean m satisfies n·m = sum of the values. The sum of the deviations is:
(x₁ − m) + (x₂ − m) + … + (xₙ − m) = (sum of the values) − n·m = 0
So the mean is the balance point of the data. The total distance of the values above it equals the total distance of the values below it. In the table, the values below the mean contribute −6 and the values above contribute +6.
data = [2, 4, 4, 4, 5, 5, 7, 9]
mean = sum(data) / len(data)
deviations = [x - mean for x in data]
print(mean) # 5.0
print(deviations) # [-3.0, -1.0, -1.0, -1.0, 0.0, 0.0, 2.0, 4.0]
print(sum(deviations)) # 0.0With messy decimals, floating-point arithmetic may print a tiny number such as 1e-16 instead of 0. On the GRE you work by hand, so the sum is exactly zero.
Using the zero-sum property to find a missing value
The zero-sum property gives you a fast route through many GRE problems. You do not need to compute the full sum of the values. You only track how far each value is from the mean.
Suppose six numbers have a mean of 10. Five of them are 14, 7, 11, 4, and 12. Find the sixth.
- Compute the five deviations: +4, −3, +1, −6, +2.
- Add them: 4 − 3 + 1 − 6 + 2 = −2.
- All six deviations must sum to 0, so the sixth deviation is +2.
- The sixth value is 10 + 2 = 12.
Check with sums: the six values total 14 + 7 + 11 + 4 + 12 + 12 = 60, and 60 ÷ 6 = 10. The result matches.
The method works best when the numbers are large, because the deviations stay small. For values like 1,204, 1,198, and 1,207 with a mean near 1,200, the deviations +4, −2, and +7 are much easier to add than the originals.
Why we do not average the raw deviations
Because the raw deviations sum to zero, their average is always zero. That tells you nothing about how spread out the data is. Two very different data sets, such as 4, 5, 6 and 0, 5, 10, both have an average deviation of zero.
To measure spread, you have to stop positive and negative deviations from cancelling. There are two common ways to do that.
- Absolute value. Drop the signs. The average of the absolute deviations is called the mean absolute deviation.
- Squaring. Every squared deviation is zero or positive. The average of the squared deviations is the variance, and its square root is the standard deviation.
For our data set, the absolute deviations are 3, 1, 1, 1, 0, 0, 2, 4. They sum to 12, so the mean absolute deviation is 12 ÷ 8 = 1.5. The squared deviations are 9, 1, 1, 1, 0, 0, 4, 16. They sum to 32, so the variance is 32 ÷ 8 = 4 and the standard deviation is 2.
data = [2, 4, 4, 4, 5, 5, 7, 9]
mean = sum(data) / len(data)
deviations = [x - mean for x in data]
abs_total = sum(abs(d) for d in deviations)
sq_total = sum(d ** 2 for d in deviations)
print(abs_total) # 12.0
print(abs_total / len(data)) # 1.5
print(sq_total) # 32.0
print(sq_total / len(data)) # 4.0The GRE tests the squared version, standard deviation. Squaring also gives more weight to large deviations. The value 9 has a deviation of 4 but contributes 16 of the 32 total, which is half of it. A single far-away value can dominate the standard deviation, which matters when you compare spreads later.
The mean minimizes squared deviations
Deviations can be measured from any center point, not just the mean. If you measure from a different number c, the deviations no longer sum to zero, and the sum of squared deviations gets larger. The mean is the one center that makes the sum of squared deviations as small as possible. In symbols:
sum of squared deviations from c = sum of squared deviations from the mean + n·(c − mean)²
The extra term n·(c − mean)² is never negative, so c = mean gives the minimum.
data = [2, 4, 4, 4, 5, 5, 7, 9]
for c in [4, 5, 6]:
total = sum((x - c) ** 2 for x in data)
print(c, total)
# 4 40
# 5 32
# 6 40You can check the identity by hand. For c = 4, the extra term is 8 × (4 − 5)² = 8, and 32 + 8 = 40. The same happens for c = 6. The median here is 4.5, and measuring from it gives 34, which is also above 32.
The GRE does not ask you to prove this. The takeaway is practical: standard deviation is defined using the mean, so the mean is the reference point, and the median is not.
How deviations respond to changes in the data
Deviations let you reason about transformations without recalculating anything.
| Change to every value | Effect on each deviation | Effect on spread | Column | Column |
|---|---|---|---|---|
| Add a constant k | Unchanged | Range and standard deviation unchanged | ||
| Multiply by a constant k | Multiplied by k | Range and standard deviation multiplied by \ | k\ |
Adding 10 shifts every value and the mean by the same amount, so each value − mean is unchanged. Multiplying by 3 stretches every gap by 3. In our data, the deviations become −9, −3, −3, −3, 0, 0, 6, 12, and the standard deviation becomes 6. A later chapter covers transformations in full.
Adding one new value to the set changes things differently. Every old deviation changes, because the mean moves. The new value's own deviation is measured from the new mean.
A special case is common on the GRE. If you add a value equal to the current mean, the mean stays at 5. The new value has a deviation of 0, so the sum of squares stays at 32. The count grows from 8 to 9, so the variance drops from 32 ÷ 8 = 4 to 32 ÷ 9, about 3.56. The standard deviation decreases.
Common errors
- Subtracting in the wrong order. Always use value − mean. Writing mean − value flips every sign, though the squared results are the same.
- Using the median as the center. Standard deviation uses the mean. A deviation from the median does not sum to zero.
- Forgetting that repeated values count each time. The value 4 appears three times, so its deviation of −1 appears three times in the sum.
- Rounding the mean too early. If the mean is 3.333…, keep it as a fraction like 10/3 so the deviations still sum to exactly zero.
Exercise
A list of five numbers has a mean of 20. Four of the numbers are 15, 28, 22, and 17. What is the fifth number?
Show answer
The four deviations are −5, +8, +2, and −3, which sum to +2. The fifth deviation must be −2 so that the total is 0. The fifth number is 20 − 2 = 18. Check: 15 + 28 + 22 + 17 + 18 = 100, and 100 ÷ 5 = 20.
Exercise
The data set 1, 3, 5, 7, 9 has a mean of 5. Find the mean absolute deviation and the standard deviation (population). Which is larger?
Show answer
The deviations are −4, −2, 0, 2, 4. The absolute values sum to 12, so the mean absolute deviation is 12 ÷ 5 = 2.4. The squares are 16, 4, 0, 4, 16, which sum to 40. The variance is 40 ÷ 5 = 8 and the standard deviation is √8, about 2.83. The standard deviation is larger, because squaring weights the larger deviations more heavily.
Exercise
A data set has 10 values and a standard deviation of 3. An eleventh value equal to the mean is added. Does the mean change? Does the standard deviation increase, decrease, or stay the same?
Show answer
The mean does not change, because the new value's deviation is 0 and the deviations still sum to 0. The sum of squared deviations stays the same but is now divided by 11 instead of 10, so the variance and the standard deviation decrease.