The median gives the middle value of a set of quantitative data once it has been arranged into order; it is a type of average.

For example, the median of \(0\), \(1\), \(2\), \(2\), \(3\), \(4\), \(4\), \(5\), \(7\) is the middle number, \(3\).

If there are an even number of values, then the median is midway between the middle two values. For example, the median of \(1\), \(2\), \(2\), \(4\), \(5\), \(6\) is \(\frac{2+4}{2} = 3\).

If data are given in grouped classes, then their median can be estimated using cumulative frequency graphs and linear interpolation. (Linear interpolation is explored in the resource In-betweens.)

For a random variable \(X\), the median is the \(X\) value \(m\) which is halfway through the distribution, that is, \(P(X\le m)=\frac12\). This works well for continuous random variables, but not for discrete ones.

For discrete random variables, we say that the median is \(m\) if \(P(X<m)<\frac12\) and \(P(X>m)<\frac12\), so that the halfway point falls within \(X=m\). For example, if \(X\) has \(P(X<3)=\frac{3}{10}\) and \(P(X\le 3)=\frac{6}{10}\), then \(X=3\) goes across the halfway point, so the median is \(3\). In the case that \(P(X\le m)=\frac12\), so that the halfway point falls on the boundary between \(m\) and \(m+1\), we say that both \(m\) and \(m+1\) are medians.