NOETRION

Choose a topic

LESSON 4 OF 9 · Python & data foundations
STATISTICS · 5 MIN READ

Mean or median? A five-number example with an outlier

See why one unusual value can shift the average and how to choose a useful summary.

Suppose five journeys to campus took 10, 11, 12, 12, and 55 minutes. What should you report as the usual travel time? The mean is 20 minutes; the median is 12. Both are calculated correctly, but they answer different questions. Choosing responsibly starts with the decision you want the summary to support.

This guide uses synthetic travel times to make the arithmetic inspectable. The values do not describe a transport study. We will also explain why an unusually large observation deserves investigation rather than automatic deletion.

Calculate both summaries by hand

The arithmetic mean distributes the total equally across observations. Here the total is 10 + 11 + 12 + 12 + 55 = 100 minutes. Divide by five journeys to get 100 / 5 = 20. The mean is useful when the total burden matters: five journeys averaging 20 minutes consumed 100 minutes altogether.

The median uses position in sorted data. With five values, the third value is the middle one, so the median is 12. If you change only the largest value from 55 to 100, that middle position remains 12 even though the mean rises to 29. The NIST guide to measures of location explains why location measures respond differently to a distribution's shape.

Original arithmetic comparison, in minutes
DatasetTotalMeanMedian
10, 11, 12, 12, 551002012
10, 11, 12, 12, 1001452912
10, 11, 12, 124511.2511.5

The last row also shows the even-number case. After sorting four values, the conventional median is the mean of the two middle values: (11 + 12) / 2 = 11.5. A median need not be one of the observed values.

Choose according to the question

Match the summary to the decision
QuestionUseful starting summaryAdditional information needed
How much time did all journeys consume?Total and meanNumber of journeys
What did a typical journey look like?MedianRange and distribution
How late could I arrive on a difficult day?Tail observations or a suitable percentileMore data and causes of delays
Did this route improve after a change?Comparable before/after summariesSame conditions, dates, and sampling process

A median of 12 does not mean you can confidently leave 12 minutes before class. Half the sample lies at or above the median, and this tiny dataset cannot estimate rare delays reliably. A planning decision also needs waiting time, transfers, and the cost of arriving late.

The mean remains valuable when extreme observations are part of the process. A delivery business cannot ignore a costly delay just because it was unusual: that delay still used staff time and affected customers. The goal is to preserve the question each number answers.

Investigate an outlier before excluding it

The 55-minute journey might reflect a traffic disruption, a stop on the way, a different route, or a typing error. These explanations require different actions. A confirmed typo should be corrected with a record of the correction. A legitimate disrupted journey should normally remain in an analysis of actual journey experience.

The NIST discussion of outliers distinguishes identifying an unusual observation from deciding how to handle it. Do not remove a value solely because its removal gives a more attractive average.

Notice unusual valueCheck its originIdentify the analysis goalExplain any change
Original teaching diagram: an outlier flag is a prompt to investigate, not permission to delete.

If your question is specifically about uninterrupted journeys, define that category before comparing routes, document which records qualify, and report exclusions. You can show both all-journey and uninterrupted-journey results. That makes the analytical choice visible instead of quietly changing the dataset.

Verify the arithmetic in Python

from statistics import mean, median

times = [10, 11, 12, 12, 55]
print("Journeys:", len(times))
print("Total minutes:", sum(times))
print("Mean minutes:", mean(times))
print("Median minutes:", median(times))
print("Range:", min(times), "to", max(times))

The expected output includes five journeys, total 100, mean 20, median 12, and a range from 10 to 55. Python's statistics module provides these central-location functions. Check that values are numeric and represent the same unit before calling them. Converting hours and minutes into one consistent unit is part of the analysis, not optional cleanup.

Write a useful result in one paragraph

A defensible summary is: “Across five recorded journeys, the median was 12 minutes and the mean was 20 minutes. Four journeys took 10–12 minutes; one took 55. The longer journey was retained because the report describes actual travel time. This small sample does not establish a reliable late-arrival allowance.”

That paragraph gives sample size, two complementary summaries, the unusual observation, the inclusion rule, and a limitation. It is more informative than choosing one statistic and calling it the correct average.

Practice

For 4, 5, 6, 25, calculate the mean and median. Then explain whether you would delete 25 if it represented a genuine unusually long support call.

Check your answer

The total is 40, so the mean is 10. The middle values are 5 and 6, giving median 5.5. A genuine long call belongs in an analysis of total support workload. You can investigate its cause or report a separate category without erasing it.

Sources and further reading

Source links checked October 13, 2026. Worked examples are original teaching examples; they are not research findings or product benchmarks.

Check your understanding

For 10, 11, 12, 12, 55, which is the median?

Choose one answer