Recitation R10
- Propositional Logic
Spring 2014
CS160: Foundations in Programming
The purpose of this lab is to learn propositional logic:
- What is propositional logic?
- Solve problems involving propositional logic
1. Problems involving propositional logic
Solve the following problems in a text file called R10.txt, using an editor such as gedit.
Your TA will go over them when everyone has completed the problems.
- Which of these are propositions? What are the truth values
of those that are propositions?
- Do not drive too fast.
- What time is it in New York?
- 3 * x = 15
- The capital of Utah is Moab.
- The moon is made of green cheese.
- 6 * 3 = 18
- Let p and q be the propositions:
p: The midterm has been graded.
q: The scores have been posted.
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.
- Create a complete truth table for the following statements:
- (p ∧ q)
- (q ∨ r)
- (¬r ⊕ s)
- (p ∧ q) ∨ (¬q ∧ r)
The TA will check off your answers, also please submit your R10.txt to RamCT to verify your attendance.
© 2014 CS160 Colorado State University. All Rights Reserved.