Show max(a,b) = (a + b + |a-b|)+2

  • Thread starter Diffy
  • Start date
In summary, the homework statement is that if a and b are two real numbers, then max{a,b} is (a+b+|a-b|)/2. If a<b, then max{a,b} is also (a-b+|a-b|)/2.
  • #1
Diffy
441
0

Homework Statement


let a and b be two real numbers show that max{a,b} = (a + b + |a - b|)/2


Homework Equations


I have all the field properties of the real numbers and order, LUB and existence of square root.

I also have definition of absolute value.


The Attempt at a Solution


This is very easy for me to see on the real line. If I break it into (a+b)/2 + |a+b|/2 then it is clear that I am taking the midpoint and adding half the distance between a and b.

However I am not sure I should argue it that way. I think that I should somehow be using my LUB properties but I don't know how.

Any help is appreciated.
 
Physics news on Phys.org
  • #2


Split it into the two cases a>=b and a<b?
 
  • #3


I did think about doing it that way, but I think within each of those cases there will be 3 others as well.

So assume a < b, then I have to consider if a and b are positive, if a and b are negative and if a is negative b is positive.

And all I really know by assuming a < b is that b - a > 0. Which I can't seem to make a connection to the formula (a + b + |a-b|)/2.
 
  • #4


Diffy said:
I did think about doing it that way, but I think within each of those cases there will be 3 others as well.

So assume a < b, then I have to consider if a and b are positive, if a and b are negative and if a is negative b is positive.

And all I really know by assuming a < b is that b - a > 0. Which I can't seem to make a connection to the formula (a + b + |a-b|)/2.

If a<b then i) max(a,b)=b and ii) a-b<0, so |a-b|=-(a-b). Can you check it works now?
 
  • #5


Thanks so much
 

1. What does the function "max(a,b)" do?

The function "max(a,b)" returns the larger value between the two input values, a and b.

2. How does the function "max(a,b)" calculate the maximum value?

The function first adds the two input values, a and b. Then, it calculates the absolute difference between a and b using the "|" operator. The result is added to the sum of a and b, and finally, 2 is added to the total.

3. Can the function "max(a,b)" handle negative numbers?

Yes, the function "max(a,b)" can handle negative numbers. The absolute difference between a and b ensures that the result is always positive, and therefore, the maximum value is always correctly calculated.

4. How is the function "max(a,b)" useful in scientific research?

The function "max(a,b)" can be useful in scientific research for comparing and selecting the maximum value between two sets of data. It can also be used in mathematical models and simulations to determine the maximum value of a variable.

5. Is there a limit to the input values that the function "max(a,b)" can handle?

No, there is no limit to the input values that the function "max(a,b)" can handle. It can handle any real number as input and will return the correct maximum value.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
808
  • Calculus and Beyond Homework Help
Replies
3
Views
515
  • Calculus and Beyond Homework Help
Replies
3
Views
811
  • Calculus and Beyond Homework Help
Replies
1
Views
251
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
557
  • Calculus and Beyond Homework Help
Replies
1
Views
869
  • Calculus and Beyond Homework Help
Replies
11
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
Back
Top