Results 1 to 5 of 5

Math Help - mid(A,C,D)

  1. #1
    Newbie
    Joined
    May 2008
    Posts
    6

    min(max(C,D),A)... again

    Although I posted a very similar problem before, I must resubmit.

    I have this function where A,C,D are real numbers and C< A:

    min(max(C,D),A)

    I need to decompose algebrically this into NOT-NESTED min/max
    functions with NO absolute values.

    Something like: max(???) + max(???) or any combination of min/max.

    Thanks for your help!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    May 2008
    Posts
    6

    mid(A,C,D)

    Perhaps I can better formulate my problem.

    I have three real numbers A, C, D with C < A.

    How can I write an algebraic function that gives the median number,
    i.e. mid(A,C,D)?

    The min(max(C,D),A) works but I must get rid of the nested function.
    And also, I cannot use absolute values.

    Note that, being C < A, there are only three cases to consider:

    1) D < C < A (mid = C)
    2) C < D < A (mid = D)
    3) C < A < D (mid = A)

    Therefore, the mid numer is one of these two: max(D,C) or min(A,D).

    But don't see how to progress and come out with the right one.

    PLS HELP!
    Last edited by topsquark; June 9th 2008 at 04:05 AM.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor ebaines's Avatar
    Joined
    Jun 2008
    From
    Illinois
    Posts
    1,019
    Thanks
    278
    If you're looking for the median number, how about this:

    A+C+D-min(A,C,D)-min(A,C,D).
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    May 2008
    Posts
    6

    Resolved

    Actually, given the posted constraints, I resolved it:

    mid(A,C,D) = min( max(C, D), A) = max(C, D) + min(A, D) D

    That's what I really needed!
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor ebaines's Avatar
    Joined
    Jun 2008
    From
    Illinois
    Posts
    1,019
    Thanks
    278
    Quote Originally Posted by ebaines View Post
    If you're looking for the median number, how about this:

    A+C+D-min(A,C,D)-min(A,C,D).
    Typo alert! That should have been:


    A+C+D-min(A,C,D)-MAX(A,C,D)

    Sorry for the confusion.
    Follow Math Help Forum on Facebook and Google+

Search Tags


/mathhelpforum @mathhelpforum