Apparently, the mean is the value that minimizes the sum of the squares of deviations, and this made sense to me because the sum of the squared differences can be represented as an equation:
$$ (a - x)^2 + (b - x)^2 + (c - x)^2 + \cdots $$
This function has a minimum when we take the derivative and solve it when it's equal to zero:
$$ 0 = -2(a – x) + -2(b – x) + -2(c – x) + \cdots $$
Some more arithmetic will allow us to arrive at the conclusion:
$$ x = \frac{a + b + c + \cdots}{N} $$
However, I'm having trouble finding a similar way to solve for the median, although I suspect my rusty calculus or arithmetic is behind it.
The sum of absolute deviations would produce the equation:
$$ |a-x| + |b-x| + |c-x| + \cdots $$
I think the derivative function would be:
$$ 0 = -(a-x)/|a-x| + -(b-x)/|b-x| + -(c-x)/|c-x|$$
But I am not sure how to continue from here.