4

We have $x_1,x_2,\ldots,x_n \in \mathbb{R}$. I conjecture there to be a number $M \in \mathbb{R}$ such that for any $i=1,2,\ldots,n$ the quantity $$|x_i - M|$$ is as small as possible. How do you go about proving that $M$ is the arithmetic mean $$M=\frac{\sum_{i=1}^{n} x_i }{n}\text{ ?}$$

user132181
  • 2,726
  • 1
    Do you want every term as small as possible, or the overall sum? – pjs36 Mar 21 '15 at 16:05
  • @pjs36 I have edited the question. – user132181 Mar 21 '15 at 16:06
  • It doesn't look edited to me! – Rory Daulton Mar 21 '15 at 16:08
  • This conjecture is false. Take $x_1 = 0, x_2 = 10$. Then consider $M = 1, M = 5$. For $i = 1$, we get $|x_1 - 1| < |x_1 - 5|$. But for $i = 2$ we get $|x_2 - 1| > |x_2-5|$. – Hans Engler Mar 21 '15 at 16:10
  • 2
    If you are trying to minimize the sum of those absolute values, $M$ is not the arithmetic mean, it is the median. For example, look at $x_1=1,\ x_2=2,\ x_3=9$. The mean $4$ gives you a sum of $11$, while the median $2$ gives a sum of only $9$. – Rory Daulton Mar 21 '15 at 16:10
  • I forgot to mention that $M$ is real by assumption... – user132181 Mar 21 '15 at 16:20
  • 1
    It doesn't make sense to say each $|x_i-M|$ is as small as possible. These can be as small as $0$, while some other quantities may not be smallest possible. What do you mean exactly by these are as small as possible? If you meant sum of those to be smallest, then $M$ need not be unique: consider $x_0=0, x_1=1$ then any $M\in [0,1]$ minimises the sum. – user160738 Mar 21 '15 at 16:25
  • See http://math.stackexchange.com/questions/113270 – Bart Michels Apr 04 '15 at 09:08

2 Answers2

6

The value of $M$ that makes $\displaystyle\sum_{i=1}^n |x_i-M|$ as small as possible for given $x_1,\ldots,x_n$ is the median, not the mean, of $x_1,\ldots,x_n$.

The value of $M$ that makes $\displaystyle\sum_{i=1}^n (x_i-M)^2$ as small as possible for given $x_1,\ldots,x_n$ is the mean, not the median, of $x_1,\ldots,x_n$.

The first proposition can be proved as follows: If $M$ is bigger than more $x$ values than it's smaller than, then making $M$ smaller increases its distance from a few $x$ values and decreases its distance from many $x$ values, all by the same amount, so the sum of the distances gets smaller. Then do the same with $M$ smaller than the median.

The second proposition can be shown as follows: \begin{align} & \sum_{i=1}^n (x_i-M)^2 = \sum_{i=1}^n ((x_i -\text{mean})+(\text{mean}-M))^2 \\[10pt] = {} & \sum_{i=1}^n (x_i-\text{mean})^2 + \underbrace{2\sum_{i=1}^n (x_i-\text{mean})(\text{mean}-M)}_{\text{This sum is $0$.}} + \sum_{i=1}^n (\text{mean}-M)^2 \\[10pt] = {} & \left(\sum_{i=1}^n (x_i-\text{mean})^2\right) + n(\text{mean}-M)^2. \end{align} To find the value of $M$ that makes this as small as possible, notice that $M$ appears only in the last term, so pick $M$ so as to make that as small as possible.

2

One other way to make sense of the Question is that we'd like to make the largest of the deviations $|x_i - M|$ as small as possible, i.e. find the real number $M$ that minimizes:

$$ \max_{i=1,\ldots,n} |x_i - M| $$

For this it suffices to choose $M$ to be the average of the largest and smallest values $x_i$. Then the $\max |x_i - M|$ is half the (absolute) difference between those largest and smallest values.

hardmath
  • 37,015