Show that the $\max{ \{ x,y \} }= \frac{x+y+|x-y|}{2}$.

Solution 1:

Here is another way of looking at it:

We have $|x| = \max(x,-x)$. Also, $\max(a,b)+c = \max(a+c,b+c)$, and if $c \geq 0$, then $c \max(a,b) = \max(ac,bc)$.

Hence \begin{eqnarray} \frac{1}{2}(x+y+|x-y|) &=& \frac{1}{2}(x+y+\max(x-y,y-x)) \\ &=& \frac{1}{2}(\max(x-y+x+y,y-x+x+y)) \\ &=& \frac{1}{2}(\max(2x,2y)) \\ &=& \max(x,y) \end{eqnarray}

Solution 2:

This probably isn't as rigorous as it should be, but I think it's intuitive enough.

Hmm... We don't know which of $x$ or $y$ is bigger, but we do know one thing: their average. If we call the average $z$, then $z=\frac{x+y}{2}$. Now, the distance between $x$ and $y$ is $|x-y|$, so the distance from $z$ to both $x$ and $y$ is $\frac{|x-y|}{2}$.

So if we imagine a number line, the distance from $0$ to $z$ is $\frac{x+y}{2}$, and the distance from $z$ to max(x, y) is $\frac{|x-y|}{2}$. Thus, the total distance from $0$ to max(x, y) is $\frac{|x-y|}{2}$ + $\frac{x+y}{2}$, as desired.

Solution 3:

Hint: If $x\ge y$ then $|x-y|=x-y$. If $x\lt y$ then $|x-y|=-(x-y)=y-x$.

We have used the fact that in general $|w|=w$ if $w\ge 0$ and $|w|=-w$ if $w\lt 0$.