# rose learns.to('code');

## Proofs using Truth Tables

Formulas p and q are logically equivalent iff the truth conditions of p are the same as the truth conditions of q.

p\;\iff\;q\\iff\;\;

## Examples:

Is\;(p\;\wedge\;q)\;\iff\;\neg\;(p\;\vee\;q)?

Therefore, they’re not logically equivalent.

Is\;\neg(p\;\wedge\;q)\;\iff\;(\neg p\;\vee\;\neg q)?

Therefore, they’re logically equivalent.

## Tautology – always true.

Show that (p ∨¬p) is a tautology.

They can be represented in different ways, but pay attention to the pattern.

It’s the same as:

(a\wedge b)\;\vee\;\neg(a\wedge b)

Show that (p ¬p) is always false.

## Exclusive Or (xor) Example

Write the truth table for exclusive or (xor), (p ⊕ q), then state whether (p⊕p)⊕p is a tautology, contradiction, or neither.

Give the truth table for (p⊕q)(p⊕¬q)

## Sheffer Stroke Examples

p↑q is to be read as “p nand q”, and is equivalent to ¬(pq). Provide the truth table for (p↑q) and (p↑p).

sheffer stroke – ↑

Also read as “nand” or not and (¬)

p\uparrow q\;=\;\neg(p\wedge q)

This idea above can be used in the well-formed formula Phi. And say we want the negation of it, this is similar with taking Phi and Phi, and combining the two with Sheffer Stroke.

\neg \phi\;\iff\;\phi\uparrow\phi

Following the concept above for Phi, using the sheffer stroke, provide a definition for (pq).

p\uparrow q\;\iff\;\neg(p\wedge q)\\We\;know \;that\;(p\wedge q)\;\iff\;\neg\neg(p\wedge q)\;=\;\neg(p\uparrow q)\\Which\;is\;similar\;to\;our\;Phi\;above:\\\neg\phi\iff\phi\uparrow\phi\\Therefore:\\\neg(p\uparrow q)\;=\;(p\uparrow q)\uparrow(p\uparrow q)

I have to remember that p∧q means both p and q must be true. I always forget this.

Following the same concept above, using the sheffer stroke, provide a definition for (pq).

(p\vee q)\iff \neg\neg p\;\vee\;\neg\neg q\\\neg(\neg p\;\wedge\;\neg q)\;=\;\neg(p\wedge q)\\\neg p\;=\;\neg(p\wedge p)\;=(p\uparrow p)\\=\;\neg((p\uparrow p)\;\wedge(q\uparrow q))\\Therefore:\\(p\;\vee\;q)\;\iff\;(p\uparrow p)\uparrow (q\uparrow q)