HW-04: Solution

advertisement
CmSc180 Discrete Mathematics
Homework 04 : Solutions
1. Give direct proof for the following statements
2.a. The sum of two odd numbers is even
2.b. The sum of an even and an odd number is odd
When constructing the proof, follow the example below:
Prove that the sum of two even numbers is even.
Proof:
Let A and B be two arbitrary chosen even numbers
(1) x, even(x)  multiple of 2(x), i.e.  p, integer(p) & x = 2p
(2) even(A)
given in the problem
(3) even(B)
given in the problem
 (4)  p, integer(p) such that A = 2p by (1), (2) and MP
 (5)  q, integer(q) such that B = 2q by (1), (3) and MP
(6) S = A + B = 2p + 2q = 2(p+q)
(7) x, multiple of 2(x)  even(x)
(8) multiple_of_2(S)
 (9) even(S)
by (4), (5), and basic algebra
by definition of even numbers
by (6)
by (7), (8) and MP
Solution
2.a. The sum of two odd numbers is even
Let P and Q be two odd numbers
(1) x, odd(x)   p, integer(p) & x = 2p+1
(2) odd(P)
given in the problem
(3) odd(Q)
given in the problem
 (4)  p, integer(p) such that P = 2p+1
by (1), (2) and MP
 (5)  q, integer(q) such that Q = 2q+1
by (1), (3) and MP
(6) S = P + Q = 2p + 2q +2 = 2(p+q +1)
basic algebra
(7) x, multiple_of_2(x)  even(x)
by definition
(8) multiple_of_2(S)
by (6)
 (9) even(S)
by (7), (8) and MP
1
2.b. The sum of an even and an odd number is odd
Let P be an even number, and Q be an odd numbers
(1) x, even(x)  multiple of 2(x), i.e.  p, integer(p) & x = 2p
(2) even(P)
given in the problem
 (3)  p, integer(p) such that P = 2p
by (1), (2) and MP
(4) x, odd(x)   p, integer(p) & x = 2p+1
by definition
(5) odd(Q)
given in the problem
 (6)  q, integer(q) such that Q = 2q+1
by (4), (5) and MP
(7) S = P + Q = 2p + 2q +1 = 2(p+q) +1
basic algebra
(8) The sum of two integers is an integer
basic algebra
(9) x, x = 2k+1  odd(x)
by definition
(10) S = 2k + 1, where k = p+q
by (7)
 (11) odd(S)
by (9), (10) and MP
2. Using the predicates student(x), study(x), play_soccer(x), healthy (x) and
appropriate quantifiers (,), represent in predicate logic the following sentences,
write the negation of the predicate expression and translate back to English
2.1. All students study.
 x, student(x)  study(x)
x, student(x)  ~study(x)
Some students don’t study
2.2. Some students play soccer and study
x, student(x)  play_soccer(x)  study(x)
 x, student(x)  ~( play_soccer(x)  study(x)) =
No students play soccer and study
2.3. Some soccer players are not students
x, play_soccer(x)  ~ student(x)
 x, play_soccer(x)  student(x)
All soccer players are students
2.4. Students that play soccer are healthy.
x, students(x)  soccer_player(x),  healthy(x).
x, student(x)  soccer_player(x)  ~ healthy(x).
Some students that play soccer are not healthy
2
2.5. Some healthy students play soccer
x, students(x)  healthy(x)  soccer_player(x).
x, students(x)  healthy(x) ~ soccer_player(x)
No healthy students play soccer
2.6. Some healthy soccer players are students
x, healthy(x)  soccer_player(x)  students(x)
x, healthy(x)  soccer_player(x) ~ students(x)
No healthy soccer players are students
2.7. All healthy soccer players are students
x, healthy(x)  soccer_player(x),  students(x).
x, healthy(x)  soccer_player(x)  ~students(x)
Some healthy soccer players are not students
2.8. All soccer players are healthy students
x, soccer_player(x),  healthy(x)  students(x)
x, soccer_player(x)  ~(healthy(x)  students(x))
Some soccer players are not healthy students
2.9. All students are healthy soccer players
x, students(x)  healthy(x)  soccer_player(x)
x, students(x)  ~(healthy(x)  soccer_player(x))
Some students are not healthy soccer players
3. Use propositional logic to prove that the following argument is a valid argument.
If my client is guilty, then the knife was in the drawer. Either the knife was not
in the drawer, or Jason Pritchard saw the knife. If the knife was not there on
October 10, it follows that Jason Pritchard did not see the knife. Furthermore, if
the knife was there on October 10, then the knife was in the drawer and also the
hammer was in the barn. But we all know that the hammer was not in the barn.
Therefore, ladies and gentlemen of the jury, my client is innocent.
Note to problem 4: Here we do not question the truth of the statements in the
argument. We assume that they are true. The question we have to answer is: is
the argument a valid argument. When solving this problem, follow the “Sherlock
Holmes” example solved in class.
P1 = the client is guilty
P2 = The knife was in the drawer
P3 = Jason Pritchard saw the knife
P4 = the knife was there on October 10
3
P5 = the hammer was in the barn
Premises:
P1  P2
~P2 V P3
~P4  ~P3
P4  P2  P5
~P5
(1)
(2)
(3)
(4)
(5)
From ~P5 it follows that ~(P2  P5)
From (6), (4) and MT we have ~P4
From (7), (3) and MP we have ~P3
From (8), (2) by DS we have ~P2
From (9), (1) and MT we have ~P1
(6)
(7)
(8)
(9)
(10)
Therefore the client is innocent and the argument is valid
4. Represent the following arguments in predicate logic and determine whether they
are valid or invalid. If valid determine the type of argument. If invalid determine
the type of error if the type is known.
All nerds are good at math.
Buffy is good at math.
 Buffy is a nerd.
 x nerd(x) goddAtMath(x)
goodAtMath(Buffy)
 nerd(Buffy)
invalid, converse error
It is difficult to study whenever I am tired.
I found it easy to study today.
 I am not tired today.
x tired(x)  difficultToStudy(x)
~ difficultToStudy(today)
 ~tired(today)
valid, modus tollens
4
Animals at the bottom of the food chain are very nervous.
People are not at the bottom of the food chain.
 People are not nervous
x atBottom(x)  nervous(x)
~atBottom(people)
 ~nervous(people)
invalid, inverse error
I’m always in a good mood when I feel good.
I feel great today.
 I’m in a good mood.
x feelGood(x)  goodMood(x)
feelGood(today)
 goodMood(today)
valid , modus ponens
All trees have leaves.
Roses have leaves.
 Roses are trees.
x tree(x)  has_leaves(x)
has_leaves (roses)
 tree(roses)
invalid, converse error
Pigs can’t fly.
Wilbur is a pig.
 Wilbur can’t fly.
x pig(x)  ~fly(x)
pig (Wilbur)
 ~fly(Wilbur)
valid, modus ponens
Pigs can’t fly.
Tweety can fly.
 Tweety isn’t a pig.
x pig(x)  ~fly(x)
fly(Tweety)
 ~pig (Tweety)
valid, modus tollens
5
Every adult is eligible to vote.
John is eligible to vote.
 John is an adult.
x adult(x)  eligibleVote(x)
eligibleVote (John)
 adult(John)
invalid, converse error
Some students play football
John is a student.
 John plays football

x student(x)  play_football(x)
student(John)
 play_football(John)
invalid, first premise needs to be an universally
quantified statement
6
Download