finding the median in sets of data with an odd and even number of values
in statistics and probability theory, the median is the value separating the higher half from the lower half of a data sample, a population or a probability distribution. for a data set, it may be thought of as the "middle" value. for example, in the data set [1, 3, 3, 6, 7, 8, 9], the median is 6, the fourth largest, and also the fourth smallest, number in the sample. for a continuous probability distribution, the median is the value such that a number is equally likely to fall above or below it.
the basic advantage of the median in describing data compared to the mean (often simply described as the "average") is that it is not skewed so much by a small proportion of extremely large or small values, and so it may give a better idea of a "typical" value. for example, in understanding statistics like household income or assets, which vary greatly, the mean may be skewed by a small number of extremely high or low values. median income, for example, may be a better way to suggest what a "typical" income is.
because of this, the median is of central importance in robust statistics, as it is the most resistant statistic, having a breakdown point of 50%: so long as no more than half the data are contaminated, the median will not give an arbitrarily large or small result.