Académique Documents
Professionnel Documents
Culture Documents
Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)
SOLUTIONS
1. Construct a truth table for the following compound proposition: (p q) (p q)
Solution
p q (p q) (p q)
0 0
0
0 1
1
1 0
1
1 1
1
2. Which of the following statements are tautologies?
(p q) (p q)
(p q) ((p q))
(p q) (p q)
Solution
Method 1: Use truth tables.
Method 2: Reason about it:
1) Yes, each of (p q) and (p q) is false if and only if p is true and q is false.
2) Yes, it follows from 1), De Morgans law and double negation law:
(p q) (p q)
(p q) ((p q))
(p q) ((p q))
(p q) ((p q))
3) No, if we set p = 0, q = 1 then the formula turns into 0.
3. Show that (p r) (q r) and (p q) r are logically equivalent.
Method 1: Use truth table.
(definition of )
(distributivity)
(De Morgan)
(definition of )
2:
r p (q r) ((p q) r) (p (q r) ((p q) r))
0
0
1
1
0
1
0
0
1
1
0
1
0
0
1
1
1
0
0
0
1
1
1
0
We see that the third column is 1 if and only if p r. Thus our expression is equivalent
to p r.
6. Prove that you can infer p from p q and q.
Solution
Build a truth table of (p (p q)) q and observe that this statement is a tautology.
7. There are two tribes living on the island of Knights and Knaves: knights and knaves.
Knights always tell truth and knaves always lie. You encounter two people A and B.
What are A and B if A says If B is a knight then I am a knave!.
Solution
2
t (premise)
(q s) t (premise)
(q s) (modus tollens)
q s (De Morgans law)
q (simplification)
p q (premise)
p (modus tollens)
Steps
Reasons
1) s u
2) u
3) u t
4) t
5) s
6) s t
7) r (s t)
8) (s t) r
9) (s t) r
10) r
11) (p q) r
12) r (p q)
13) r (p q)
4
14) p q
15) p
Solution
Steps
1) s u
2) u
3) u t
4) t
5) s
6) s t
7) r (s t)
8) (s t) r
9) (s t) r
10) r
11) (p q) r
12) r (p q)
13) r (p q)
14) p q
15) p
Reasons
premise
conjunctive simplification to Step 1
premise
modus ponens to Steps 2 and 3
conjunctive simplification to Step 1
rule of conjunction to Steps 4 and 5
premise
contrapositive to Step 7
DeMorgans law to Step 8
modus ponens to Steps 6 and 9
premise
contrapositive to Step 11
DeMorgans law to Step 12
modus ponens to Steps 10 and 13
conjunctive simplification to Step 14.