These days we hear about medians of all kinds of things: household income, lifetime of items such as lightbulbs, and so on. It’s time to get a rigorous grip on the concept.
Definition. Suppose is a set, a totally ordered set, and a function. Then is said to be a median of if the sets and have equal size.
It is a reflex of mathematicians to ask about existence and uniqueness of any concept they stumble upon. (Note that I wrote “a median” and not “the median” above.) Indeed, as much as the definition above seems to make sense: Even for simple example, the median needs not exist. Let and let be defined by and . Then has no median according to the definition above. On the other hand, if and is the inclusion map, then every element of the open interval is a median!
There are many common fixes to the problems of existence and uniqueness, but no definition is really elegant. (Most resort to listing the elements in ascending order and to pick the arithmetical middle of the “middle elements” in the list or something similar.)
Other difficulties arise when we want to pick medians of infinite sample sets. Let be a totally ordered set. We say that is a median of if the sets and have equal cardinality. Note that in every element is a median, but has no median at all!