How to prove this simple statement: $\max\{a,b\}=\frac{1}{2}(a+b+|a-b|)$

10.4k Views Asked by At

I am trying to prove this statement.

for any $a,b \in \mathbb{R}$, $$\max\{a,b\}=\frac{1}{2}\big(a+b+|a-b|\big)$$ and $$\min\{a,b\}=\frac{1}{2}\big(a+b-|a-b|\big)$$

I am eating myself not knowing where and how to start. For any guidance Iwill be thankful in tons

2

There are 2 best solutions below

6
On BEST ANSWER

Without loss of generality, we can assume that $a = \max(a, b)$ and $b=\min(a, b)$, as both of the expressions are symmetric.

So since $a \geq b$ we have $a-b \geq 0$, thus $a-b=|a-b|$, and so $\dfrac{a+b+|a-b|}{2} = \dfrac{a+b+a-b}{2}=a=\max(a, b)$.

Similarly, we have $\dfrac{a+b-|a-b|}{2}=\dfrac{a+b-(a-b)}{2} = b=\min(a, b)$.

0
On

What is the definition of $\max\{a,b\}$? Hint: it involves two possible cases.

For each of these cases, check that the right hand side gives the same answer. Job done.

Repeat for $\min\{a,b\}$.