Computer Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Measures of central tendency and dispersion

Clear, exam-focused notes on measures of central tendency (mean, median, mode) and dispersion (range, variance, standard deviation, MAD), with definitions, derivations, formulas, worked numerical examples, common mistakes and exam tips.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Engineers use measures of central tendency and dispersion to summarise experimental data, sensor readings or performance metrics. These summaries let you compare systems, detect anomalies, choose models in data science and decide whether variability is acceptable in design or testing.

Key ideas

Start from first principles: you have a list of numeric observations x1, x2, ..., xn measured in the same units (for example, marks, seconds, metres). We treat the list either as a population (all items of interest) or a sample (a subset used to estimate population quantities).

  • Population: the complete set of items we care about. Use population formulae when you truly have every observation.
  • Sample: a subset drawn from a larger population. Use sample (unbiased) estimators to estimate population parameters.

Definitions (exact, as used in exams):

  • Mean (arithmetic mean) of n observations x1..xn: the sum divided by n. It is the unique value m that minimises the sum of squared deviations sum (xi - m)^2.

  • Median of an ordered list is the middle value: for odd n it is x_{(n+1)/2}; for even n it is the average of the two middle values x_{(n/2)} and x_{(n/2)+1}. The median minimises the sum of absolute deviations sum |xi - m|.

  • Mode is the observation (or observations) that occur most frequently. A distribution can be unimodal, bimodal or multimodal.

  • Range is max(xi) - min(xi). It measures total spread.

  • Variance measures average squared deviation from the mean. For a population with values x1..xN and population mean μ, population variance is σ^2 = (1/N) sum (xi - μ)^2. For a sample x1..xn with sample mean x̄, the unbiased sample variance is s^2 = (1/(n-1)) sum (xi - x̄)^2. The (n-1) denominator corrects bias when estimating a population variance from a sample (Bessel's correction).

  • Standard deviation is the square root of variance and returns to the original units. Population standard deviation σ = sqrt(σ^2). Sample standard deviation s = sqrt(s^2).

  • Mean Absolute Deviation (MAD) is the average absolute deviation from the mean (or from the median, if stated): MAD = (1/n) sum |xi - x̄|. It is less sensitive to extreme values than variance but less mathematically tractable for algebraic work.

Basic properties and common derivations asked in exams:

  1. Sum of deviations from the sample mean is zero: sum (xi - x̄) = 0. Proof: sum xi - n x̄ = 0 because x̄ = (1/n) sum xi.

  2. Computational (shortcut) formula for variance: expand sum (xi - x̄)^2 = sum xi^2 - n x̄^2. Step-by-step: sum (xi - x̄)^2 = sum (xi^2 - 2 xi x̄ + x̄^2) = sum xi^2 - 2 x̄ sum xi + n x̄^2 = sum xi^2 - 2 x̄ (n x̄) + n x̄^2 = sum xi^2 - n x̄^2.

  3. For a population: σ^2 = E[X^2] - (E[X])^2. For samples the analogous computed numerator is sum xi^2 - n x̄^2.

  4. Robustness: the median is robust to outliers (does not change much if one value is extreme); the mean is not robust (it shifts with outliers). Variance and standard deviation are sensitive to outliers because of squaring.

Diagram instructions often required in exams:

  • To illustrate median and quartiles draw a number line, mark the sorted data points as small vertical ticks, draw a vertical line at the median. For a boxplot: draw a horizontal axis labelled with the variable and its units; draw a rectangle from Q1 to Q3 with a vertical line at the median; draw whiskers to the smallest and largest non-outlier values and mark outliers individually (non-outliers are commonly defined as values within 1.5×IQR of Q1 and Q3).

Formulas

x̄ = (1/n) · Σ_{i=1..n} x_i where x̄ is the sample mean, xi are observations, n is sample size. Units: same as xi. Applies to any finite sample.

median = x_{(k)} (odd n with k=(n+1)/2); median = (x_{(n/2)} + x_{(n/2+1)})/2 (even n) where x_{(i)} denotes the i-th ordered value. Units: same as xi.

mode = value(s) with maximum frequency where frequency counts occurrences. Units: same as xi.

range = max(x_i) - min(x_i) Units: same as xi.

IQR = Q3 - Q1 where Q1 and Q3 are the 25th and 75th percentiles (first and third quartiles). Units: same as xi.

CV = (s / x̄) × 100% coefficient of variation for a sample; dimensionless (percentage). Use only when x̄ > 0.

σ^2 = (1/N) · Σ_{i=1..N} (x_i - μ)^2 where σ^2 is population variance, μ is population mean, N is population size. Units: (units of xi)^2.

s^2 = (1/(n-1)) · Σ_{i=1..n} (x_i - x̄)^2 where s^2 is unbiased sample variance, x̄ is sample mean, n sample size. Units: (units of xi)^2.

σ = sqrt(σ^2) and s = sqrt(s^2) where σ and s are population and sample standard deviations respectively. Units: same as xi.

Σ_{i=1..n} (x_i - x̄) = 0 property of sample mean; no units.

Σ_{i=1..n} (x_i - x̄)^2 = Σ x_i^2 - n·x̄^2 computational formula used to compute variance efficiently.

MAD = (1/n) · Σ_{i=1..n} |x_i - x̄| where MAD is mean absolute deviation. Units: same as xi.

Worked examples

Example 1 — exam scores (marks): compute mean, median, mode, range, sample variance and standard deviation.

Data (marks out of 100): 65, 70, 75, 80, 85 (n = 5). Units: marks.

Step 1: mean formula: x̄ = (1/n) Σ xi = (65 + 70 + 75 + 80 + 85)/5 = 375/5 = 75 marks.

Step 2: median: sort (already sorted). n is odd (5) so median = x_{(3)} = 75 marks.

Step 3: mode: all values appear once → no mode (or multimodal none). State "no unique mode".

Step 4: range = max - min = 85 - 65 = 20 marks.

Step 5: compute deviations and squares:

  • deviations: -10, -5, 0, 5, 10 (marks)
  • squares: 100, 25, 0, 25, 100 (marks^2)
  • Σ (xi - x̄)^2 = 250 marks^2.

Step 6: sample variance s^2 = (1/(n-1)) Σ (xi - x̄)^2 = 250/4 = 62.5 marks^2.

Step 7: sample standard deviation s = sqrt(62.5) = 7.90569415... → 7.91 marks (round to two decimals).

Final answers: mean = 75 marks; median = 75 marks; no unique mode; range = 20 marks; s^2 = 62.5 marks^2; s = 7.91 marks.

Example 2 — effect of an outlier: small timing measurements (seconds)

Data: 10, 12, 11, 13, 100 (n = 5). Units: seconds.

Step 1: mean x̄ = (10 + 12 + 11 + 13 + 100)/5 = 146/5 = 29.2 s.

Step 2: median: sort → 10, 11, 12, 13, 100. Median is x_{(3)} = 12 s.

Step 3: range = 100 - 10 = 90 s.

Step 4: compute deviations from mean and squares:

  • deviations: -19.2, -17.2, -18.2, -16.2, 70.8 (s)
  • squares: 368.64, 295.84, 331.24, 262.44, 5012.64 (s^2)
  • Σ (xi - x̄)^2 = 6270.8 s^2.

Step 5: sample variance s^2 = 6270.8/(5-1) = 6270.8/4 = 1567.7 s^2.

Step 6: sample standard deviation s = sqrt(1567.7) = 39.594... → 39.59 s.

Compare mean vs median: mean = 29.2 s shifted heavily by the outlier, median = 12 s remains representative of the central cluster. This demonstrates robustness of the median.

Common mistakes

  • For even n, choosing one middle value instead of averaging the two middle values for median.
  • Confusing population and sample formulas; not stating which one is used.
  • Using mean where median is required for a robust summary when outliers exist (or vice versa without justification).
  • Algebra errors in expanding Σ (xi - x̄)^2; forgetting the identity Σ xi = n x̄.
  • In programming: integer division (e.g., in some languages) when computing mean with integers; forgetting to convert to float.

For your exam

Kinds of questions you will see:

  • Definitions: give precise definitions of mean, median, mode, variance, standard deviation, MAD. Include units and assumptions (population vs sample).
  • Short notes: discuss robustness or interpretation, e.g., “Why median is better than mean for skewed data?”
  • Derivations: prove Σ (xi - x̄) = 0, derive computational variance formula Σ (xi - x̄)^2 = Σ xi^2 - n x̄^2, show Var(X) = E[X^2] - (E[X])^2.
  • Numericals: compute mean, median, mode, range, s^2, s from given data — show steps and units.
  • Diagrams: draw a boxplot or number-line showing median and whiskers; label axes and quartiles.

What a full-marks answer includes:

  • State whether data are sample or population and choose correct formula.
  • Show all steps (sum, mean, deviations, squares, sums) with units carried through.
  • Give final numbers with units and reasonable rounding. If asked, comment on robustness or what the dispersion value implies.
  • For derivations, show algebra steps and explicitly state applied identities like Σ xi = n x̄.

Quick check

  1. Define the arithmetic mean for a sample and state one property of it.
  2. Give the formula for the unbiased sample variance.
  3. Which measure (mean or median) is less affected by a single very large outlier?

Answers: 1) x̄ = (1/n) Σ xi; property: Σ (xi - x̄) = 0. 2) s^2 = (1/(n-1)) Σ (xi - x̄)^2. 3) Median.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?