Harsh but fair

Open source chicanery and the battle with my inner geek

Some Logic

Posted by raetsel on May 1, 2009

Recently on #logic via twitter Pete Lewis asked:-

a || b -> !(!a || !b)) ? #logic makes my brain hurt

I  did a quick truth table on paper and said yes but turns out I was wrong as I had  looked at the wrong columns. Doh! Here’s the truth table and you can see for yourself

 

A B A || B !A !B (!A || !B) !(!A || !B)
FALSE FALSE FALSE TRUE TRUE TRUE FALSE
FALSE TRUE TRUE TRUE FALSE TRUE FALSE
TRUE FALSE TRUE FALSE TRUE TRUE FALSE
TRUE TRUE TRUE FALSE FALSE FALSE TRUE

The colums A || B and !(!A || !B) are not equivalent.

One Response to “Some Logic”

  1. spiderlama said

    !x flips everything in x, so && becomes || and x becomes !x.

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

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>