Download HW-05: Solution

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CmSc180 Discrete Mathematics
Homework 05 due 02/17 SOLUTION
1. Prove that the product of two consecutive integers A and B is divisible by 2.
Follow the method of proof in HW04
Case 1: Let A be even.
(1) x, even(x)  multiple of 2(x), i.e.  p, integer(p) & x = 2p
(2) even(A)
given in the problem
 (3)  p, integer(p) such that A = 2p by (1), (2) and MP
(4) B = A + 1, i.e. B = 2p+1
given in the problem
(5) P = A * B = 2p *(2p+1) =
(6) x, multiple of 2(x)  even(x)
(7) multiple_of_2(P)
 (8) even(P)
by (3), (4), and basic algebra
by definition of even numbers
by (5)
by (6), (7) and MP
Case2: Let A be odd
(1) x, odd(x)  i.e.  p, integer(p) & x = 2p + 1
(2) odd(A)
given in the problem
 (3)  p, integer(p) such that A = 2p+1
by (1), (2) and MP
(4) B = A + 1, i.e. B = 2p+2 = 2(p+1)
given in the problem
(5) P = A * B = 2(p+1) *(2p+1)
(6) x, multiple of 2(x)  even(x)
(7) multiple_of_2(P)
 (8) even(P)
by (3), (4), and basic algebra
by definition of even numbers
by (5)
by (6), (7) and MP
2. Consider the expression
 n (integer(n)  even_square(n)  even(n))
Which of the following sentences are equivalent to the above expression:
a.
b.
c.
d.
e.
All integers have even squares and are even.
Given any integer whose square is even, that integer is itself even.
For all integers, there are some whose square is even.
Any integer with an even square is even.
All even integers have even squares.
1
3. Suppose you are visiting an island where two kinds of people live: knights who
always tell the truth, and knaves who always lie. Two natives A and B approach
you, and B says: "Both of us are knaves".
What are A and B? Explain your reasoning.
Assume that B is a knight. Then, what B tells is true. B says that B and A are
knaves, so B is a knave. This contradicts our assumption that B is a knight.
Therefore B is a knave.
Since B is a knave, what B says is not true, i.e. B and A are not both knaves. B is
a knave, therefore A is a knight.
4. Represent the following arguments in predicate logic. Indicate which of them are
valid and which are invalid. If valid, indicate the inference rule. If not valid,
indicate the error.
a. All healthy people eat an apple a day.
Herbert is not a healthy person
Therefore, Herbert does not eat an apple a day
x, healthy(x)  eatApple(x)
~healthy(Herbert)
therefore ~ eatApple(Herbert)
invalid, inverse error
b. No good car is cheap
A Rimbaud is a good car
Therefore, a Rimbaud is not cheap
x, goodCar(x)  ~cheap(x)
goodCar(Rimbaud)
Therefore, ~cheap(Rimbaud)
valid, modus ponens
c. Happy people are healthy and wealthy
John is not healthy
Therefore John is not happy
x, happy(x)  healthy(x)  wealthy(x)
~healthy(John)
Therefore, ~happy(John)
valid, modus tollens
2
d. Happy people are healthy and wealthy
John is not wealthy
Therefore John is not happy
x, happy(x)  healthy(x)  wealthy(x)
~wealthy(John)
Therefore, ~happy(John)
valid, modus tollens
e. Happy people are healthy and wealthy
John is healthy and wealthy
Therefore John is happy
x, happy(x)  healthy(x)  wealthy(x)
healthy(John)  wealthy(John)
Therefore, happy(John)
invalid, converse error
f. Happy people are healthy and wealthy
John is not happy
Therefore John is not healthy
x, happy(x)  healthy(x)  wealthy(x)
~happy(John)
Therefore, ~healthy(John)
invalid, inverse error
5. Which of the following sets are equal:
A = {a, b, c, d}, B = { d, e, a, c}, C = { d, b, a, c}, D = {e, a, c, d}
A = C, B = D
6. For the sets A, B, C and D above, find
A 
A 
A 
A 
A–
A–
B–
B=
B=
C=
C=
B=
C=
A=
{a,b,c,d,e}
{a,c,d}
{a,b,c,d}
{a,b, c,d}
{b}

{e}
7. Let S = {x | 3  x < 5}
Let U be the set of all real numbers
Find the complement of S, i.e. find ~S = U – S
~S = {x | x < 3 V 5 x }
3
8. Let A = {x | 2  x < 5 V 10< x }
Let B = {x | x < 3 V 6  x < 20}
Find
A  B={x|x<5 V 6x}
A  B = {x | 2  x < 3 10 < x < 20}
A – B = { x | 3  x <5 V 20  x }
B – A = { x | x < 2 V 6  x  10 }
9. Let the universal set be all people. Within the universal set, A is the set of all
computer programmers, B is the set of all accountants, C is the set of all women,
D is the set of all people of age 40 and older. Using set operations, write the
expressions for the following sets
a. The set of all female computer programmers who are also accountants
A CB
b. The set of all male accountants of age 40 and older
~C  B  D
c. The set of all female computer programmers under 40 and all accountants under
40.
(A  C  ~D )  (B  ~D)
4
Related documents