Proving $\max$ of $a, b$.

1k Views Asked by At

How do I prove that $$\max{\{a, b\}} = \frac{a + b + \left | a - b \right |}{2}$$

I have no idea how to even start the proof, any idea / intuition that can get me started is greatly appreciated.

Thanks for reading my post.

3

There are 3 best solutions below

0
On BEST ANSWER

A tricky way is to notice that \begin{align*} \max(a,b) + \min(a,b) &= a+b \\ \max(a,b) - \min(a,b) &= |a-b| \\ \end{align*}

Add these two equations together and we have $$2 \max(a,b) = a+b + |a-b|$$ and your result follows.

0
On
  • If $a\geq b$, then $|a-b| = a-b$ and $\max\{a,b\} = a$. Now, simplify the expression you want to prove.
  • If $b\geq a$, then I think you can finish the sentence.
0
On

The intuition behind this is the following. Write the RHS as $$\frac{a+b}{2}+\frac{|a-b|}{2}$$ Now the first term $\dfrac{a+b}{2}$ gets you exactly at the midpoint between $a$ and $b$. For example if the numbers $a,b$ are $5,10$ then this gets you to $7.5$. So, to reach the maximum of the two you need to add the half of their distance, or in symbols $$+\frac{d(a,b)}{2}$$ In our example this would be $5/2=2.5$ and indeed $7.5+2.5=10$ is the maximum of the two numbers. Now, you need to know that the distance $d(a,b)$ of two numbers $(a,b)$ is given by the absolute value of their difference, that is $d(a,b)=|a-b|$ which gives you the result.

Unfortunately this expression does not admit a generalization for $3$ or more numbers.