Unit 4, lesson 39

Mean, Median and Weighted Averages

How to compute a mean from totals and counts, find a median from ordered positions, weight group means by group sizes, and predict how one extreme value moves the mean and the median.

  • Theory part 77
  • Practice part 78
  • Data and Probability

Theory, part 77

Practice, part 78

Two classes take the same quiz. One class of 20 averages 80 points and the other class of 30 averages 70. It is tempting to say the combined average is 75, right in the middle. But the larger class pulls harder, and the true combined average is 74. Getting that right comes down to one habit, which is to think in totals and counts rather than in averages alone.

Key terms

Mean

Definition The mean of nn numbers x1,x2,…,xnx_1, x_2, \dots, x_n is their sum divided by how many there are,

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

It is also called the arithmetic mean or the average.

In plain words Add everything up and share it out equally. The mean is the amount each observation would have if the total were split evenly.

Example For the five values 3,7,8,10,123, 7, 8, 10, 12 the sum is 4040, so the mean is 40/5=840/5 = 8.

Total

Definition The total of a data set is the sum of all its observations. From the definition of the mean, for nn observations,

total=n⋅xˉ.\text{total} = n \cdot \bar{x}.

This turns any statement about a mean into a statement about a total, which is often the easier quantity to work with.

In plain words If you know the average and the count, you know the sum. When values are added or removed, update the total and the count, then divide again.

Example A student’s five quiz scores have mean 8282, so their total is 5⋅82=4105 \cdot 82 = 410. What sixth score would raise the mean to 8484? Six scores with mean 8484 need a total of 6⋅84=5046 \cdot 84 = 504, so the sixth score must be

504−410=94.504 - 410 = 94.

Median

Definition The median of a data set is found by sorting the nn values from least to greatest. If nn is odd, the median is the value in position n+12\frac{n+1}{2}. If nn is even, it is the mean of the values in positions n2\frac{n}{2} and n2+1\frac{n}{2} + 1. At least half of the values are less than or equal to the median and at least half are greater than or equal to it.

In plain words Line the values up in order and take the middle one, or the average of the middle two when there is no single middle.

Example The values 12,3,9,7,15,412, 3, 9, 7, 15, 4 must be sorted first, giving 3,4,7,9,12,153, 4, 7, 9, 12, 15. There are six values, so the median is the mean of the third and fourth,

7+92=8.\frac{7 + 9}{2} = 8.

Taking the middle of the unsorted list would give 99 or 77, both wrong.

Frequency tables

Definition In a frequency table each distinct value xix_i appears once with its frequency fif_i, the number of observations equal to xix_i. The number of observations is n=f1+f2+⋯+fkn = f_1 + f_2 + \dots + f_k, and the mean is

xˉ=f1x1+f2x2+⋯+fkxkf1+f2+⋯+fk.\bar{x} = \frac{f_1 x_1 + f_2 x_2 + \dots + f_k x_k}{f_1 + f_2 + \dots + f_k}.

The median is found by counting through the frequencies to the middle position.

In plain words Each value counts as many times as it occurs. Multiply each value by its frequency to get the total, and divide by the number of observations, not by the number of rows.

Example Twenty people rate a film from 11 to 44.

Rating11223344
Frequency44667733

The total is 4+12+21+12=494 + 12 + 21 + 12 = 49, so the mean is 49/20=2.4549/20 = 2.45. For the median, positions 11 to 44 are ratings of 11, positions 55 to 1010 are 22 and positions 1111 to 1717 are 33. The tenth value is 22 and the eleventh is 33, so the median is 2.52.5.

Weighted mean

Definition If numbers x1,…,xkx_1, \dots, x_k have positive weights w1,…,wkw_1, \dots, w_k, their weighted mean is

w1x1+w2x2+⋯+wkxkw1+w2+⋯+wk.\frac{w_1 x_1 + w_2 x_2 + \dots + w_k x_k}{w_1 + w_2 + \dots + w_k}.

