CS 228 Tut1 Sol
CS 228 Tut1 Sol
Problem Sheet 1
S. Krishna
• A says “I did not do it. The victim was an old acquaintance of B’s. But C hated him.”
• B states “I did not do it. I did not even know the guy. Besides I was out of town all
that week.”
• C says “I did not do it. I saw both A and B downtown with the victim that day; one of
them must have done it.”
Assume that the two innocent men are telling the truth, but that the guilty man might not
be. Who did it? Deduce the answer by encoding in propositional logic and finding a solution.
Solution
All three of them say, “I did not do it”. So, this does not give any useful information
to us. (Why?) Let us define the following propositions:
p1 : victim is acquaintance of B
a ∧ b = (p1 ∧ (¬p1 ∧ p2 )) ≡ ⊥
b ∧ c = ((¬p1 ∧ p2 ) ∧ ¬p2 )) ≡ ⊥
Hence, c ∧ a is true ⇒ c is true and a is true ⇒ B is guilty
2. In an island, there are three tribes : the Knights, Knaves and Normals. The Knights always
speak truth, the Knaves always lie, while the Normals lie sometimes and speak truth some-
times. On a visit to this island, I met two inhabitants A and B. A told me that B is a knight
and B told me that A is a knave. Prove, using natural deduction, that one of them told the
truth but is not a knight, or that one of them told a lie but is not a knave.
Solution
Note that if B is a knight, then A must be a knave, which makes her statement that
B is a knight false, which contradicts the fact that B is a knight. Therefore B is not
1
a knight. This means A’s statement is false, which means A is also not a knight. So
both are either normals or knaves, and A’s statement is false. Let us take some cases
now:
(a) If A is a knave, then B’s statement is true, which means B must be a normal.
This means one of them (B) told the truth but is not a knight.
(b) If B is a knave, then A must be a normal. This means one of them (A) told a lie
but is not a knave.
(c) If both A and B are normals, then both their statements are false, which means
one of them (either) told a lie but is not a knave.
Therefore, by cases, we can say that one of them told the truth but is not a knight, or
that one of them told a lie but is not a knave.
This natural language proof can also be directly translated into a formal proof.
3. Let F , G and H be formulas and let S be a set of formulas. Which of the following statements
are true? Justify your answer.
Solution
2
4. The Pigeon Hole Principle states that if there are n + 1 pigeons sitting amongst n holes then
there is atleast one hole with more than one pigeon sitting in it. For i ∈ {1, 2, .., n + 1} and
j ∈ {1, 2, ..., n}, let the atomic proposition P (i, j) indicate that the i-th pigeon is sitting in
the j-th hole.
Write out a propositional logic formula that states the Pigeon Hole Principle.
Solution
Let P (i, j) represent the proposition that the ith pigeon is sitting in the j th hole, where
i ∈ {1 . . . n + 1} and j ∈ {1 . . . n}.
The Pigeonhole principle states that, if there are n + 1 pigeons and n holes, and every
pigeon sits in exactly one hole, then there is a hole occupied by more than one pigeon.
To convert this into a PL formula, let us convert each side of the implication into PL
first.
Every pigeon sits in at least one hole can be expressed in PL as:
n+1
^ _ n
P (i, j)
i=1 j=1
Here the inner disjunction refers to the ith pigeon sitting in some hole, and the outer
conjuction makes it so that every pigeon must sit in some hole. Call this condition F .
We also need no pigeon to sit in multiple holes. Say pigeon i sits in holes j and k with
j < k. The formula P (i, j) ∧ P (i, k) represents this scenario. There exists a pigeon
sitting in multiple holes therefore becomes:
n+1
_ n
_
(P (i, j) ∧ P (i, k))
i=1 j,k=1
j<k
Here, the inner disjunction refers to the ith pigeon sitting in multiple holes and the
outer disjunction refers to there existing a pigeon sitting in multiple holes.
Negating this, we get the condition for no pigeon to sit in multiple holes:
n+1
^ n
^
(¬P (i, j) ∨ ¬P (i, k))
i=1 j,k=1
j<k
Here, the inner disjunction refers to the k th hole being occupied by more than one
pigeon and the outer disjunction refers to there existing a hole occupied by multiple
pigeons. Call this condition H.
The Pigeonhole Principle therefore becomes:
F ∧ G =⇒ H
3
5. Prove formally ⊢ [(p → q) → q] → [(q → p) → p]
Solution
1. (p → q) → q assumption
2. q→p assumption
3. ¬p assumption
4. ¬q MT 2, 3
5. ¬(p → q) MT 1, 4
6. p assumption
7. ⊥ ⊥i 3, 6
8. q ⊥e 7
9. p→q → i 6-8
10. ⊥ ⊥i 5, 9
11. ¬¬p ¬i 3, 10
12. p ¬¬e 11
13. (q → p) → p → i 1-12
14. ((p → q) → q) → ((q → p) → p) → i 1-13
Solution
1. H premises
2. A→B as H ⊢ (A → B)
3. C ∨A as H ⊢ (C ∨ A)
4. C assumption
5. B∨C ∨i 3
6. A assumption
7. B MP 1, 5
8. B∨C ∨i 6
9. B∨C ∨e 2, 3-4, 5-7
4
Solution
1. H premises
2. A→C as H ⊢ (A → C)
3. B→C as H ⊢ (B → C)
4. A∨B assumption
5. A assumption
6. C MP 1, 4
7. B assumption
8. C MP 2, 6
9. C ∨e 3, 4-5, 6-7
10. (A ∨ B) → C → i 3-8
(. . . (x1 ↔ x2 ) ↔ · · · ↔ xn )
Solution
Base Case. For n = 1, the wff will be (x1 ), which is true iff α(x1 ) = true.
Induction Hypothesis. Assume α satisfies the wff (. . . (x1 ↔ x2 ) ↔ · · · ↔ xn−1 ) iff
α(xi ) = false for an even number of i’s, 1 ≤ i ≤ n − 1.
Now consider (. . . (x1 ↔ x2 ) ↔ · · · ↔ xn ). Here, α(xn ) can be true or false.
(a) x ↔ y
(b) (¬((x ↔ y) → (¬y → x))))
(c) ((¬x ∨ y) ∧ (x ∨ ¬y))
5
Solution
10. Let L be a formulation of propositional logic in which the sole connectives are negation and
disjunction. The rules of natural deduction corresponding to disjunction and negation (also
includes double negation) are available. For any wffs A, B and C, let ¬(A ∨ B) ∨ (B ∨ C) be
an axiom of L. Show that any wff of L is a theorem of L.
Solution
An axiom of a proof system is a formula that can always be taken as true. A theorem
is a logical consequence of axioms, i.e a wff in a proof system is a theorem if it can be
derived from axioms using the proof rules of the system. Let P be any wff of L. We
shall apply the axiom by choosing A = ¬P , B = ⊥ and C = P .
6
1. ¬(¬P ∨ ⊥) ∨ (⊥ ∨ P ) premise (axiom)
2. ¬(¬P ∨ ⊥) assumption
3. ¬P assumption
4. ¬P ∨ ⊥ ∨i 3
5. ⊥ ⊥i 2, 4
6. ¬¬P ⊥e 3-5
7. P ¬¬e 6
8. (⊥ ∨ P ) assumption
9. ⊥ assumption
10. P ⊥e
11. P assumption
12. P ∨e 8, 9-10, 11
13. P ∨e 1, 2-7, 8-12
11. Let P denote propositional logic. Suppose we add to P the axiom schema (A → B) for wffs
A, B of P. Comment on the consistency of the resulting logical system obtained. A logic
system P is inconsistent if it is capable of producing ⊥ using the rules of natural deduction.
Solution
The resulting logical system is inconsistent, since we can produce ⊥ as follows. Let φ be any
wff of P.