Absolute maximum
Define the functions Abs(x) and Max(a,b) as:
Abs(x) = (x if x>=0) or (-x if x < 0) e.g. Abs(-2) = 2
Max(a,b) = (a if a >= b) or (b if b > a) e.g. Max (2,-3) = 2
You might think these functions are independent, but they're not, because it is possible to express one in terms of the other. What are the equivalence formulae?
Abs(x) = (x if x>=0) or (-x if x < 0) e.g. Abs(-2) = 2
Max(a,b) = (a if a >= b) or (b if b > a) e.g. Max (2,-3) = 2
You might think these functions are independent, but they're not, because it is possible to express one in terms of the other. What are the equivalence formulae?
Labels: mathemagic, mathschallenge





4 Comments:
abs(x) = Max(x,-x)
Max(a,b) = (a+b+abs(a-b))/2
That was short-lived. You got them.
Maximize your Abs !
x is greater than -x if x is positive, x is less than -x if x is negative, thus
Abs(x)=Max(x,-x)
Abs(x) is often also expressed as +sqrt(x^2) (the positive square root of x^2.) for real numbers.
Max in terms of Abs is trickier
if a is greater than b then a-b will be positive and Abs(a-b) will be a-b
if a is less than b then a-b will be negative and Abs(a-b) will be -a+b
so if we add them to the original terms of a + b then the smaller term will cancel out
if a is greater than b
(a+b)+Abs(a-b)= a+b + a -b = 2a
if a is less than b
(a+b)+Abs(a-b)=a+b-a+b= 2b
both results are 2 times too big so we divide them in half
Max(a,b)= 0.5*(a+b + Abs(a-b))
or using only math for real numbers
Abs(x) = +sqrt(x^2)
Max(a,b)= 0.5*(a+b+sqrt( (a-b)^2))
Cam
Thanks Cam. A nice derivation.
The Max(a,b) formula can also be viualised in terms of the real number line: (a+b)/2 is the mid point of a and b. Abs(a,b) is the distance between a and b. Max(a,b) is half the distance higher than than the midpoint of a and b. So Max(a,b)=(a+b)/2+Abs(a,b)/2.
Post a Comment
Links to this post:
Create a Link
<< Home