1
$\begingroup$

Let's have two statements

  1. (value > 10)
  2. (value < 25)

And a list of items with the following values

  • 10
  • 20
  • 30

This is what a truth table would give

Item  Value  (value > 10)  (value < 25)
----  -----  ------------  ------------
1     10     FALSE         TRUE
2     20     TRUE          TRUE
3     30     TRUE          FALSE

Example 1

Where ALL of the following are TRUE
   value > 10
   value < 25

This one is easy and we get the following

Where (value > 10) AND (value < 25)

The result is then a single value of 20

Example 2

Where NONE of the following are TRUE
   value > 10
   value < 25

This is where I am not sure of what to generate.

This would be "simple" as it is only a NOT of the whole expression

Where NOT ((value > 10) AND (value < 25))

However, the result is then two values (10 and 30)

From what someone would think of NONE of the two statements would be something like:

Where NOT ((value > 10) OR (value < 25))

And the result would be that no items are produced.

What is the correct meaning of NONE here?

$\endgroup$
  • 3
    $\begingroup$ The correct meaning is "Where (NOT (value > 10)) AND (NOT (value < 25))". Applying De Morgan's laws we get: "Where NOT ( (NOT(NOT(value > 10))) OR (NOT(NOT(value < 25))) )" and the equivalent result is "Where NOT ((value > 10) OR (value < 25))" :-) $\endgroup$ – Vor Oct 18 '12 at 21:38
  • $\begingroup$ @vor, make an answer out of it.. $\endgroup$ – Ran G. Oct 19 '12 at 2:55
  • $\begingroup$ @vor: Yepp, this is an answer. Please post it as answer. $\endgroup$ – A.Schulz Oct 19 '12 at 7:29
4
$\begingroup$

The correct meaning is:

"Where (NOT (value > 10)) AND (NOT (value < 25))".

Applying one of the De Morgan's laws:

1) P AND Q <=> NOT( (NOT P) OR (NOT Q) )
2) P OR Q <=> NOT( (NOT P) AND (NOT Q) )

we get:

"Where NOT ( (NOT(NOT(value > 10))) OR (NOT(NOT(value < 25))) )"

and the equivalent final result is

"Where NOT ((value > 10) OR (value < 25))" :-)

$\endgroup$

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.