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.

About these ads

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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: