Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
This resembles C code, so I believe '!' means NOT, '&&' means AND , '||' means OR. – Pedro M. Mar 6 '13 at 13:17
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 6 '13 at 13:18
A great number of programming languages uses this notation. Find a book on say C programming and you'll see it used. – muzzlator Mar 6 '13 at 13:21
@SteveD that is why there is an edit option. If you can do better then do better. – yiyi Mar 7 '13 at 2:37
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). – user641 Mar 7 '13 at 7:01
up vote 9 down vote accepted

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)
share|cite|improve this answer
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 6 '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 6 '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 7 '13 at 4:10

This is De Morgan's law. See here.

share|cite|improve this answer
could you translate it to De Morgan's law. I know the law, but never saw it written like that. – yiyi Mar 6 '13 at 13:19
Pedro and I have translated it in the comments section under the question. – muzzlator Mar 6 '13 at 13:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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