Lesson 15: Variance and Standard Deviation (方差与标准差)CN 2022
The mean tells you where data are centred, but not how spread out they are. Variance (方差) and standard deviation (标准差) measure the spread: the average squared distance from the mean, and its square root. Two classes can have the same mean score and very different spreads, and the standard deviation is the number that tells them apart.
- Variance (方差) — The mean of the squared differences from the mean.
- Standard deviation (标准差) — The square root of the variance, in the same units as the data.
- Deviation (偏差) — The difference between a value and the mean.
- Spread (离散程度) — How far the values are from the centre.
- Population variance (总体方差) — Variance dividing by n, the number of values.
- Sample variance (样本方差) — Variance dividing by n − 1, used when estimating from a sample.
- Outlier (异常值) — A value far from the rest of the data.
The key ideas
The variance is the average of the squared deviations from the mean. For values x₁, …, xₙ with mean x̅, the population variance is σ² = ((x₁ − x̅)² + … + (xₙ − x̅)²)/n. Squaring stops the positive and negative deviations from cancelling each other, which they would if you simply averaged the deviations — that average is always zero. The standard deviation is σ = √(variance), and it is in the same units as the data, so a standard deviation of 5 cm means the values typically sit about 5 cm from the mean.
A shortcut formula makes the arithmetic easier: σ² = (sum of x²)/n − x̅², the mean of the squares minus the square of the mean. For the values 2, 4, 6, the mean is 4, the mean of the squares is (4 + 16 + 36)/3 = 56/3, and the variance is 56/3 − 16 = 8/3. Check directly: the squared deviations are 4, 0 and 4, averaging to 8/3. The two routes agree, and the shortcut is usually faster when the numbers are large.
Standard deviation is the right tool for comparing consistency. Two archers both average 8 points per arrow, but one has standard deviation 0.5 and the other 2.5: the first is consistent, the second is erratic. A small standard deviation means the values cluster near the mean; a large one means they spread out. For roughly normal data, about 68 percent of values lie within one standard deviation of the mean, which turns the standard deviation into a practical range: mean ± σ covers the typical values.
Worked example 1 — variance of a small data set
Find the variance and standard deviation of 3, 5, 7, 9. The mean is (3 + 5 + 7 + 9)/4 = 6. The deviations are −3, −1, 1 and 3, and their squares are 9, 1, 1 and 9. The variance is (9 + 1 + 1 + 9)/4 = 20/4 = 5, and the standard deviation is √5 ≈ 2.24. Check with the shortcut: the mean of the squares is (9 + 25 + 49 + 81)/4 = 164/4 = 41, and 41 − 36 = 5. The values spread about 2.24 units around the mean of 6, which matches the picture: the data run from 3 to 9.
Worked example 2 — comparing two data sets
Class A has test scores with mean 70 and standard deviation 5; class B has mean 70 and standard deviation 15. Which class is more consistent, and what does the difference mean in practice? Class A is more consistent: its scores cluster within about 5 points of 70, so most students scored between 60 and 80. Class B’s scores spread about 15 points, so many students scored below 55 or above 85. The two classes have the same average, but class B has both much weaker and much stronger students. A teacher looking only at the means would miss the whole story; the standard deviation is what separates them.
A deeper look — why divide by n − 1 for a sample
When you compute the variance of a sample to estimate the variance of a larger population, you divide by n − 1 instead of n. The reason is that the sample mean is itself estimated from the data, and the deviations from it are slightly smaller, on average, than the deviations from the true population mean. Dividing by the smaller number n − 1 corrects that underestimate. For a full population you divide by n. In school statistics the population formula is the usual one; the n − 1 version appears when the data are explicitly a sample used to estimate something bigger.
Common mistakes
- Averaging the deviations without squaring. They always sum to zero, so the answer would be 0.
- Forgetting to take the square root. The variance of the example above is 5, but the standard deviation is √5, about 2.24.
- Comparing variances of data in different units. Standard deviation carries the units; compare it with the mean, not with another data set’s variance in different units.
- Using the sample formula (n − 1) when the question asks for the population variance, or the reverse.
Discussion questions
- Two data sets have the same mean and the same standard deviation. Must they have the same shape? Can you sketch two different-looking sets with the same mean and spread?
- Adding 10 to every value changes the mean by 10. What does it do to the standard deviation, and why?
- Multiplying every value by 2 changes the mean. What does it do to the variance and the standard deviation?
Practice questions
- Find the variance of 1, 3, 5. Answer: 8/3. Explanation: Mean 3; squared deviations 4, 0, 4; average 8/3.
- The variance is 16. What is the standard deviation? Answer: 4. Explanation: Standard deviation is the square root of the variance.
- Data 10, 10, 10, 10 have what standard deviation? Answer: 0. Explanation: Every value equals the mean, so there is no spread.
- If every value increases by 5, what happens to the variance? Answer: It stays the same. Explanation: Shifting the data moves the mean by the same amount, so deviations are unchanged.
- Two classes have the same mean. Class A has standard deviation 2, class B has 8. Which is more spread out? Answer: Class B. Explanation: The larger standard deviation means a wider spread.
✅ Check your understanding
Quick recall check, generated from this lesson’s key terms. It is practice only and is not graded.