2

Was given this to figure out. He said its mathematical, no its not homework. More of one guy trying to prove he is smarter than me.

The code:

(!(a&&b)) == |!a||!b|  T
!(a||b) == !a&&!b

I think it might be some symbolic logic, but couldn't figure out from reading about symbolic mathematics from google searches. That is only my guess.

yiyi
  • 7,352
  • 3
    This resembles C code, so I believe '!' means NOT, '&&' means AND , '||' means OR. – Pedro M. Mar 06 '13 at 13:17
  • 3
    Typically && refers to logical AND, || refers to logical or and ! refers to logical not. Not (a AND b) = not A or not B. ie) if a AND b is false, then either a is false or b is false.$$ $$

    The second says not (A or B) = not A and not B. ie) if neither A or B is true, then both A is false, and B is false. As avatar has said, these are de morgan's laws.

    – muzzlator Mar 06 '13 at 13:18
  • @muzzlator I read a mathematical logic book and it never used that notation, could you point me in the direction of some resources that use that notation. – yiyi Mar 06 '13 at 13:20
  • 2
    A great number of programming languages uses this notation. Find a book on say C programming and you'll see it used. – muzzlator Mar 06 '13 at 13:21
  • PLEASE change the title of this question! –  Mar 06 '13 at 16:45
  • 1
    @SteveD that is why there is an edit option. If you can do better then do better. – yiyi Mar 07 '13 at 02:37
  • 2
    Why is the burden on me to edit your question? And why are you giving me attitude? The title is not specific in the least, and doesn't convey any sense of what the question is about. It should be changed (by you). –  Mar 07 '13 at 07:01

2 Answers2

9

This is (almost) DeMorgan's laws written in C-language syntax (though other languages use the same syntax, too). Writing it a bit more tidily, it would be:

!(a && b) = (!a) || (!b)

!(a || b) = (!a) && (!b)

That's not exactly what you wrote, but I expect it's what you meant to write.

I don't know anything about symbolic logic notation, but in set-theoretic notation, the equivalent laws would be:

$$ (A \cap B)^c = A^c \cup B^c $$

$$ (A \cup B)^c = A^c \cap B^c $$

Or, in English (almost):

not(A and B) = (not A) or  (not B)
not(A or  B) = (not A) and (not B)
bubba
  • 43,483
  • 3
  • 61
  • 122
  • 3
    In symbolic logic notation, your answers would be $\neg (A \wedge B) \Leftrightarrow \neg A \vee \neg B$ and $\neg (A \vee B) \Leftrightarrow \neg A \wedge \neg B$. – Joe Z. Mar 06 '13 at 14:09
  • To get those symbols in $\LaTeX$, the following codes can be used: \neg = $\neg$ (not), \wedge = $\wedge$ (and), and \vee = $\vee$ (or). – Joe Z. Mar 06 '13 at 14:26
  • Thanks, Joe. That symbolism did come to mind after a bit of thought, but I figured two versions of the equations were enough, already. – bubba Mar 07 '13 at 04:10
6

This is De Morgan's law. See here.

mez
  • 10,497
Aang
  • 14,672