# How I can express this mathematically?

I'm working on a OR project. I have a code which fixes my problem which uses the constraint

((a =< b) or (c =< d) or (e =< f)) = True

I need to rewrite this condition as mathematical expression(s)

I tried

(a-b) * (c-d) * (e-f) =< 0

Which seems to work for most cases but fails when two of them are positive and one of them are negative.

Any help is greatly appreciated.

• Why do you think you need to write this more compactly? Your first condition seems clear to me. – Jack M Apr 18 '14 at 23:02
• I need to write down a mathematical model for my code, which got me stuck. – Halox Apr 18 '14 at 23:20
• I don't know exactly why you want this but you could do $\frac{b-a}{|b-a|} + \frac{d-c}{|d-c|} + \frac{f-e}{|f-e|} \neq -3$ – KSab Apr 18 '14 at 23:31
• WOW! that was brilliant. Thanks. – Halox Apr 18 '14 at 23:38

$\max(b-a,d-c,f-e)\ge 0$.
Another way: $$(|a - b| + a - b)(|c - d| + c - d)(|e - f| + e - f) \le 0$$
• I think you can use $=0$ instead of $\le 0$ if you want – Ross Millikan Apr 19 '14 at 14:18