Skip to main content
Post Closed as "Duplicate" by kjetil b halvorsen, Peter Flom
edited tags
Link
Richard Hardy
  • 69.5k
  • 13
  • 126
  • 278
Source Link
user13985
  • 984
  • 4
  • 12
  • 21

Why is median the solution to absolute difference, but mean is the solution to squared difference?

What is the value of $a$ and $b$ that minimizes the $L_1$ and $L_2$ norm, respectively? $$ \min_{a} \mathrm{E} \left| X - a \right| $$ I was told that median is the solution. How do you solve it? Why can't it be the mean instead?

$$\mathrm{E} (X - b) ^ 2$$ I was told that mean $\mu$ is the solution to the squared error. How do you solve it?