In the most common case, the data set is a list of numbers. The average of a list of numbers is a single number intended to typify the numbers in the list. If all the numbers in the list are the same, then this number should be used. If the numbers are not the same, the average is calculated by combining the numbers from the list in a specific way and computing a single number as being the average of the list.
Many different descriptive statistics can be chosen as a measure of the central tendency of the data items. These include the arithmetic mean, the median, and the mode. Other statistics, such as the standard deviation and the range, are called measures of spread and describe how spread out the data is.
The most common statistic is the arithmetic mean, but depending on the nature of the data other types of central tendency may be more appropriate. For example, the median is used most often when the distribution of the values is skewed with a small number of very high or low values, as seen with house prices or incomes. It is also used when extreme values are likely to be anomalous or less reliable than the other values (e.g. as a result of measurement error), because the median takes less account of extreme values than the mean does.
The arithmetic mean, or simply the mean or average when the context is clear, is the central tendency of a collection of numbers taken as the sum of the numbers divided by the size of the collection.
The median is the middle number of the group when they are ranked in order. (If there are an even number of numbers, the mean of the middle two is taken.)
Thus to find the median, order the list according to its elements' magnitude and then repeatedly remove the pair consisting of the highest and lowest values until either one or two values are left. If exactly one value is left, it is the median; if two values, the median is the arithmetic mean of these two. This method takes the list 1, 7, 3, 13 and orders it to read 1, 3, 7, 13. Then the 1 and 13 are removed to obtain the list 3, 7. Since there are two elements in this remaining list, the median is their arithmetic mean, (3 + 7)/2 = 5.