Counting & Probability

Mean, Median, Mode and Range

The mean is the sum of the values divided by how many there are, xˉ=∑xin\bar{x}=\frac{\sum x_i}{n}. The median is the middle value of the sorted list, the mode is the most frequent value, and the range is the maximum minus the minimum.

xˉ=x1+x2+⋯+xnn\bar{x}=\frac{x_1+x_2+\cdots+x_n}{n}

Try it with your numbers

Show every step

Mean, median and mode each answer “what is typical?” in a different way, and the range answers “how spread out is it?”. The sections below cover the standard method, then the places where students lose points: even-sized lists, negatives, frequency tables, ties for the mode, and choosing between the mean and the median.

How do you find the mean, median, mode and range?

Take the data 14,5,8,5,11,5,1514, 5, 8, 5, 11, 5, 15. Sort it first, because the median and the range both depend on order and sorting also makes repeats easy to spot.

  1. Sort: 5,5,5,8,11,14,155, 5, 5, 8, 11, 14, 15.
  2. Mean: add everything and divide by the count.
  3. Median: with n=7n=7 values, take the 4th.
  4. Mode: the value that repeats most.
  5. Range: largest minus smallest.

xˉ=5+5+5+8+11+14+157=637=9\bar{x}=\frac{5+5+5+8+11+14+15}{7}=\frac{63}{7}=9

The 4th value of the sorted list is 88, so the median is 88. The value 55 appears three times, so the mode is 55. The range is 15−5=1015-5=10. Notice that the three centers disagree (99, 88, 55). That disagreement is information: the data has a longer tail on the high side.

The range is always one number, never “5 to 15”. It also uses only the two extreme values, so two data sets can share a range of 1010 and look nothing alike. When you need a measure of spread that uses every value, move to standard deviation.

Quick check

Find the median and range of 14,3,9,3,1114, 3, 9, 3, 11.

Why the mean is the balance point of a data set

Picture each value as an equal weight on a number line. The mean is the point where the line balances. Algebra says the same thing: since ∑xi=nxˉ\sum x_i = n\bar{x}, the distances from the mean cancel exactly.

∑i=1n(xi−xˉ)=0\sum_{i=1}^{n}(x_i-\bar{x})=0

Check with 1,2,91, 2, 9. The mean is 44, and the deviations are −3,−2,+5-3, -2, +5, which add to 00. This is why one huge value drags the mean so hard: the other values must collectively sit on the other side to balance it.

Each measure of center also minimizes a different kind of miss. The mean minimizes the total squared distance to the data, the median minimizes the total absolute distance, and the mode minimizes the number of values you miss entirely. For 1,2,91, 2, 9, the total absolute distance from the median 22 is 1+0+7=81+0+7=8, while from the mean 44 it is 3+2+5=103+2+5=10. The median wins on that scoreboard, and the mean wins on the squared one.

Try this: Pick any five numbers, find their mean, subtract the mean from each number, and add the five differences. You should get exactly 00. If you do not, recheck the mean.

There is a useful shortcut when the values are evenly spaced, such as 5,8,11,14,175, 8, 11, 14, 17. The mean equals the median and equals first+last2=11\frac{\text{first}+\text{last}}{2}=11. Multiply that mean by the count and you have the sum, which is exactly the idea behind the arithmetic series formula.

How to find the median with negatives or an even count

With nn sorted values, the median sits at position n+12\frac{n+1}{2}. When nn is even, that position lands halfway between two values, so you average them.

Position, not value

For n=7n=7 the median is the 4th value. For n=6n=6 the position is 3.53.5, halfway between the 3rd and 4th values. Counting positions is faster and safer than crossing numbers off from both ends.

Take the temperatures −6,3,−2,8,−6,1-6, 3, -2, 8, -6, 1. Sort them: −6,−6,−2,1,3,8-6, -6, -2, 1, 3, 8. The mean first:

xˉ=−6+3−2+8−6+16=−26=−13\bar{x}=\frac{-6+3-2+8-6+1}{6}=\frac{-2}{6}=-\frac{1}{3}

The middle pair is −2-2 and 11, so the median is −2+12=−12\frac{-2+1}{2}=-\frac{1}{2}. The mode is −6-6. The range is 8−(−6)=148-(-6)=14.

Two traps live here. Sorting negatives backward is the first: −6-6 is smaller than −2-2, so it comes first. Subtracting a negative is the second: the range is 8−(−6)8-(-6), which is 8+68+6, not 22. With decimals or fractions, convert everything to the same form before sorting. 34\frac{3}{4}, 0.80.8 and 23\frac{2}{3} sort correctly as 0.667,0.75,0.80.667, 0.75, 0.8. Also remember that an even-count median usually is not one of your data values, and that is fine.

