Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How to show that $$ \max(f,g) = \frac{f+g+|f-g|}{2} $$

share|improve this question
1  
Hint: it is enough to do this for $f,g$ numbers (well, I assumed they were functions) (why?). Have you tried then assuming that $f\geq g$ and see what happens to both sides? –  Jason Polak Oct 18 '12 at 2:44
    
Just check that it works for any two numbers x and y. Assume the three possibilities x<y, x=y, x>y and calculate the value of the definition (with x and y insteas of f and g). If the thing is supposed to refer to functions f and g I would assume they take on values in the reals, or some simple thing in which < is defined (so also |x|). –  coffeemath Oct 18 '12 at 2:44
add comment

1 Answer 1

up vote 4 down vote accepted

Although you’re proving a fact about functions, you can do it by looking at individual function values: you need to show that for each $x$ in the domain of $f$ and $g$,

$$\max\{f(x),g(x)\}=\frac12\Big(f(x)+g(x)+|f(x)-g(x)|\Big)\;.$$

It suffices to show that if $a$ and $b$ are any real numbers, then

$$\max\{a,b\}=\frac12\Big(a+b-|a-b|\Big)\;.\tag{1}$$

To see what’s going on, start by drawing pictures, one for $a<b$ and one for $a>b$. In each case $\frac12(a+b)$, the arithmetic mean of $a$ and $b$, is the midpoint of the interval between $a$ and $b$, $|a-b|$ is the length of that interval, and $\frac12|a-b|$ is the distance from the midpoint to each end. Once you’ve seen that, it should at least be intuitively clear why $(1)$ is true, even if you still have to work a bit to prove it.

The most straightforward way to prove it is to break the result into two cases, $a\le b$ and $a>b$. In each case you can say exactly what $\max\{a,b\}$ is, and in each case you can simplify the expression $\frac12\big(a+b-|a-b|\big)$ greatly by getting rid of the absolute value; when you do all this, you’ll find that in each of the two cases the lefthand and righthand sides of $(1)$ are indeed equal.

share|improve this answer
    
Thank you all and especially Brian. –  Klara Oct 18 '12 at 2:50
    
@Klara: You should accept his answer by clicking on the tick icon. –  wj32 Oct 18 '12 at 2:57
    
@Klara: You’re welcome. –  Brian M. Scott Oct 18 '12 at 2:58
    
@wj32 Thank you! –  Klara Oct 18 '12 at 4:00
    
I am a bit confused. Assume $a \leq b$. Then $max(a,b) = b$. Further $|a-b| = - (a-b)$ such that $$ \frac 12 (a+b-|a-b|) = \frac 12 (a+b+a-b) = \frac 12 2a = a$$ ? –  André Jan 2 '13 at 12:21
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.