Median of a set

59 Views Asked by At

If the length of a set is odd then I know that the index of the median is $\frac{(n+1)}{2}$ but I'm not sure what it is when the length of the set is even. Some places I find say that it is still $\frac{(n+1)}{2}$ but some say that it is $\frac{n}{2}$.

I know this is probably an easy question that's been answered everywhere but I couldn't find it. Thanks.

2

There are 2 best solutions below

0
On BEST ANSWER

I would say that it's still $\frac{n+1}2$, since that will correspond to a $X.5$th element, which lets you know that you need to take the average of the $\lfloor\frac{n+1}2\rfloor$th element and the $\lceil\frac{n+1}2\rceil$th element.

So, for instance, with $\{3, 4, 8, 9\}$, the median is the $\frac{4+1}2 = 2.5$th element. That means it's between the $2$nd and $3$rd elements, so we take the average of those elements to get $\frac{4+8}2 = 6$ as our median.

0
On

As far as I know, there is actually no completely agreed upon convention. However, the most common approach is to take the mean between the 2 center elements. For example, if you have a set $$S = \{3,8,4,10,7,9\} $$ Then put it in order $$S = \{3,4,7,8,9,10\} $$ and take the mean of the two center elements $$\mathrm{median}(S) = \frac{7+8}{2} = 7.5$$

There are hence two indices to consider. They are given by rounding $(n+1)/2$ down and up.