RadiumBall wrote:Suppose we have a set {8, -1, 3, 6, 2 } do we need to order the set before computing the median, this may be silly but I ask this specifically because here
https://www.beatthegmat.com/is-the-range ... 57095.html I learnt that range does not require a set be ordered.
Technically, sets do not have any 'order'. That is, the set {1, 3, 7} is exactly the same set as {3, 1, 7}. If a set has an odd number of elements, the median of that set is the "middle number"
when your set is written in increasing (or decreasing) order (of course with an even number of elements, we need to average the two "middle numbers" to find the median). The median may not be the number that 'looks like' it's in the middle. If you have a set {a, b, c}, we can be certain that the median is equal to one of a, b or c, but we can't say which unless we know the ordering of the set; without additional information, do not make the mistake of assuming the median is b. Similarly, you should *not* assume the range of the set {a, b, c} is equal to c-a unless you know the set is written in increasing order.