Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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

share|cite|improve this question

marked as duplicate by Martin Sleziak, Claude Leibovici, Sami Ben Romdhane, TooTone, Git Gud Mar 10 '14 at 12:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Hint: $\max(a,b) + \min(a,b)=a+b$ and $\max(a,b)-\min(a,b)=|a-b|$. Now solve for $\max(a,b)$ and $\min(a,b)$ – Thomas Andrews Dec 14 '12 at 22:17
up vote 6 down vote accepted

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)$.

share|cite|improve this answer
great, thanks a lot – doniyor Dec 14 '12 at 22:17
@doniyor: As you say, $\frac12(a+b)$ is the arithmetic mean of $a$ and $b$, so it’s the point midway between them. $\frac12|a-b|$ is half the distance between $a$ and $b$. If you start right in the middle, at $\frac12(a+b)$, and add half the distance between $a$ and $b$, you reach the right endpoint of the interval with $a$ and $b$ as endpoints; if you subtract half the distance between them, you reach the left endpoint. – Brian M. Scott Dec 14 '12 at 22:24
@BrianM.Scott oh okay, so i am reaching the min or max thru this right? – doniyor Dec 14 '12 at 22:29
@doniyor: Yes: the interval with $a$ and $b$ as endpoints is $$\big[\min\{a,b\},\max\{a,b\}\big]\;,$$ so if you start at the middle of the interval and move half the length of the interval to the right, you reach $\max\{a,b\}$. – Brian M. Scott Dec 14 '12 at 22:32
@BrianM.Scott great, Brian, thank you so much! you are better than my prof in the lecture :D – doniyor Dec 14 '12 at 22:33

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\}$.

share|cite|improve this answer
thanks, i will try now – doniyor Dec 14 '12 at 22:13

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