Average

# Overview
In mathematics, an average, or central tendency of a data set refers to a measure of the "middle" or "expected" value of the data set. There are many different descriptive statistics that can be chosen as a measurement of the central tendency of the data items. The most common method is the arithmetic mean, but there are many other types of averages.
Colloquially, people often use the term average to refer to an intuitive central tendency without having a specific measurement of central tendency in mind, or use terms such as "the average person". However, the phrase "there's no such thing as an average citizen" emphasizes that the average is a number, not a person or some other object.  The average is calculated by combining the measurements related to a group of people or objects, to compute a number as being the average of the group.
Please see the table of mathematical symbols for explanations of the symbols used.  In statistics, the term central tendency is used in some fields of empirical research to refer to what statisticians sometimes call "location".  A "measure of central tendency" is either a location parameter or a statistic used to estimate a location parameter.

# Calculating averages
An average is a representative value of a list. If all the numbers in the list were the same, then this number should be used. What if they are not the same? There are many different possible answers to this question. The average should not depend on the order of the numbers in the list, and it is often useful to also require that it should not be less than the smaller number in the list, nor greater than the greater number in the list (but see the annualiztion of of returns for other than one year in duration).
An easy way to get a representative value from a list is to randomly pick any number from the list. However, the word 'average' is usually reserved for more sophisticated methods that are generally found to be more useful.
The most common type of average is the arithmetic mean, often simply called the mean. The arithmetic mean of two numbers, such as 2 and 8, is obtained by finding a value A such that 2 + 8 = A + A. It is then simple to find that A = (2 + 8)/2 = 5. Switching the order of 2 and 8 to read 8 and 2 does not change the resulting value obtained for A. The mean 5 is not less than the minimum 2 nor greater than the maximum 8. If we increase the number of terms in the list for which we want an average, we get, for example, that the arithmetic mean of 2, 8, and 11 is found by solving for the value of A in the equation 2 + 8 + 11 = A + A + A. It is simple to find that A = (2 + 8 + 11)/3 = 7. Again we see that changing the order of the three members of the list does not change the result: A = (8 + 11 + 2)/3 = 7, and that 7 is between 2 and 11. This summation method is easily generalized for lists with any number of elements. It is also easy to see that the mean of a list of integers is not necessarily an integer. "The average family has 1.7 children" is an unpleasant way of expressing that the average number of children in some list of families is 1.7. The temperature represented by the arithmetic mean of a list of temperatures does not depend on whether the Fahrenheit or the Celcius scale is used, and this is one reason why an 'average temperature' is useful.
There are many other kinds of averages. However, they can all be understood in the same manner. For example, sometimes it is informative to consider the geometric mean. Here, instead of adding numbers we multiply them. Thus, the geometric mean of 2 and 8 is obtained by solving for G in the following equation: 2 - 8 = G - G. Thus, the geometric mean of 2 and 8 is G = sqrt(2 - 8) = 4. And again it is seen that changing the order of the members of the list to be averaged does not change the result: G = sqrt(8 - 2) = 4. In order to make sense of the requirement that the mean must be at least as big as the smallest member of the list and no bigger than the largest, the geometric mean is usually only applied to lists of positive numbers, not to lists that can include negative numbers such as temperatures.
It should now be obvious that it would be easy to come up with many other ways of combining the elements of a list in a manner that does not change when the order of the list is changed. For each of them one can define an average based on that method.
The most frequently occurring number in a list of numbers is called the mode. So the mode of the list (1, 2, 2, 3, 3, 3, 4) is 3. The mode is not necessarily well defined. The list (1, 2, 2, 3, 3, 5) has the two modes 2 and 3. The mode can be subsumed under the general method of defining averages by understanding it as taking the list and setting each member of the list equal to the most common value in the list if there is a most common value.  This list is then equated to a the resulting list with all values replaced by the same value.  Since they are already all the same, this does not require any change.
Another average worth discussing is the median. Its method is to order the list according to its magnitude and then repeatedly remove the pair consisting of the highest and lowest value till either one or two values are left. If two values are left replace them with their arithmetic mean. 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 list replace them by their arithmetic mean (3 + 7)/2 = 5. Now do the same for the equal sized list consisting of all the same value M: M, M, M, M. It is already ordered. We remove the two end values to get M, M. We take their arithmetic mean to get M. Finally, set this result equal to our previous result to get M = 5.
In finance people are often interested in the annualized return which is a different kind of average. To begin with an example consider two years in which the return in the first year is minus 10% and the return in the second year is plus 60%. Then the annualized return, R, would be obtained by solving the equation: (1 - 10%) - (1 + 60%) = (1 + R) - (1 + R). The value of R that makes this equation true is R = 12%. It is again to be noted that changing the order to find the annualized return of 60% and -10% gives the same result as the annualized return of -10% and 60%. This method can be generalized to examples where the periods are not all of one-year duration. Annualization of a set of returns is a variation on the geometric average that provides the intensive property of a return per year corresponding to a list of returns.  Consider a function that adds one to each return in the list and then takes the T th root of their product, where T is the sum of the periods of all the returns. This function is set equal to the same function for a list with the same number of elements composed of identical single year returns, whose value is the annualized return.  For example, consider a period of a half of a year for which the return is minus 20% and a period of two and one half years for which the return is 116%.  The annualized return for the combined period is the single year return, R, that is the solution of the following equation:
{(1-20%)*(1+116%)}^{1/(0.5 + 2.5)} = {(1+R)*(1+R)}^{1/(1 + 1)},
giving an annualized return, R, of 20%.
The Heronian mean H, is obtained by taking the sum of the square root of the product of each paired combination of two members of a list.  Since the pairs are created by all ways of picking twice from the list while ignoring the order, the pair (a,c) is picked only once since (a,c) is the same as (c,a).  However, the same element of the list can be picked twice within a single pair to get (a,a).  Also, since it is the element on the list that is picked, not the value, if the same value appears twice on the list, different ways of picking it are included.  Therefore, if the list has three members, designated a, b, c, then set sqrt(a*a) + sqrt(a*b) + sqrt(a*c) + sqrt(b*b) + sqrt(b*c) + sqrt(c*c) equal to  sqrt(H*H) + sqrt(H*H) + sqrt(H*H) + sqrt(H*H) + sqrt(H*H) + sqrt(H*H) to obtain H.  Do this even if the value of b and the value of c are the same.  As an example, consider the list 1, 4, 4.  We then need to solve the equation:
sqrt(1*1) + sqrt(1*4) + sqrt(1*4) + sqrt(4*4) + sqrt(4*4) + sqrt(4*4) = sqrt(H*H) + sqrt(H*H) + sqrt(H*H) + sqrt(H*H) + sqrt(H*H) + sqrt(H*H).  Its solution is H = 17/6.
All averages (including esoteric ones like the Heronian mean) can be thought of as examples of this general method for obtaining averages. A number of averages, including the ones discussed above, that have been found to be useful in some circumstance or other are listed below along with their formal solutions.