Mean, median and mode from a frequency table

Balance beam showing class A of 10 students and class B of 30 students balancing at a combined mean of 87.5
Class B has three times the students, so the balance point sits at 87.5, not the simple average 85.

A frequency table compresses repeated values. Suppose a survey of 2020 households records pets per household: 00 pets in 55 homes, 11 pet in 88, 22 pets in 44, and 33 pets in 33. Multiply each value by its frequency, add, and divide by the total frequency:

xˉ=∑fx∑f=0(5)+1(8)+2(4)+3(3)20=2520=1.25\bar{x}=\frac{\sum fx}{\sum f}=\frac{0(5)+1(8)+2(4)+3(3)}{20}=\frac{25}{20}=1.25

The mode is the value with the biggest frequency, which is 11 pet. For the median, there are 2020 values, so average the 10th and 11th. The running counts are 55 (for 00) and 1313 (for 11), so both the 10th and 11th values are 11, and the median is 11. The range is 3−0=33-0=3. The most common slip is dividing by the number of table rows (44) instead of the total frequency (2020).

A frequency table is really a weighted average, where each value is weighted by how often it occurs. That same idea explains the most expensive mistake with group data.

Never average the averages

Class A has 1010 students with mean 8080, and class B has 3030 students with mean 9090. The combined mean is 800+270040=87.5\frac{800+2700}{40}=87.5, not 8585, because class B counts three times as much.

For grouped data in class intervals, the exact median and mode cannot be recovered. You can only name the median class and the modal class, and estimate the mean using interval midpoints.

Can a data set have two modes or no mode?

Yes to both. In 2,5,5,7,9,9,112, 5, 5, 7, 9, 9, 11, the values 55 and 99 tie, so the set is bimodal and you report both. In 3,8,1,63, 8, 1, 6 every value appears once. Most textbooks say there is no mode, though some say every value is a mode, so follow your course’s convention. A single repeated value, as in 4,4,4,44, 4, 4, 4, has the mode 44.

The mode is the only one of the three that works for categories. You cannot average favorite colors or find the middle shirt size, but you can say which appears most. It is also the measure that exposes two groups hiding in one data set. If a shop’s customers are mostly children’s sizes and mostly adult sizes, the mean lands on a size almost nobody buys, while the two modes describe the real market.

With continuous measurements such as exact heights, repeats are rare, so the mode is usually meaningless unless the data is grouped into intervals. In probability, the mode of observed outcomes is your best guess for the most likely result, a connection worth following up in basic probability.

Quick check

Find all modes of 2,5,5,7,9,9,112, 5, 5, 7, 9, 9, 11.

How to find a missing value when the mean is given

The mean fixes the total: mean×n=sum\text{mean}\times n=\text{sum}. That turns “what score do I need?” into one subtraction. Your test scores are 82,90,76,8882, 90, 76, 88, and you want a mean of 8585 over five tests.

5×85=425,82+90+76+88=336,425−336=895\times 85=425,\qquad 82+90+76+88=336,\qquad 425-336=89

You need an 8989 on the fifth test. Always sanity-check the answer against what is possible. If the required score came out above the maximum, the target is unreachable.

Missing-value problems with the median work differently, because position matters. If 3,7,x,103, 7, x, 10 has median 88, assume xx falls between 77 and 1010. Then the median is 7+x2=8\frac{7+x}{2}=8, so x=9x=9. Verify the assumption: 99 does sit between 77 and 1010, so the answer is consistent. If it had not, you would try the other ordering.

Adding a new value to a data set works the same way. Eight numbers with mean 1414 have total 112112. To raise the mean to 1515 with a ninth number, the new total must be 135135, so the ninth number is 2323.

Mean vs median: which one fits your data?

Dot plot of five salaries showing the mean of 80 far from four employees while the median is 35
With salaries 30, 32, 35, 38 and 265 thousand, the mean lands in an empty gap and the median stays with the group.

The mean uses the size of every value, so it responds to outliers. The median uses only position, so it does not. A firm pays salaries (in thousands of dollars) of 30,32,35,38,26530, 32, 35, 38, 265. The mean is 4005=80\frac{400}{5}=80, a figure that describes no actual employee. The median is 3535, which describes the typical one.

