Recitation R10
- Topic
Fall 2013
CS160: Foundations in Programming
The purpose of this lab is to learn propositional logic:
- What is propositional logic?
- Solve problems inovlving propositional logic
1. Problems involving propositional logic
Solve 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 correctly.
- Which of these are propositions? What are the truth values
of those that are propositions?
- Do not pass go.
- What time is it?
- 4 + x = 5
- The capital of Colorado is Denver.
- The moon is made of green cheese.
- 6*2=13
- Let p and q be the propositions
p: The election is decided.
q: The votes have been counted
Express each of these compound propositions as an English sentence.
- ¬p
- ¬p ∧ q
- p ∨ q
- q → p
- ¬q → ¬p
- ¬p → ¬q
- p ↔ q
- ¬q ∨ (¬p ∧ q)
- Let p and q be the propositions
p: You drive over 65 miles per hour.
q: You get a speeding ticket.
Write these propositions using p and q and logical connectives.
- You do not drive over 65 mph.
- You drive over 65 mph, but you do not get a speeding ticket.
- You will get a speeding ticket if you drive over 65 mph.
- If you do not drive over 65 mph, then you will not get a speeding ticket.
- Driving over 65 mph is necessary and sufficient for getting a speeding ticket.
- You get a speeding ticket, but you do not drive over 65 mph.
- Whenever you get a speeding ticket, you are driving over 65 mph.
- Complete truth table for the following statements:
- (p ∧ q)
- (q ∨ r)
- (¬r ⊕ s)
- (p ∧ q) ∨ (¬q ∧ r)
Show your work to the TA for grading and to get credit for this lab.
© 2013 CS160 Colorado State University. All Rights Reserved.