Monday, March 16, 2009

Max and Min

Here are some useful equations and properties related to the max and min functions.

max is associative:

max(a, max(b, c)) = max(a, b, c)

max(x,y) is a non-decreasing function of (x,y). i.e., if x1 >= x2 and y1 >= y2, max(x1,y1) >= max(x2,y2)

max(a,b)+c = max(a+c, b+c)
max(a,b)-c = max(a-c, b-c)

max(a,b)+max(c,d)=max(a+c,a+d,b+c,b+d)

max(a,b)>= a
max(a,b)>= b
(c <= a or c <= b) => c <= max(a,b)

Sunday, March 01, 2009

Expressing <= using <

Can you express a <= b using only strict less than operator?

Yes. We have a <=b <=> for all e > 0, a < b + e

Proof => Obvious!

<= Assume not. Then a > b.
Take e = a - b >0
Then by hypothesis, we have

a < b + e = b + a - b = a

Contradiction!

QED.