DeMorgan's Theorem
Suppose I just bought ice cream. Then I'd be lying, since I told you I'd also get cookies. Similarly, if I bought just cookies, then I didn't buy ice cream. Certainly, I'm lying if I don't buy you anything. Thus, I am lying if "I don't buy you ice cream OR I don't buy you cookies".
This OR is considered inclusive.
If I had said "I am going to buy you ice cream OR I am going to buy you cookies", I could also buy both.
Now let's consider the negation of the OR statement. When would I be lying?
Suppose I just bought ice cream. That's OK, because I said I'd buy one or the other. Suppose I bought cookies. That's fine too. Suppose I bought both ice cream and cookies. Well, you can't say I lied, right? What if I didn't buy either? Then, I'm lying.
So the negation of the OR statement is "I am not going to buy you ice cream AND I am not going to buy you cookies".
Both these equivalences make up DeMorgan's Theorem.
- ! ( exprleft && exprright ) is equivalent to ! exprleft || ! exprright )
- ! ( exprleft || exprright ) is equivalent to ! exprleft && ! exprright )
No comments:
Post a Comment