### Procedure Solver

Can you think like a computer and work out what this flow diagram does?

### Not Another NAND!

Prove that you can make any type of logic gate using just NAND gates.

### Mind Your Ps and Qs

Sort these mathematical propositions into a series of 8 correct statements.

# Notty Logic

##### Age 16 to 18Challenge Level

Patrick from Woodbridge school sent us his thoughts, which were artfully clear, in which he reduced each sentence to a clear logical statement which could then be NOTted:

Using de Morgan's law that NOT(A and B) = NOT(A) OR NOT(B) and assuming that Bad means NOT(GOOD):

1. A good pet is friendly and furry is equivalent to

GOOD = Friendly AND Furry

so

NOT GOOD = NOT(Friendly AND Furry)

Using de Morgan's law

NOT GOOD = NOT(friendly) OR NOT(furry)

so d) A bad pet (NOT good) is unfriendly (NOT friendly) OR unfurry (NOT furry).

2. That man is lying or I'll eat my hat

Let X = Lying OR hat

NOT(X)

= NOT(lying OR hat)

= NOT[NOT(lying) AND NOT(hat)]

= NOT(truth AND NOT(hat))

so A. That man is telling the truth and I won't eat my hat

3. If you don't go to the party and if John goes to the party then I won't go to the party

IF [NOT(you) AND john] THEN NOT(me)

so IF NOT[NOT(you) AND john] THEN NOT[NOT(me)] IF you OR NOT(john) THEN me

If you go to the party, or if John does not go to the party, then I will go to the party.

4. Twas brillig, and the slithy toves Did gyre and gimble in the wabe.

Let X = brillig AND gyre AND gimble

Then
NOT(X)
= NOT(brillig AND gyre AND gimble)
= NOT(brillig) OR NOT(gyre) OR NOT(gimble)

so Twasn't brillig, or the slithy toves did not gyre or gimble in the wabe.

Steve used truth tables to work out the negations, making use of NOT(X) is True if and only if X is false

Enumerating the possible combinations for friendly/furry we see that a good pet corresponds to a single row in the truth table. A bad pet is found by negating this.

 Friendly Furry Good Pet Bad Pet 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0

We can see that this corresponds to 'A bad pet is not friendly or not furry' because it has the same truth table values as the Bad Pet column:

 Friendly Furry Not Friendly Not Furry (Not Friendly) OR (Not Furry) 0 0 1 1 1 0 1 1 0 1 1 0 0 1 1 1 1 0 0 0

For the second part, it is confusing because going/not going are opposites. To be clear, the statement is

X: If you don't go to the party and if John goes to the party then I won't go to the party.

This is a little ambiguous because it does not say that I will go to the party in all other cases. I will assume that this is the case, which quickly gives the truth table for me going as:

 You go John goes You don't go I go (according to rule X) 0 0 1 1 0 1 1 0 1 0 0 1 1 1 0 1

 You go John Goes I go (according to rule NOT(X)) 0 0 0 0 1 1 1 0 0 1 1 0

There is only 1 case in which I go now. This is logically the same as If you go to the party, or if John does not go to the party, then I will go to the party.

It is also the same as I won't go if John doesn't go or if you go.