1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Proving Max and Min Formula

  1. Jul 20, 2013 #1
    1. The problem statement, all variables and given/known data
    The function max will return which number is the largest between the two parameters x and y. The function min will return the smallest number between the two. If the numbers are the same they will give out that same value.

    Prove that

    [tex]
    max(x,y) = \frac{x+y+|y-x|}{2}
    \\
    min(x,y) =\frac{x+y-|y-x|}{2}
    [/tex]
    2. Relevant equations

    None

    3. The attempt at a solution

    Suppose ##x=y=0##
    [tex]
    max(0,0) =
    \\
    \frac{0+0+|0-0|}{2} = 0

    [/tex]
    Suppose ##x = a+1## and ##y = a##
    [tex]
    \begin{align*}
    max((a+1),a) &= \frac{(a+1)+a+|a-(a+1)|}{2}\\
    &=\frac{a+1+a+1}{2}\\
    &=\frac{2a+2}{2} \\
    &=(a+1) \\
    \end{align*}
    [/tex]
    Where ##x>y##

    The similar reasoning can be applied to the case where ##y>x## and to ##min(x,y)## function.

    Is this done or enough? I'm not sure if this is already enough for the purpose, to prove a formula. To what extent should we go so that it's correct?

    Thank You
     
  2. jcsd
  3. Jul 20, 2013 #2

    jbunniii

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Your special cases, ##x = y = 0## and ##x = a+1, y = a## aren't going to do much for you.

    Instead, try considering these two cases: ##x \geq y## and ##x < y##.
     
  4. Jul 20, 2013 #3
    Ok considering the given cases, then it is certain that the prove rest on the inequality ##|y-x|## and what happens with it when ##x\geq y## and ##x<y##. I think I can do the symbolic manipulation to prove that it is indeed true.

    Though my question is why I've to prove the formula using those cases? What is the difference logically with my a+1 case? (It rests with the fact that ##x>y##) Is it that because they are more general, rather than when a+1?
     
  5. Jul 20, 2013 #4

    jbunniii

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Note that I suggested considering these two cases because (1) they are the only possibilities, and (2) the expression ##|y-x|## can be simplified in both cases (try rewriting it without the absolute value).
    Yes. Your solution does not cover, for example, the case where ##x = 1## and ##y = 1/2##.
     
  6. Jul 20, 2013 #5
    Yes the final simplified statement match with the original case once the inequality is changed, say ##|y-x|## to ##(y-x)## if ##x<y##. Thanks for your help.

    Ah yes! I really didn't think of that.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Proving Max and Min Formula
  1. Max & Min (Replies: 2)

  2. Max, Min (Replies: 2)

  3. Max & Min (Replies: 1)

  4. Absolute max/min (Replies: 12)

Loading...