Previous Up Next

9.1.5  The median: median

Although the average of a list of numbers typically means the mean, there are other notions of “average”. Another such notion is the median; the median of a list of numbers is the middle number when they are listed in numeric order. For example, the median of the list [1,2,5,7,20] is simply 5. If the length of a list of numbers is even, so there isn’t a middle number, the median is then the mean of the two middle numbers; for example, the median of [1,2,5,7,20,21] is (5+7)/2 = 6.

The median function finds the median of a list.


Examples.


Previous Up Next