1

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!

user650708
  • 21
  • 2
  • 1
    Welcome to MSE. Please first see the topic how to ask a good question. Questions lacking context or showing no effort from the OP will be closed and deleted. I think your question is asking for optimization in the $\mathcal{L}^1$ norm instead of $\mathcal{L}^2$. What have you tried so far? Look at how median is defined. That gives you a reordering of the terms in your sum. Since reordering terms doesn't change the outcome of the sum, you can assume that $A[i] \leq A[i+1]$ for all $i$. What can you do now? – stressed out Mar 06 '19 at 13:24
  • Have a look at - https://math.stackexchange.com/a/1024462/33. – Royi Apr 21 '19 at 20:52

0 Answers0