Center ($\bar{x}$) and Deviations ($x_i - \bar{x}$) for $\{2, 4, 6\}$
The mean $\bar{x} = 4$ balances the dataset; the red arrows show signed deviations $-2, 0, +2$. Squaring them, dividing by $n - 1 = 2$, and taking the square root gives $s = 2$.
Why We Square Deviations and Divide by $n - 1$
If you simply averaged the raw deviations $(x_i - \bar{x})$, positives and negatives would always cancel to $0$!
- Compute the sample mean $\bar{x} = \frac{1}{n}\sum_{i=1}^n x_i$.
- Find each deviation $(x_i - \bar{x})$ and square it so negatives don't cancel positives: $(x_i - \bar{x})^2$.
- Divide the sum of squared deviations by $n - 1$ (Bessel's correction) to get an unbiased estimate of sample variance $s^2$.
- Take the square root to return from squared units back to original data units: $s = \sqrt{\frac{1}{n-1}\sum (x_i - \bar{x})^2}$.
Sample vs. Population & Sensitivity
Use when your data is a sample drawn from a larger population (most real-world problems).
Use ONLY when you possess every single value of the entire population: $\sigma = \sqrt{\frac{1}{N}\sum(x_i - \mu)^2}$.
Variance is $s^2$ (squared units); Standard Deviation is $s = \sqrt{s^2}$ (original units).
Because deviations are squared, both $\bar{x}$ and $s$ are pulled strongly by outliers (unlike median and IQR).
Step-by-Step Worked Examples
Example 1: Computing Sample Mean and SD Step by Step
- Mean: $\bar{x} = \frac{4 + 6 + 8 + 10 + 12}{5} = \frac{40}{5} = 8$.
- Squared deviations from $8$: $(-4)^2 + (-2)^2 + 0^2 + 2^2 + 4^2 = 16 + 4 + 0 + 4 + 16 = 40$.
- Divide by $n - 1 = 4$: $s^2 = \frac{40}{4} = 10 \Rightarrow s = \sqrt{10} \approx 3.16$.
Example 2: Effect of Adding a Constant to Every Value
- The mean shifts up by $5$: new $\bar{x} = 72 + 5 = 77$.
- The spread between scores does NOT change: new $s = 6$.
Common Mistakes to Avoid
Mistake 1: Dividing by $n$ Instead of $n - 1$ for a Sample
Why: Because $\bar{x}$ is estimated from the sample itself, dividing by $n$ systematically underestimates the true population spread.
Mistake 2: Stopping at Variance $s^2$ Without Taking the Square Root
Why: Variance is in squared units (like $\text{cm}^2$); standard deviation restores original units ($\text{cm}$).
Frequently Asked Questions
Can standard deviation ever be negative?
No! It is a square root of a sum of squares, so $s \ge 0$. It equals $0$ only when every single data value is identical.
Why do we divide by $n - 1$?
Once you know $\bar{x}$ and the first $n - 1$ values, the last value is forced—so there are only $n - 1$ independent pieces of spread information ('degrees of freedom').
What happens to $s$ if every value is multiplied by $3$?
Both the mean $\bar{x}$ and standard deviation $s$ multiply by $3$ (while variance $s^2$ multiplies by $9$).