Solutions-Propositional Logic
Solutions-Propositional Logic
• E=Liron is eating
• H=Liron is hungry
(a) E ⇒ ¬H
Answer: If Liron is eating, then Liron is not hungry
(b) E ∧ ¬H
Answer: Liron is eating and not hungry
(c) ¬(H ⇒ ¬E)
Answer: Liron is hungry and eating
7) Prove that P ∧ Q |= P ∨ Q.
Answer:
P Q P ∧Q P ∨Q
t t t t
t f f t
f t f t
f f f f
Since every interpretation that satisfies P ∧ Q also satisfies P ∨ Q, it holds that
P ∧ Q |= P ∨ Q.
8) Consider the following popular puzzle. When asked for the ages of her three chil-
dren, Mrs. Baker says that Alice is her youngest child if Bill is not her youngest
child, and that Alice is not her youngest child if Carl is not her youngest child.
Write down a knowledge base that describes this riddle and the necessary back-
ground knowledge that only one of the three children can be her youngest child.
Show with resolution that Bill is her youngest child.
Answer:
Let the propositions A, B and C denote that Mrs. Baker’s youngest child
is Alice, Bill and Carl, respectively. We have the following clauses for the
background knowledge:
5 B ∨ A (Alice is her youngest child if Bill is not her youngest child. That
is, ¬B ⇒ A.)
6 C ∨ ¬A (Alice is not her youngest child if Carl is not her youngest child.
That is, ¬C ⇒ ¬A.)
We want to show that Bill is the youngest child. Negating this, we get the
following clause:
8 (from 5,7) A
9 (from 3,6) ¬A
10 (from 8,9) ⊥
9) Consider the following popular puzzle. A boy and a girl are talking. “I am a
boy” said the child with black hair. “I am a girl” said the child with white hair.
At least one of them is lying. Write down a knowledge base that describes this
riddle. Show with resolution that both of them are lying.
Answer:
1 Bb ∨ Wb (“A boy and a girl are talking” means that at least one of them
has to be a boy.)
2 ¬Bb ∨ ¬Wb (With the same logic, at least one of them has to be a girl.)
3 ¬Bt ∨ Bb (If the black haired child is telling the truth, it has to be a boy.
That is, Bt ⇒ Bb .)
4 Bt ∨ ¬Bb (If the black haired child is lying, it has to be a girl. That is,
¬Bt ⇒ ¬Bb .)
5 ¬Wt ∨ ¬Wb (If the white haired child is telling the truth, it has to be a
girl. That is, Wt ⇒ ¬Wb .)
6 Wt ∨ Wb (If the white haired child lying, it has to be a boy. That is,
¬Wt ⇒ Wb .)
7 ¬Bt ∨ ¬Wt (At least one of them is lying.)
We want to show that both of them are lying. That is, ¬Bt ∧ ¬Wt . Negating
this, we get the following clause:
9 (from 3,8) Bb ∨ Wt
10 (from 5,9) Bb ∨ ¬Wb
11 (from 1,10) Bb
12 (from 2,10) ¬Wb
13 (from 4,11) Bt
14 (from 6,12) Wt
15 (from 7,13) ¬Wt
16 (from 14,15) ⊥
10) In the back of a magazine you find a riddle: “Suppose that liars always speak
what is false, and truth-tellers always speak what is true. Further suppose that
Amy is either a liar or a truth-teller.” The riddle then provides some additional
facts about Amy and asks whether Amy has to be a truth-teller. Excitedly, you
encode the facts in propositional logic and implement a resolution procedure on
your computer. Since you do not make any mistakes, the computer will give
you the correct answer. You ask the computer whether the facts entail that
Amy is a truth-teller.
a) The computer tells you that the facts entail that Amy is a truth-teller. Since
the text states that Amy is either a liar or a truth-teller, can you conclude that
Amy is not a liar?
Answer: Yes. You know that Amy has to be a truth-teller (if the facts are
true). So, she cannot be a liar according to the text.
b) The computer tells you that the facts do not entail that Amy is a truth-teller.
Since the text states that Amy is either a liar or a truth-teller, can you conclude
that Amy is a liar?
Answer: No. It could indeed be the case that Amy is not a truth-teller and
thus a liar (if the facts are true) but you do not know this for sure. It could also
be the case that the computer does not have sufficient information to conclude
whether Amy is a truth-teller or a liar. If you want to know whether Amy has
to be a liar, you need to ask the computer whether the facts entail that Amy
is a liar. If the computer tells you that the facts entail that Amy is a liar, then
you know that Amy has to be a liar (if the facts are true).