# Other averages
Other more sophisticated averages are: trimean, trimedian, and normalized mean. These are usually more representative of the whole data set.
One can create one's own average metric using generalized f-mean:
where f is any invertible function. The harmonic mean is an example of this using f(x) = 1/x, and the geometric mean is another, using f(x) = log x. Another example, expmean (exponential mean) is a mean using the function f(x) = ex, and it is inherently biased towards the higher values.  However, this method for generating means is not general enough to capture all averages.  The Heronian cannot be put into this form.  A more general method for defining an average, y, takes any function of a list g(x1, x2, ..., xn), which is symmetric under permutation of the members of the list, and equates it to the same function with the value of the average replacing each member of the list: g(x1, x2, ..., xn) = g(y, y, ..., y).  This most general definition still captures the important property of all averages that the average of a list of identical elements is that element itself. 
The function g(x1, x2, ..., xn) =x1+x2+ ...+ xn provides the arithmetic mean. 
The function g(x1, x2, ..., xn) =x1x2 ... xn provides the geometric mean. 
The function g(x1, x2, ..., xn) =x11+x21+ ...+ xn1 provides the harmonic mean.

# Average applied to a data stream
The concept of an average can be applied to a stream of data as well as a bounded set, the goal being to find a value about which recent data is in some way clustered.  The stream may be distributed in time, as in samples taken by some data acquisition system from which we want to remove noise, or in space, as in pixels in an image from which we want to extract some property.  An easy-to-understand and widely used application of average to a stream is the simple moving average in which we compute the arithmetic mean of the most recent N data items in the stream.  To advance one position in the stream, we add 1/N times the new data item and subtract 1/N times the data item N places back in the stream.

# Derivation of the name
The original meaning of the word average is "damage sustained at sea": the same word is found in Arabic as awar, in Italian as avaria and in French as avarie.  Hence an average adjuster is a person who assesses an insurable loss.
Marine damage is either particular average, which is borne only by the owner of the damaged property, or general average, where the owner can claim a proportional contribution from all the parties to the marine venture.  The type of calculations used in adjusting general average gave rise to the use of "average" to mean "arithmetic mean".