# The Sample Median

For a sample $\mathbf{x} = ( x_1, x_2, \ldots, x_n )$, the sample median is defined as follows:

$$ \operatorname{Median}(\mathbf{x}) = \begin{cases} x_{(n+1)/2} & \text{if $n$ is odd}, \\ \big( x_{(n/2)} + x_{(n/2+1)}\big) / 2 & \text{if $n$ is even}, \end{cases} $$where $x_{(i)}$ is the $i^\textrm{th}$ order statistic.

In the sorted list of values, the sample *Median* is the middle value.
If the number of values is even, the sample *Median* is the arithmetic average of two middle values.