Show that, for $a$ and $b\geq 0$, $\max\{a,b\}=\frac{1}{2}(a+b+\left|a-b\right|)$

75 Views Asked by At

I can argue that $\max\{a,b\}=average(a,b)+\frac{1}{2}d(a,b)$, but wouldn't this argument be too heuristic? What would a rigorous argument look like?

3

There are 3 best solutions below

1
On BEST ANSWER

We split into cases.

Case 1: $a=b$.

In this case, we have

$$\max{a,a} = a = \frac{1}{2}(2a) = \frac{1}{2}(a+a+|a-a|)$$

Case 2: $a<b$.

In this case, we have

$$\max(a,b) = b = \frac{1}{2}(2b) = \frac{1}{2}(a+b+b-a) = \frac{1}{2}(a+b+|b-a|)$$

Case 3: $a>b$

In this case, we have

$$\max(a,b) = a = \frac{1}{2}(2a) = \frac{1}{2}(a+b+a-b) = \frac{1}{2}(a+b+|a-b|)$$

0
On

Simply distinguish three (or two) cases : $a<b,a>b,a=b$.

0
On

I would distinguish three cases $ a=b, a < b , a >b $ i don't see another straight forward method and for the record this problem is from Spivak's Calc , doesn't it?

edit: I just saw it got answered