# Median

1,016pages on
this wiki

The median is the midpoint element of the set of distinct elements in a collection of values.

If the set contains an even number of elements, two elements exist on either side of the middle-point. In this situation, the median is the arithmetic mean of these elements.

If there are n-many elements in the data set, then:

• if n is odd, the median is $x_{n/2}$
• if n is even, the median is $\frac{1}{2} \cdot (x_{\frac{n-1}{2}} + x_{\frac{n+1}{2}})$