Back to the Data Science roadmap

Descriptive Statistics · Distributions, mean, and median

Read a frequency plot, calculate two measures of center, and explain which measure answers a given question.

Before you start

You should be able to sort numbers, add and divide them, and read a horizontal number line.

Read the distribution before summarizing it

A distribution shows which values occur and how frequently they occur. A dot plot puts one dot per observation on a number line and stacks repeated values. For n ≥ 1 numerical observations with the same units, the arithmetic mean is the sum divided by n. The median is the middle sorted value for odd n, or the average of the two middle sorted values for even n. Both have the units of the observations.

OpenStax · Measures of the center

Dot plot of five wait times One observation at 2 minutes, two at 4, one at 6, and one at 14. The median is 4 minutes and the mean is 6 minutes. 24614
Wait time in minutes. The stack at 4 represents two observations. The gap before 14 is easier to see in the plot than in either summary alone.

Why the mean moves

If one of n observations changes by d, the sum changes by d, so the mean changes by d/n. The median depends on the middle ranks. Changing the largest value while it remains largest leaves the median unchanged when n ≥ 3. Use the mean to summarize total per observation, or the median to describe the middle observation in a skewed sample. Neither alone describes the spread.

UC Berkeley · Properties of the mean

Worked examples

  1. For 2, 4, 4, 6, 14, the sum is 30. Divide by 5 for a mean of 6. The third sorted value is 4. Replace 14 with 24 and the mean rises by 10/5 = 2 to 8, while the median stays 4.
  2. Sort 9, 1, 5, 3 to get 1, 3, 5, 9. The median is (3 + 5)/2 = 4, although 4 was not observed. The mean is 18/4 = 4.5.

Common mistakes

Sort before finding the median. Keep repetitions when counting observations. Investigate a large value before deciding whether it is a data error.

Practice

  1. Find the mean and median of 4, 2, 4.
  2. For 2, 4, 4, 6, 14, predict the change in mean if 14 becomes 19. What happens to the median?
  3. Two queues have waits 4, 4, 4 and 0, 4, 8. Can you tell which varies more from their centers?
Worked practice solutions
  1. The sorted values are 2, 4, 4, so the median is 4. The mean is (2+4+4)/3 = 10/3.
  2. The sum rises by 5 across five observations, so the mean rises by 1 to 7. The third value stays 4.
  3. Both have mean and median 4. The first has range 4−4 = 0 and the second 8−0 = 8. The centers alone do not reveal this difference.

Assessment · Open book · 16 points

Open book: use books, lesson notes, cited readings, calculators, and relevant free software. Explain your own reasoning, assumptions, units, and checks; identify references or software you use. Attempt the questions before opening the answer key. Suggested study time: 40–60 minutes; this is a self-study guide, not a timed restriction.

For wait times 8, 2, 4, 4 minutes, find mean and median (4 points). Replace 8 with 14 and recompute both (4). Which center better describes the middle-ranked waits here, and why (2)?

Application and reasoning · 6 points

Group A has 5 waits with mean 4 min; group B has 15 with mean 8 min. Compute the combined mean (2). Explain why averaging the two means equally gives the wrong answer (2). Construct two nonnegative five-observation datasets with mean 4 but different medians, showing why a mean alone cannot determine the median (2).

Complete answer key and scoring rubric
  1. Two points for mean 18/4 = 4.5 min and two for median (4+4)/2 = 4 min.
  2. Two points for new mean 24/4 = 6 min and two for unchanged median 4 min.
  3. One point for choosing the median and one for explaining that the two middle ranks are unchanged by the larger maximum.

Application and reasoning · 6 points

Total time 5·4+15·8=140 min across 20 observations gives 7 min (2). Equal weighting yields 6 and treats unequal groups as equally large; weights should be 1/4,3/4 (2). Datasets (0,0,0,10,10) and (4,4,4,4,4) both have mean 4 but medians 0 and 4 (1 construction, 1 verification).

Scoring: existing questions 10 + application problem 6 = 16 points. Award the stated method and reasoning marks, not only final answers.

Wait-time lab · Change one observation

Test how an extreme value changes the mean and median.

Free tool built into this page. Use it in your browser without an account or download.

Procedure

Keep 2, 4, 4, and 6 minutes fixed. Predict both centers, then run the activity with a fifth wait of 14, 24, and 4 minutes. Which center moves? Try 0 minutes and explain why sorting still gives a median of 4.

Expected results and answer check

The means for 14, 24, 4, and 0 are 6, 8, 4, and 3.2 minutes. The median is 4 in each case because the third sorted position stays at 4. Moving 14 to 24 adds 10 minutes across five observations, increasing the mean by 2.

These synthetic data illustrate sensitivity. To estimate typical waits at a real service, collect representative observations across times and report how they were sampled.