Measure Uses Outlier effect Best for
Mean Every value Large Symmetric numeric data, totals
Median Position only Small Skewed data such as income
Mode Frequency only None Categories, finding peaks

In right-skewed data (a long tail of high values) the usual order is mode, then median, then mean, from smallest to largest. In left-skewed data it reverses. The order is typical, not guaranteed, but it gives a fast diagnostic: if the mean and median are far apart, the data is skewed, and the median is the safer summary.

The median is not always superior. For small, symmetric data with no outliers it throws away information the mean uses, and only the mean supports further calculations such as standard deviation. When unsure, compute both and report both.

Quick check

For 2,3,3,4,482, 3, 3, 4, 48, find the mean and the median. Which describes a typical value better?

How do you check a mean, median and mode answer?

Four quick tests catch most errors before you hand in the work:

  • The mean must lie between the smallest and largest values. If it does not, the addition slipped.
  • Multiply your mean by nn. You should get back the original sum.
  • For an odd count, the median must be an actual data value, and the same number of values must sit on each side of it.
  • The range must equal max minus min, so it can never be negative.

A fifth check is a mental shortcut for big numbers. Shifting every value by the same amount shifts the mean, median and mode by that amount and leaves the range unchanged. For 1203,1208,1205,12041203, 1208, 1205, 1204, subtract 12001200 to get 3,8,5,43, 8, 5, 4. The mean of those is 204=5\frac{20}{4}=5, so the original mean is 12051205. Multiplying every value by kk multiplies the mean, median and mode by kk and the range by ∣k∣|k|, which makes unit conversions painless.

Where mean, median and mode show up in other math

The mean quietly drives several algebra topics. The line of best fit always passes through the point (xˉ,yˉ)(\bar{x},\bar{y}), so once you know its slope you can write the equation in point-slope form and rearrange it to slope-intercept form. For ax2+bx+c=0ax^2+bx+c=0, the mean of the two roots is −b2a-\frac{b}{2a}, which is also the xx-coordinate of the vertex. You can test that on quadratic formula practice problems.

There is also a mean for growth rates, the geometric mean x1x2⋯xnn\sqrt[n]{x_1x_2\cdots x_n}. Taking logarithms turns it into an ordinary mean, since the log of a product becomes a sum, as the logarithm rules show. For 22 and 88, the mean of log⁡22=1\log_2 2=1 and log⁡28=3\log_2 8=3 is 22, and 22=42^2=4 is the geometric mean.

In statistics, the mean of a sample is itself a random quantity. Choosing 33 scores from 1010 can be done in (103)=120\binom{10}{3}=120 ways (the counting is covered under combinations), and each sample has its own mean. How tightly those 120120 means cluster is what hypothesis tests measure. The same pattern appears in probability, where the expected value of a fair die, 3.53.5, is just the mean of 11 through 66.

Practice problems

0 of 5 solved

  1. Find the mean of 6,9,4,11,56, 9, 4, 11, 5.

  2. Find the median and mode of 12,7,9,7,15,1012, 7, 9, 7, 15, 10.

  3. Find the mean and range of 2.5,4,1.5,6,32.5, 4, 1.5, 6, 3.

  4. Five numbers have mean 1212. Four of them are 8,15,11,208, 15, 11, 20. Find the fifth number.

  5. The scores 1,2,3,4,51, 2, 3, 4, 5 occur 3,6,5,4,23, 6, 5, 4, 2 times. Find the mean, median and mode.

Common questions

What is the difference between mean, median and mode?

The mean is the total divided by the count, the median is the middle value of the sorted list, and the mode is the value that appears most often. They answer the same question, what is typical, in three different ways, and they only agree when the data is fairly symmetric.

How do you find the median when there are two middle numbers?

Sort the list, take the two middle values and average them. For 4,6,8,104, 6, 8, 10 the middle pair is 66 and 88, so the median is 77, even though 77 is not in the list.

Can a data set have more than one mode, or none?

Yes to both. Two or more values can tie for the highest frequency, which gives a bimodal or multimodal set. If every value appears the same number of times, most textbooks say there is no mode.

Is the average the mean or the median?

In everyday speech and most school problems, average means the mean. Statisticians use average loosely for any measure of center, so in news reports about income or house prices check whether the figure is a mean or a median.

When is the median better than the mean?

Use the median when the data is skewed or has outliers, such as incomes, house prices or waiting times. A few extreme values pull the mean toward them but barely move the median.

Is the range a measure of center or spread?

The range, highest minus lowest, measures spread. It says nothing about the center, and it depends on only two values, so one outlier can inflate it.

Up next