Great question! The reason we divide by ( n - 1 ) instead of ( n ) when calculating the sample variance (and thus the sample standard deviation) is related to unbiased estimation and degrees of freedom.
Explanation:
Population vs. Sample
Step 2: Calculate Each Score's Deviation from the Mean
Score
Deviation (Score - Mean)
85
85 - 86.6 = -1.6
90
90 - 86.6 = 3.4
78
78 - 86.6 = -8.6
92
92 - 86.6 = 5.4
88
88 - 86.6 = 1.4
Step 3: Square Each Deviation
Deviation
Squared Deviation
-1.6
(-1.6)² = 2.56
3.4
3.4² = 11.56
-8.6
(-8.6)² = 73.96
5.4
5.4² = 29.16
1.4
1.4² = 1.96
Step 4: Find the Variance
For a sample standard deviation, divide the sum of squared deviations by ((n-1)) where (n=5):
The standard deviation of the students' scores is about 5.46 points, meaning the scores typically vary about 5.46 points above or below the average score of 86.6.
If you'd like, I can also provide a Python code snippet to compute this!
When you have data for the entire population, the variance is calculated by averaging the squared deviations from the population mean, dividing by ( n ).
When you have only a sample from the population (which is typically the case), you don't know the true population mean, so you estimate it using the sample mean.
Using Sample Mean as an Estimate
The sample mean ( \bar{x} ) itself is calculated from the same data points.
Because of this, the deviations ( (x_i - \bar{x}) ) tend to be slightly smaller on average than the deviations from the true population mean ( \mu ).
This leads to an underestimation of the true variance if you divide by ( n ).
Degrees of Freedom
When you calculate deviations from the sample mean, one degree of freedom is "used up" by estimating the mean.
This leaves only ( n - 1 ) independent pieces of information (degrees of freedom) to estimate the variance.
Correction Factor
Dividing by ( n - 1 ) instead of ( n ) compensates for this bias and provides an unbiased estimator of the population variance.
This is called Bessel's correction.
Summary:
Case
Divide by...
Why
Population variance
( n )
Mean is known, use all ( n ) data points
Sample variance estimate
( n - 1 )
Mean estimated from data, adjust for bias
Intuition:
Think of it like this: estimating the mean "fixes" one parameter from the data, so you only have ( n - 1 ) independent deviations left to estimate the spread accurately.
If you want, I can also show you the math behind the bias! Let me know!