Results 1 to 8 of 8

Math Help - A max function of 2 variables max(a,b)

  1. #1
    Junior Member
    Joined
    Sep 2011
    Posts
    28

    A max function of 2 variables max(a,b)

    The max function is a function of 2 variables and is defined as follows

    max(x,y) = x if x is greater or equal to y or it's = y if x is less than y

    How would I go about expressing this piecewise function in one line using an absolute value function?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4

    Re: A max function of 2 variables max(a,b)

    Quote Originally Posted by Manni View Post
    The max function is a function of 2 variables and is defined as follows

    max(x,y) = x if x is greater or equal to y or it's = y if x is less than y

    How would I go about expressing this piecewise function in one line using an absolute value function?
    consider:  \left\{  \frac{|x-y|-(x-y)}{2}+x \right\}

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Sep 2011
    Posts
    28

    Re: A max function of 2 variables max(a,b)

    On what basis would I consider that? Maybe I'm missing something, but I don't see its connection with the aforementioned problem.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4

    Re: A max function of 2 variables max(a,b)

    Quote Originally Posted by Manni View Post
    On what basis would I consider that? Maybe I'm missing something, but I don't see its connection with the aforementioned problem.
    When x>y what is |x-y|-(x-y)?


    When x<y what is |x-y|-(x-y)?

    CB
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Junior Member
    Joined
    Sep 2011
    Posts
    28

    Re: A max function of 2 variables max(a,b)

    Oh I understand, can't believe I was oblivious to that. Regardless, thanks a lot. This problem was giving me a headache
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Junior Member
    Joined
    Sep 2011
    Posts
    28

    Re: A max function of 2 variables max(a,b)

    My apologies, but

    when x>y, |x-y|-(x-y) = 0

    and when x<y, |x-y|-(x-y) = 2(y-x)

    Now the midpoint between them can be expressed as (x+y)/2. And I know that we want to 'go' from the midpoint to the maximum point, so something needs to be added to (x+y)/2 to move from that point. I also know that this expression that we add should be the same regardless of whether x>y or x<y.


    This is where I'm stuck. What do I do now?
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,561
    Thanks
    785

    Re: A max function of 2 variables max(a,b)

    when x>y, |x-y|-(x-y) = 0

    and when x<y, |x-y|-(x-y) = 2(y-x)
    So, when x\ge y, \frac{|x-y|-(x-y)}{2}+x=x and when x<y, \frac{|x-y|-(x-y)}{2}+x=y, i.e., in both cases \frac{|x-y|-(x-y)}{2}+x=\max(x,y).

    Note that \frac{|x-y|-(x-y)}{2}+x=\frac{x+y+|x-y|}{2}=\frac{x+y+|y-x|}{2}.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Junior Member
    Joined
    Sep 2011
    Posts
    28

    Re: A max function of 2 variables max(a,b)

    Thanks! Finally, I solved it thanks to you guys
    Last edited by Manni; September 27th 2011 at 06:46 PM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 3
    Last Post: February 18th 2011, 03:27 AM
  2. Continuity of a function of 2 variables
    Posted in the Calculus Forum
    Replies: 2
    Last Post: May 10th 2010, 03:11 PM
  3. Differentiate a function with two variables
    Posted in the Calculus Forum
    Replies: 3
    Last Post: April 15th 2010, 12:50 PM
  4. Function of random variables
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: July 28th 2009, 09:26 AM
  5. Function of two variables
    Posted in the Calculus Forum
    Replies: 1
    Last Post: February 17th 2009, 04:35 PM

Search Tags


/mathhelpforum @mathhelpforum