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?

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

Quote:

Originally Posted by

**Manni** 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:

CB

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.

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

Quote:

Originally Posted by

**Manni** 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

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

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?

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

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

Thanks! Finally, I solved it thanks to you guys :)