MathPath
Grades 1–13 Math Hub
Grades 8–13 · Statistics · Formula Deep Dive

Sample Mean & Standard Deviation: Visual & Examples

The sample mean $\bar{x}$ locates the balance point (center) of your data, while the sample standard deviation $s$ measures the typical distance that data points spread out from that center.

$$\bar{x} = \frac{1}{n}\sum_{i=1}^n x_i, \qquad s = \sqrt{\frac{1}{n-1}\sum_{i=1}^n (x_i - \bar{x})^2}$$

Variables: $n$ = sample size; divide by $n-1$ (Bessel's correction) for sample standard deviation $s$.

When to use: Measuring the center ($\bar{x}$) and spread ($s$) of a dataset.

Center ($\bar{x}$) and Deviations ($x_i - \bar{x}$) for $\{2, 4, 6\}$

1234567Mean x̄ = 4−2+2Sample SD s = √[(4 + 0 + 4) / 2] = 2

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$!

  1. Compute the sample mean $\bar{x} = \frac{1}{n}\sum_{i=1}^n x_i$.
  2. Find each deviation $(x_i - \bar{x})$ and square it so negatives don't cancel positives: $(x_i - \bar{x})^2$.
  3. Divide the sum of squared deviations by $n - 1$ (Bessel's correction) to get an unbiased estimate of sample variance $s^2$.
  4. 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

Sample SD ($s$, divide by $n - 1$)

Use when your data is a sample drawn from a larger population (most real-world problems).

Population SD ($\sigma$, divide by $N$)

Use ONLY when you possess every single value of the entire population: $\sigma = \sqrt{\frac{1}{N}\sum(x_i - \mu)^2}$.

Variance vs. Standard Deviation

Variance is $s^2$ (squared units); Standard Deviation is $s = \sqrt{s^2}$ (original units).

Outlier Sensitivity

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

Problem: Find $\bar{x}$ and sample standard deviation $s$ for the dataset $\{4, 6, 8, 10, 12\}$.
  1. Mean: $\bar{x} = \frac{4 + 6 + 8 + 10 + 12}{5} = \frac{40}{5} = 8$.
  2. Squared deviations from $8$: $(-4)^2 + (-2)^2 + 0^2 + 2^2 + 4^2 = 16 + 4 + 0 + 4 + 16 = 40$.
  3. 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

Problem: If every test score in a class ($\bar{x} = 72, s = 6$) receives $+5$ bonus points, what are the new $\bar{x}$ and $s$?
  1. The mean shifts up by $5$: new $\bar{x} = 72 + 5 = 77$.
  2. 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

✗ Wrong: Dividing $\sum(x_i - \bar{x})^2$ by $5$ instead of $4$ for a sample of size $5$.
✓ Correct: For a **sample**, divide by $n - 1$ (degrees of freedom).

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

✗ Wrong: Reporting $s = 10$ instead of $\sqrt{10} \approx 3.16$.
✓ Correct: Always take the square root at the final step to get standard deviation $s$.

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$).

Practice & Related Resources

Apply Sample Mean & Standard Deviation on interactive problems, printable PDF worksheets, and calculators.

Mean, Median & Std Dev Calculator →Z-Score Formula →Statistics Worksheets →All Statistics Formulas → ← Back to Statistics Formulas Cheat Sheet