2
$\begingroup$

I'm trying to simplify the following expression:

(A == B) OR ( (A > B) AND (A < C) )

Given that B <= C, this is my bet:

B <= A < C     (also  (B <= A) AND (A < C))

Explanation:

(A == B) OR ( (A > B) AND (A < C) )
((A == B) OR (A > B)) AND ((A == B) OR (A < C))
(A >= B) AND ((A == B) OR (A < C))
((A >= B) AND (A == B)) OR ((A >= B) AND (A < C))
(A >= B) OR ((A >= B) AND (A < C))
(A >= B) AND (A < C)
B <= A < C

Correct?

Basically, my assumptions are:

(A == B) OR  (A > B)   equals to  A >= B
(A >= B) AND (A == B)  equals to  A >= B
$\endgroup$
1
$\begingroup$

$$(A == B)\ OR\ (\ (A > B)\ AND\ (A < C)\ )$$ $$((A == B)\ OR\ (A > B))\ AND\ ((A == B)\ OR\ (A < C))$$ $$(A >= B)\ AND\ ((A == B)\ OR\ (A < C))$$

So these are your first two steps and I agree with them. But I do not see where you use $B <= C$, which would be key to the solution. $$(A >= B)\ AND\ ((A == \color{RED}{B})\ OR\ (A < C))$$ $$(A >= B)\ AND\ ((A == \color{RED}{<= C})\ OR\ (A < C))$$ $$(A >= B)\ AND\ ((A <= C)\ OR\ (A < C))$$ $$(A >= B)\ AND\ (A <= C)$$ $$B <= A <= C$$

$\endgroup$
  • $\begingroup$ Indeed, good one! $\endgroup$ – Enrique Marcos Jun 23 '16 at 17:58
  • $\begingroup$ I just followed your logic. 8) $\endgroup$ – StainlessSteelRat Jun 24 '16 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.