When groups of sizes n1,…,nkn_1, \dots, n_k have means xˉ1,…,xˉk\bar{x}_1, \dots, \bar{x}_k, the mean of all the observations together is the weighted mean of the group means with the group sizes as weights. The plain average of the group means is correct only when every group has the same size.

In plain words Bigger groups count for more. Rebuild each group’s total, add the totals, and divide by everyone.

Example A class of 2020 has mean 8080 and a class of 3030 has mean 7070. The totals are 16001600 and 21002100, so the combined mean is

1600+210020+30=370050=74.\frac{1600 + 2100}{20 + 30} = \frac{3700}{50} = 74.

The unweighted guess of 7575 treats the two classes as if they were the same size. The true answer sits closer to 7070 because more students scored around 7070.

Outlier

Definition An outlier is an observation that lies unusually far from the rest of the data. There is no single universal cutoff. One common rule calls a value an outlier when it is below Q1−1.5⋅IQRQ_1 - 1.5 \cdot \text{IQR} or above Q3+1.5⋅IQRQ_3 + 1.5 \cdot \text{IQR}, where Q1Q_1 and Q3Q_3 are the quartiles and IQR=Q3−Q1\text{IQR} = Q_3 - Q_1. Because the mean uses the size of every value, an outlier can move it a lot. The median depends only on which values sit in the middle positions, so changing an extreme value does not change the median at all as long as that value stays on the same side of the middle values.

In plain words One very large or very small value drags the mean toward it, while the median barely notices. That is why the median is often preferred for data such as incomes or home prices.

Example The eight values 10,12,13,13,14,15,16,1710, 12, 13, 13, 14, 15, 16, 17 have total 110110, mean 13.7513.75 and median 13.513.5. Replace 1717 with 6060. The total becomes 153153 and the mean becomes 153/8=19.125153/8 = 19.125, higher than seven of the eight values. The middle two values are still 1313 and 1414, so the median stays 13.513.5. Taking the quartiles as the medians of the lower four and upper four values of the new data gives Q1=12.5Q_1 = 12.5 and Q3=15.5Q_3 = 15.5, so the upper cutoff is 15.5+1.5⋅3=2015.5 + 1.5 \cdot 3 = 20 and 6060 is an outlier by the common rule.

Check yourself

  1. A survey of 2020 households found 55 households owning 00 pets, 88 owning 11, 44 owning 22 and 33 owning 33. What is the mean number of pets per household? (A) 11 (B) 1.251.25 (C) 1.51.5 (D) 55
Show the answer

The correct choice is (B). The total number of pets is 0⋅5+1⋅8+2⋅4+3⋅3=250 \cdot 5 + 1 \cdot 8 + 2 \cdot 4 + 3 \cdot 3 = 25, and

2520=1.25.\frac{25}{20} = 1.25.

Choice (A) is the median, (C) averages the values 00 to 33 without their frequencies, and (D) averages the frequencies.

  1. The mean of six numbers is 1515. Five of the numbers are 1212, 1818, 99, 2020 and 1414. What is the sixth number?
Show the answer

The answer is 1717. Six numbers with mean 1515 have total 6⋅15=906 \cdot 15 = 90. The five known numbers add to 7373, so the sixth is 90−73=1790 - 73 = 17.

  1. In a survey, 1212 adults slept a mean of 66 hours and 1818 teenagers slept a mean of 99 hours. What is the mean number of hours for all 3030 people? (A) 7.27.2 (B) 7.57.5 (C) 7.87.8 (D) 99
Show the answer

The correct choice is (C). The totals are 12⋅6=7212 \cdot 6 = 72 and 18⋅9=16218 \cdot 9 = 162, so the combined mean is

72+16230=7.8.\frac{72 + 162}{30} = 7.8.

Choice (B) ignores the group sizes, and (A) swaps them, giving the larger weight to the adults. Choice (D) is the mean of the teenagers alone, which leaves out the adults. The answer must lie between 66 and 99, closer to 99 because there are more teenagers.

How this lesson connects