###
Recitation R12
- Propositional Logic (Review)

Spring 2015

**
CS160: Foundations in Programming **

The purpose of this lab is to:
- Review propositional logic and truth tables.
- Review logical equivalences and some definitions.
- Do an equivalence proof two different ways.

**
Create a file called R12.txt and write your solution in it to each of the following problems, one
at a time. When everyone has had a chance to go through the problems, your TA will show you how to
work each problem correctly.
**

- Translate the given statement into propositional logic using the propositions provided:

You can use the wireless network in the airport if you pay the daily fee
or you are a subscriber to the service. Express your answer in terms of
*w*: "You can use the wireless network in the airport," *d*: "You
pay the daily fee," and *s*: "You are a subscriber to the service."

- Use truth tables to prove these equivalences, and state the name:

- p ∧ T is equivalent to p
- p ∧ F is equivalent to F
- p ∧ p is equivalent to p
- p ∨ (p ∧ q) is equivalent to p

- Use De Morgan's law to find the negation of each of the following
conditions in Java, and shown the resulting condition in Java:

- (i < 1 || i > 9)
- (p != false && q == false)

- Show that the following conditional statement is a tautology by
using truth tables.

- ¬p → (p → q)

- Define
*tautology*, *contradiction*, and *contingency*.

- Show the
*converse*, *contrapositive*, and *inverse* of p → q.

- Prove the following logical equivalence using only the logical equivalences
and laws on the Logic Sheet.

p ∨ (¬p ∧ q) ≡ (p ∨ q)

- Prove the logical equivalence above using a truth table.

The TA will check off your answers, also please submit your R12.txt to RamCT to verify your attendance.

© 2015 CS160 Colorado State University. All Rights Reserved.