James's Math Hub
Statistics & Probability

Lesson 1 / 13 · 11 min read

Descriptive Statistics

Mean, median, mode, range, variance, and standard deviation.

Measures of center

For a dataset, "center" can mean different things.

Mean (average): sum the values, divide by the count.

xˉ=1ni=1nxi\bar{x} = \frac{1}{n} \sum_{i=1}^n x_i

Median: the middle value when the data is sorted. If nn is even, average the two middle values.

Mode: the value that appears most often. (A dataset can have multiple modes or none.)

Example. Data: {2,4,4,6,9}\{2, 4, 4, 6, 9\}.

  • Mean: (2+4+4+6+9)/5=25/5=5(2+4+4+6+9)/5 = 25/5 = 5
  • Median: middle value is 44
  • Mode: 44 (appears twice)

Mean vs. median — when does it matter?

The mean is sensitive to outliers. The median isn't.

Salaries at a small company: {40k,42k,45k,48k,500k}\{40k, 42k, 45k, 48k, 500k\}.

  • Mean: 135k135k (misleading — only the CEO earns near that)
  • Median: 45k45k (a much more honest sense of the typical employee)

Rule of thumb: use the median when data is skewed or has outliers.

Measures of spread

Range = max − min. Simple but ignores everything in the middle.

Variance (σ2\sigma^2 or s2s^2): average squared distance from the mean.

σ2=1ni=1n(xixˉ)2\sigma^2 = \frac{1}{n}\sum_{i=1}^n (x_i - \bar{x})^2

(For a sample variance you divide by n1n-1 instead of nn — Bessel's correction.)

Standard deviation (σ\sigma or ss): the square root of the variance.

σ=σ2\sigma = \sqrt{\sigma^2}

Standard deviation lives in the same units as the data, which is why it's the spread measure people quote.

A worked example

Data: {2,4,4,4,5,5,7,9}\{2, 4, 4, 4, 5, 5, 7, 9\}. Mean = 55.

xix_ixixˉx_i - \bar{x}(xixˉ)2(x_i - \bar{x})^2
2-39
4-11
4-11
4-11
500
500
724
9416

Sum of squared deviations = 32. Variance (population) = 32/8=432/8 = 4. Standard deviation = 4=2\sqrt{4} = 2.

Key takeaways

  • Mean, median, mode all describe the center — choose based on the data.
  • Mean is pulled around by outliers; median isn't.
  • Standard deviation is the most-used measure of spread.