# CS 2603 Homework 2 — WFFs and Truth Tables

## Due Wednesday, Feb 2, 2011

NOTE: This assignment is due at the beginning of the class period. This means that if you are even a minute late, you lose 20%. If you are worried about potentially being late, turn in your assignments ahead of time. Do this by submitting them to me during office hours or by sliding them under my office door. Do not send assignments to me through email or leave them in my departmental mail box.

## 1. Motivation

Well-formed formulas (WFFs) and truth tables are fundamental tools of formal logic and circuit diagrams are fundamental tools of electical engineering. To understand these tools and their relationship to one another, it is import to gain experience with them.

## 2. Goal

The goal of this assignment is to give you experience with WFFs, truth tables, circuit diagrams, and their relationship to one another.

## 3. Assignment

1. For each of the following expressions, attempt to match each of its components with one of the WFF syntax rules, starting with the whole expression and working your way down to atomic formulas. The result should be a tree similar to those shown in Lecture 2. If you successfully reach an atomic formula for each component, declare that the expression is a WFF. If some component cannot be matched with a WFF syntax rule, declare that the expression is not a WFF.

1. ((P ∧ Q) → Q)
2. ((P ∨ Q) → P)
3. (((¬ P) ∨ P) → (Q ∧ (¬ Q)))
4. ((A ∨ A) → B)
5. (Q ∨ ((¬ (¬ P)) ∧ (Q ∧ P)))
6. ((¬ (Q ∧ P)) ↔ (Q Q))
7. (Q ↔ True)
8. (((P ∧ Q) ∧ R) ∨ ((R ∧ Q) ∨ P))
9. (((P ¬ Q) → P) → Q)
10. ¬ P ∧ Q ∨ P

2. For each WFF above, give a truth table. Each truth table should have the minimum number of rows to show all possible combinations of truth values of its atomic formulas. It should have columns on the left for these atomic formulas and a column on the right for the WFF itself. In between, it should have columns for all subformulas of the WFF ordered by working bottom to top and left to right up the tree you constructed for this WFF in Part 1 of this assignment.

At the end of each truth table, say whether the corresponding WFF is tautological, contradictory, or satisfiable but not tautological.

3. Convert the truth tables for WFF (a), (e), and (h) above into EE notation and draw their circuit diagrams.

4. Convert the circuit diagram for (e), which you constructed in Part 3 of this assignment, into a circuit diagram that uses NAND gates only.

## 4. What to Turn In

You will turn in a typed or neatly written hard copy of your homework that answers the questions above.