Академический Документы
Профессиональный Документы
Культура Документы
NOT
NO
ALL
SOME
ONLY
No integer is even
Restate it as : For every object x in the universe, x is not even
Answer : (x) (E(x))
10
Exercise
1. Logic, Proofs
Exercise 1.
1. Let p, q, and r be the propositions
p : You have the flu.
q : You miss the final examination
r : You pass the course
Express each of these propositions as an English sentence.
(a) (pr)(qr)
(b) (pq) (qr)
Answer
(a) (pr) : If you have the flu, then you cannot pass the course.
(qr) : If you miss the final examination, then you cannot pass the
course.
(pr)(qr)
: It is either the case that if you have the flu then you cannot pass
the course or the case that if you miss the final exam then you
cannot pass the course.
AI & CV Lab, SNU
12
Exercise 1.
1. Let p, q, and r be the propositions
p : You have the flu.
q : You miss the final examination
r : You pass the course
Express each of these propositions as an English sentence.
(a) (pr)(qr)
(b) (pq) (qr)
Answer
(b)
(pq)
(qr) : you dont miss the final examination and you pass the course
(pq) (qr)
: Either you have the flue and miss the final exam, or you dont
miss the final exam and do pass the course.
13
Exercise 2.
2. Let p, q, and r be the propositions
p : You get an A on the final exam.
q : You do every exercise in this book
r : You get an A in this class
Write these propositions using p, q and r and logical connectives.
Answer
(a) You get an A on the final, but you dont do every exercise in this book;
nevertheless, you get an A in this class.
You get an A on the final : p
14
Exercise 2.
2. Let p, q, and r be the propositions
p : You get an A on the final exam.
q : You do every exercise in this book
r : You get an A in this class
Write these propositions using p, q and r and logical connectives.
Answer
(b) Getting an A on the final and doing every exercise in this book is sufficient
for getting an A in this class.
Getting an A on the final : p
and :
Doing every exercise in this book : q
sufficient for :
Getting an A in this class : r
(p q) r
AI & CV Lab, SNU
15
Exercise 3.
3. Assume the domain of all people.
Let J(x) stand for x is a junior,
S(x) stand for x is a senior,
and L(x, y) stand for x likes y.
Translate the following into well-formed formulas:
Answer
(a) All people like some juniors.
(x)(y) ?
(y)(J(y)L(x,y))
(x)(y)(J(y)L(x,y))
16
Exercise 3.
3. Assume the domain of all people.
Let J(x) stand for x is a junior,
S(x) stand for x is a senior,
and L(x, y) stand for x likes y.
Translate the following into well-formed formulas:
Answer
(b) Some people like all juniors.
(x)(y) ?
(y)(J(y)L(x,y))
(x)(y)(J(y)L(x,y))
17
Exercise 3.
3. Assume the domain of all people.
Let J(x) stand for x is a junior,
S(x) stand for x is a senior,
and L(x, y) stand for x likes y.
Translate the following into well-formed formulas:
Answer
(c) Only seniors like juniors.
(x)(y) ?
(x)(y)((J(y)L(x,y)) S(x))
18
Exercise 4.
4. Let B(x) stand for x is a boy, G(x) stand for x is a girl,
and T(x,y) stand for x is taller than y.
Complete the well-formed formula representing the given
statement by filling out ? part.
Answer
(a) Only girls are taller than boys: (?)(y)((? T(x,y)) ?)
19
Exercise 4.
4. Let B(x) stand for x is a boy, G(x) stand for x is a girl,
and T(x,y) stand for x is taller than y.
Complete the well-formed formula representing the given
statement by filling out ? part.
Answer
(b) Some girls are taller than boys: (x)(?)(G(x) (? ?))
20
Exercise 4.
4. Let B(x) stand for x is a boy, G(x) stand for x is a girl,
and T(x,y) stand for x is taller than y.
Complete the well-formed formula representing the given
statement by filling out ? part.
Answer
(c) Girls are taller than boys only: (?) (y)((G(x) ?) ?)
Recall; Only girls are taller than boys.
(x)(y)((B(y) T(x,y)) G(x))
21
Exercise 4.
4. Let B(x) stand for x is a boy, G(x) stand for x is a girl,
and T(x,y) stand for x is taller than y.
Complete the well-formed formula representing the given
statement by filling out ? part.
Answer
(d) Some girls are not taller than any boy: (x)(?)(G(x) (? ?))
some people are taller than any boy : (x)(y) (B(y) T(x,y))
some people are not taller than any boy : (x)(y) (B(y) T(x,y))
(x)(y)(G(x) (B(y) T(x,y)))
22
Exercise 4.
4. Let B(x) stand for x is a boy, G(x) stand for x is a girl,
and T(x,y) stand for x is taller than y.
Complete the well-formed formula representing the given
statement by filling out ? part.
Answer
(e) No girl is taller than any boy: (?)(y)((B(y) ?) ?)
all people are not taller than any boy: (x)(y)((B(y)) T(x,y))
all girls are not taller than any boy: (x)(y)((G(x) B(y) ) T(x,y))
or (x)(y)(G(x)(B(y) T(x,y))
(x)(y)((B(y) G(x)) T(x,y))
23
Exercise 5.
5. Prove formally using inference rules that R(PQ) logically follows
from (PQ), (QR), (PM), and M.
Answer
(1) PM
(2) M
(3) P
(4) PQ
(5) Q
(6) QR
(7) R
I11 : P , PQ Q
(8) R(PQ)
I9 : P , Q P Q
I12 : Q, PQ P
I10 : P , P Q Q
24
Exercise 6.
6. Prove that if n is a positive integer, then n is a even if and only if
7n+4 is even
Answer
Prove if n is even, then 7n+4 is even
If n is even, then n = 2k where k {1, 2, 3, }
7n + 4 = 7 * 2k + 4 = 2(7k+2)
n is even
Prove if 7n+4 is even, then n is even
If n is odd, 7n+4 is odd
If n even (odd), then
7n+4 = 7(2k+1)+4
= 14k + 11
= 2(7k+5)+1
7n+4 is odd
From and , n is even if and only if 7n+4 is even
AI & CV Lab, SNU
25
Exercise 7.
7. Let P, Q, R and S be statement variables.
Prove formally the following.
(a) P Q, QR, RS P S
(b) P (PQ) Q
Answer
(a) PQ, QR, RS P S
(1) PQ
(2) QR
(3) RS
(4) PQ
(5) QR
(6) PR
(7) PS
E16 : PQ PQ
I13 : PQ , QR R
26
Exercise 7.
7. Let P, Q, R and S be statement variables.
Prove formally the following.
(a) PQ, QR, RS P S
(b) P (PQ) Q
Answer
(b) P (PQ) Q
(1) P (PQ)
(2) P
T , (1) I1
I1 : P Q P
(3) PQ
T , (1) I2
I2 : P Q Q
(4) Q
I10 : P , PQ Q
27
Exercise 8.
8. Show the following implication.
(a) (x)(P(x)Q(x)), (x)P(x) (x)Q(x)
(b) ((x)P(x) Q(a))(x)P(x)Q(a)
Answer
(a) (x)(P(x)Q(x)), (x)P(x) (x)Q(x)
(1)
(x)(P(x)Q(x))
(2)
(x)P(x)
(3)
P(a)
T, (2) U.S.
(4)
P(a)Q(a)
T, (1) U.S.
(5)
Q(a)
T, (3),(4) I10
(6)
(x)Q(x)
T, (5) E.G.
I10 : P , PQ Q
28
Exercise 8.
8. Show the following implication.
(a) (x)(P(x)Q(x)), (x)P(x) (x)Q(x)
(b) ((x)P(x) Q(a))(x)P(x)Q(a)
Answer
(b) ((x)P(x) Q(a))(x)P(x)Q(a)
(1)
((x)P(x) Q(a))
(2)
(x)P(x) Q(a)
T, (1) E8
E8 : (PQ) P Q
(3)
(x)P(x)Q(a)
T, (2) E16
E16 : PQ P Q
29