EXAMPLE 10 Calculating the Median

Since we’re exploring the gas mileage cars get on the road, you might have noticed the connection that just as a median divides a road into two halves (with opposite directions of travel), a median divides a dataset into two halves! To find the median city mileage for the 2015 midsized cars, arrange the data in increasing order:

15 16 17 20 21 21 22 23 25 26 30 58

The median is the observation that is , or seventh from the smallest, the bold 21. Because the dataset is small, you can find this by eye—there are six observations to the left and six to the right.

What happens if we drop the Toyota Prius? The remaining 12 gas-powered cars have the following city mileages:

15 16 17 20 21 21 22 23 25 26 30

Because the number of observations is even, there is no single center observation. [In this case, .] There is a center pair of observations—the sixth and seventh observations in the ordered list, which in this case are both 21. There are five observations to the left of the pair of 21s and five to the right. The median is the mean of the center pair, which is .