[Math] Write expressions using only NAND operator and prove logically equivalent

discrete mathematicslogicpropositional-calculus

It can be shown that ~$p \equiv (p \uparrow p)$
and $p \wedge q \equiv (p \uparrow q) \uparrow (p \uparrow q)$. You don’t need to show these. However, write the expressions $p \to q$ and $p \vee q$ using only the nand operator $\uparrow$ and show that they are equivalent via truth table.

A bit confused about this question, I understand truth tables and proving equivalent but I don't understand how to rewrite $p \to q$ and $p \vee q$ using only nand.

Thank you for your help

Best Answer

Hint. Following the suggestion of Mauro Allegranza, first rewrite $p \to q$ as $\neg p \vee q$. Besides, you should know that $p \uparrow q = \neg p \vee \neg q$. Which transformation do you need to pass from $\neg p \vee \neg q$ to $\neg p \vee q$? For the final touch, use the fact that $\neg p = p \uparrow p$. For the second exercise, same idea with $\neg p \vee q$ and $p \vee q$.

Related Question