Hacker News new | ask | show | jobs
by mbrudd 1832 days ago
If you want to define the median in a way that generalizes to other situations, this is actually not the way to go! Here's a more general definition: a median of the numbers {x_1, ... x_n} is a number m that minimizes the sum of the absolute deviations, |x_1 - m| + |x_2 - m| + ... + |x_n - m| . Medians are generally not unique via this definition, but they can then be defined for things like sets of points in the plane, in space, etc. (cf. geometric median); the traditional definition is the average of all of the medians under this more general definition.