# Minimum of a sum proof.

The problem I am working on is:

Let $$Y = \{{y_1,y_2,y_3,...y_n\}}$$ and $$c=median(Y)$$. Prove that: $$\text{min}\left[\sum_{i=1}^n \lvert y_{i}-c\rvert\right]=c$$

My question is:

Is the $$\text{min}\left[\right]$$ function here, asking for the which $$y_i$$ the distance between $$y_i$$ and $$c$$, $$\lvert y_{i}-c\rvert$$ is the smallest? Or is it asking, for the literal minimum of the arugments its given, like $$\text{min}\left[99,1,4,7,121\right]=1$$?

What I have tried so far:

1. First I tried an example to get a feel for things:

Let $$Y = \{{1,2,3,4,5\}}$$ and $$c=3$$. Then we have:

\begin{align} \sum_{i=1}^5 \lvert y_{i}-3\rvert & = \lvert 1-3\rvert = 2 \\ & = \lvert 1-3\rvert = 2 \\ & = \lvert 2-3\rvert = 1 \\ & = \lvert 3-3\rvert = 0 \\ & = \lvert 4-3\rvert = 1 \\ & = \lvert 5-3\rvert = 2 \\ & = 2+1+0+1+2=6 \end{align} So,

$$\text{min}\left[\sum_{i=1}^5 \lvert y_{i}-3\rvert\right]=\text{min}\left[6\right]=6$$

Since this would now be acounterexample to the statement I am supposed to prove, I must be having a misunderstanding?

2. If the $$\text{min}\left[\right]$$ function works the other way, I tried the following proof:

Proof:

Since the distance between a point and itself is $$0$$, $$\left[c-c\right]=0$$ and the fact that there can only be one median $$c$$ for a given set of $$y$$, clearly $$\left[c-c\right] \lt \left[y_i-c\right]$$ for all $$y_i.$$

Is this correct if thats the case?

• linear algebra $\neq$ peanut butter – mathreadler Sep 29 '18 at 14:45
• the summation is over all possible $y_i's$ – Yan Lai Sep 29 '18 at 14:48
• Part of me wants to say that this statement may not be correct. If we have a sample where each $y_i$ is the same, then $c=y_i$ for all $i$, thus... – WaveX Sep 29 '18 at 14:50
• What is the variable in your formula which minimizes it? It seems that all values are fixed. A clarification is needed. – callculus Sep 29 '18 at 15:04
• I suspect that you are being asked to show that the $c$ which minimise(s) $\sum\limits_{i=1}^n \lvert y_{i}-c\rvert$ for given $\{y_i\}$ is (or includes) the median of the $\{y_i\}$ – Henry Sep 29 '18 at 15:06