0% found this document useful (0 votes)
5 views

solutions-Propositional_Logic

Practice questions of introduction to logic

Uploaded by

Nermeen Kamel
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

solutions-Propositional_Logic

Practice questions of introduction to logic

Uploaded by

Nermeen Kamel
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Introduction to Logic

Mid Term Sample


Questions

1) Translate the following Propositional Logic to English sentences.


Let:
• 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

2) Translate the following English sentences to Propositional Logic.


Propositions: (R)aining, Liron is (S)ick, Liron is (H)ungry, Liron is (HA)appy,
Liron owns a (C)at, Liron owns a (D)og
(a) It is raining if and only if Liron is sick
Answer: R ⇔ S
(b) If Liron is sick then it is raining, and vice versa
Answer: (S ⇒ R) ∧ (R ⇒ S) (which is equivalent to R ⇔ S)
(c) It is raining is equivalent to Liron is sick
Answer: R ⇔ S
(d) Liron is hungry but happy
Answer: H ∧ HA
(e) Liron either owns a cat or a dog
Answer: (C ∧ ¬D) ∨ (¬C ∧ D)
3) Which of the following propositions are tautologies? Which are contradictions?
Why?

(a) Three is a prime number.


Answer: neither a tautology nor a contradiction
(b) It is raining or it is not raining.
Answer: tautology
(c) It is raining (P ) and it is not raining (¬P ).
Answer: contradiction
Example reasoning:
All rows in the truth table evaluate to false.
P P ∧ ¬P
t f
f f

4) Which of the following propositions are tautologies? Why?


(a) P
Answer: not a tautology
(b) P ⇒ P
Answer: tautology
(c) (P ⇒ P ) ⇒ P
Answer: not a tautology
Example reasoning:
Not all rows in the truth table evaluate to true.
P P ⇒ P (P ⇒ P) ⇒ P
t t t
f t f
(d) P ⇒ (P ⇒ P )
Answer: tautology
5) Which of the two following propositions are equivalent in the sense that one
can always be substituted for the other one in any proposition without changing
its truth value? Why?

(a) first proposition:P ⇒ Q second proposition: ¬P ∨ Q


Answer: yes
Example reasoning:
All rows in the truth table evaluate to the same truth value.
P Q P⇒Q ¬P∨Q
t t t t
t f f f
f t t t
f f t t
(b) first proposition: ¬P second proposition: P ⇒ False
Answer: yes
(c) first proposition: ¬P second proposition: False ⇒ P
Answer: no
(d) first proposition: ¬P second proposition: ¬P ∨ Q
Answer: no
6) Is Say whether each of the following sentences is valid, contingent, or
unsatisfiable. (Quiz 1 Answers Hint by using truth table)
p ∨ (p ⇒ q) 7) I
¬p ∨ ¬q ⇒ p ∧ q
a. Valid
f
(p ⇒ ¬p) ∨ (¬q ⇒ ¬q) ⇒ (p ⇔ q)
b. Contingent

(p ∨ (¬p ∧ q)) ⇔ (¬p ∧ ¬q)


c. Contingent

(((p ∧ q) ⇒ r) ∧ (p ⇒ q)) ⇒ (p ⇒ r)
d. Unsatisfiable

(p ∨ q) ∧ (¬p ∨ ¬q)
e. Valid

(p ⇒ p) ⇒ p
f. Contingent

((p ⇒ q) ⇒ p) ⇒ (q ⇒ p)
g. Contingent

(¬p ∧ q) ⇔ (p ⇒ q)
h. valid

(p ⇒ ¬q) ⇒ (q ⇒ ¬p)
i. contingent
j. valid
so, provide an example. If not, explain why it is impossible.

8) Prove that P A Q |= P V Q.
Answer:
P Q PAQ PV
Q
t t t t
t f f t
f t f t
f f f f
Since every interpretation that satisfies P A Q also satisfies P V Q, it holds that
P A Q |= P V Q.
9) 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:
1 A V B V C (One child has to be the youngest.)
2 ¬A V ¬B (Alice and Bill cannot both be the youngest.)
3 ¬A V ¬C
4 ¬B V ¬C
The following clauses represent the information from Mrs. Baker:

5 B V A (Alice is her youngest child if Bill is not her youngest child. That
is, ¬B ⇒ A.)
6 C V ¬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:
7 ¬B (Assume that Bill is not the youngest child.)
We use resolution to derive the empty clause as follows:

8 (from 5,7) A
9 (from 3,6) чA
10 (from 8,9) ⊥

10) 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:

We use the following propositions:


• Wt: White haired child is telling the truth.
• Wb: White haired child is a boy.
• Bt: Black haired child is telling the truth.
• Bb: Black haired child is a boy.
We have the following clauses;
1 Bb V Wb (“A boy and a girl are talking” means that at least one of them
has to be a boy.)
2 ¬Bb V ¬Wb (With the same logic, at least one of them has to be a girl.)
3 ¬Bt V Bb (If the black haired child is telling the truth, it has to be a boy.
That is, Bt ⇒ Bb.)
4 Bt V ¬Bb (If the black haired child is lying, it has to be a girl. That is,
¬Bt ⇒ ¬Bb.)
5 ¬Wt V ¬Wb (If the white haired child is telling the truth, it has to be
a girl. That is, Wt ⇒ ¬Wb.)
6 Wt V Wb (If the white haired child lying, it has to be a boy. That is,
¬Wt ⇒ Wb.)
7 ¬Bt V ¬Wt (At least one of them is lying.)
We want to show that both of them are lying. That is, ¬Bt A ¬Wt. Negating
this, we get the following clause:
8 Bt V Wt (Assume that at least one of them is telling the truth.)
We use resolution to derive the empty clause as follows:
9 (from 3,8) Bb V Wt
10 (from 5,9) Bb V ч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) ⊥
11) 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).

12) By using linear proof prove the following


Given p and (p ⇒ q) and ((p ⇒ q) ⇒ (q ⇒ r)), prove r.
Given (p ⇒ q) and (q ⇒ r), prove (p ⇒ r).
a.
b.
c. Given p and ¬p, prove q.
d. Given ¬¬p, prove p

You might also like