I am trying to solve this question, but have no idea how one can prove it:
Let $m$ be the median of the array $A$ with $n$ real numbers. Show that
$$\sum_{i=1}^{n}\bigg|A[i]-x\bigg|$$
is minimal for $x = m$.
Thank you for your help!
I am trying to solve this question, but have no idea how one can prove it:
Let $m$ be the median of the array $A$ with $n$ real numbers. Show that
$$\sum_{i=1}^{n}\bigg|A[i]-x\bigg|$$
is minimal for $x = m$.
Thank you for your help!