Proofs of max and min formulas for 2 numbers

In summary, the formulas for the maximum and minimum of two numbers, denoted by max(x,y) and min(x,y), are given by (x + y + |y - x|) / 2 and (x + y - |y - x|) / 2, respectively. These can be proven using the trichotomy law and considering the three cases of x = y, x < y, and x > y.
  • #1
nike5
13
0

Homework Statement


The maximum of 2 numbers x and y is denoted by max(x,y) and the minimum of 2 numbers
x and y is denoted by min(x,y). Prove that max(x,y) = (x + y + l y - x l) / 2
and min(x,y) = (x + y - ly - xl ) / 2.



Homework Equations





The Attempt at a Solution


Theorem. max(x,y) = (x + y + l y - x l) / 2
Proof. Let x and y be arbitrary real numbers. Then the midpoint between x and y is represented by (a + b) / 2. Therefore, (a + b ) / 2 is l y - x l / 2 numbers less than
max(x, y). Then adding l y - x l / 2 to (a + b ) / 2 yields ( x + y + l y - x l / 2 = max(x, y).

Theorem. min( x, y) = (x + y - l y - x l) / 2
Proof. Let x and y be arbitrary real numbers. Then the midpoint between x and y is represented by (a + b ) /2 . Therefore, (a + b) /2 is l y - x l) / 2 greater than min(x, y). Then subtracting l y - x l) / 2 from (a + b ) / 2 yields (x + y - l y - x l) / 2 = min( x,y).

Is the reasoning in these proofs too informal? Should I instead use the trichotomy law and prove the formulas by the three cases
 
Physics news on Phys.org
  • #2
Hi nike5! :smile:

(you should be able to find a | on your keyboard somewhere near the " :wink:)
nike5 said:
… Should I instead use the trichotomy law and prove the formulas by the three cases

Short answer … yes! :biggrin:
 
  • #3
And you should get rid of the a and b. You're given x and y, so use them instead.
 
  • #4
Proof take 2
Theorem. max (x, y) = (x + y + |y - x|) / 2
Proof. Let x and y be arbitrary real numbers. We will consider three cases.
Case 1. x = y. Then max ( x, y) = x = y = ( x + y) / 2 = [(x + y) / 2] + 0
= [(x + y) / 2] + ( 0 = y-x) = [(x + y) / 2] + ( |y - x|) = [(x + y) / 2] + ( |y - x|/ 2)
= (x + y + |y - x |) / 2.
Case 2. x < y. Adding (-x) to both sides of x < y we get (y-x) > 0.
Then max (x, y) = y = (2y) / 2 = (y + y) / 2 = ( y + y + x + (-x) / 2 = (x + y + y - x) / 2
Hence, since y- x > 0, ( x + y + |y - x|) / 2.
Case 3. x > y. Then max (x, y) = x = (2x) / 2 = (x + x) /2 = ( x + x + y + (-y)) / 2
= ( x + y + (-y) + x) / 2. Adding (- x) to both sides of x > y we get ( y - x) < 0. Then, by the
definition of absolute value, |y - x| = (- y) + x. Substituting |y - x| for ( -y) + x in
( x + y + (-y) + x) / 2 we get max ( x,y) = x = ( x + y + |y - x|) / 2.
Thus, since this covers all cases for every pair of real numbers x and y, we can conclude that max (x,y) = (x + y + |y - x|) / 2. QED

Better?
 
  • #5
nike5 said:
Better?

Yes! :smile:

But you can cut out a lot of it …

for example:

Case 1. x = y. Then max ( x, y) = x

and (x + y + |y - x |) / 2 = (x + x + 0)/2 = x :wink:

(and similarly for Cases 2 and 3)
 
  • #6
Thanks for the help Tim:smile:
 

1. What are the max and min formulas for 2 numbers?

The maximum formula for two numbers is max(a,b) = (a + b + |a - b|)/2 and the minimum formula is min(a,b) = (a + b - |a - b|)/2. These formulas are used to find the largest and smallest values between two numbers, regardless of their order.

2. How do these formulas work?

The max and min formulas use the absolute value (represented by | |) to find the difference between the two numbers. The difference is then added or subtracted from the sum of the two numbers, depending on which formula is being used. The result is then divided by 2 to find the maximum or minimum value.

3. Can these formulas be used for more than 2 numbers?

Yes, these formulas can be extended to any number of values by comparing each value to the current max or min and updating it accordingly. For example, if we have 3 numbers a, b, and c, the max formula would be max(a,b,c) = max(a,max(b,c)).

4. What are some applications of these formulas?

These formulas are commonly used in statistics, optimization problems, and in computer science algorithms. They can also be used in everyday situations, such as finding the biggest or smallest number in a set of data.

5. Are there any limitations to these formulas?

While these formulas work for real numbers, they may not be applicable to complex numbers. Additionally, they only find the maximum and minimum values between two numbers, and do not take into account any other factors or criteria. In some cases, other methods may be more appropriate for finding maximum and minimum values.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
10
Views
1K
  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
  • Precalculus Mathematics Homework Help
Replies
7
Views
748
  • Precalculus Mathematics Homework Help
Replies
21
Views
2K
  • Precalculus Mathematics Homework Help
Replies
13
Views
2K
  • Precalculus Mathematics Homework Help
Replies
4
Views
1K
  • Linear and Abstract Algebra
Replies
19
Views
2K
Replies
1
Views
1K
Replies
1
Views
912
Replies
7
Views
2K
Back
Top