Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
CMSC250, Fall 2003 Homework 5 Answers Due Wednesday, October 8 at the beginning of your discussion section. You must write the solutions to the problems single-sided on your own lined paper, with all sheets stapled together, and with all answers written in sequential order or you will lose points. 1. Complete the following proofs using the method described in class. (a) P1 ∀x ∈ D R(x) ∨ [Q(x) → T (x)] P2 ∃y ∈ D P (y) ∨ [∼ R(y) ∧ Q(y)] P3 ∀z ∈ D ∼ T (z) →∼ P (z) ∴ ∃w ∈ D T (w) Answer: # 1 2 3 4 5 6 7 8 9 10 11 12 13 Statement P (a) ∨ [∼ R(a) ∧ Q(a)] P (a) T (a) P (a) → T (a) ∼ R(a) ∧ Q(a) ∼ R(a) Q(a) R(a) ∨ [Q(a) → T (a)] Q(a) → T (a) T (a) [∼ R(a) ∧ Q(a)] → T (a) T (a) ∃w ∈ D T (w) Rule ∃ instantiation Assume ∀ modus tollens Closing cond world w/o contra Assume Conjunctive simplification Conjunctive simplification ∀ instantiation Disjunctive syllogism Modus ponens Closing cond world w/out contra Dilemma ∃ generalization Lines Used P2 — 2, P3 2–3 — 5 5 P1 8, 6 9, 7 5–10 1, 4, 7 12 Another way using a conditional world with contradiction: # 1 2 3 4 5 6 7 8 9 10 11 12 13 Statement P (m) ∨ [∼ R(m) ∧ Q(m)] R(m) ∨ [Q(m) → T (m)] ∼ T (m) → ∼ P (m) ∼ T (m) ∼ P (m) ∼ R(m) ∧ Q(m) ∼ R(m) Q(m) → T (m) Q(m) ∼ Q(m) ∼ Q(m) ∧ Q(m) T (m) ∃w ∈ D T (w) Rule ∃ instantiation ∀ instantiation ∀ instantiation Assume Modus ponens Disjunctive syllogism Conjunctive simplification Disjunctive syllogism Conjunctive simplification Modus tollens Conjunctive addition Closing cond world w/ contra ∃ generalization 1 Lines Used P2 P1 P3 — 3, 4 5, 1 6 2, 7 6 8, 4 9, 10 4–11 12 (b) P1 ∀t ∈ D P2 ∀u ∈ D P3 ∀v ∈ D ∴ ∀h ∈ D Answer: ∼ L(t) S(u) → (R(u) ∧ T (u)) [L(v) → ∼ S(v)] → [R(v) → L(v)] ∼ S(h) # 1 2 3 4 5 Statement ∼ L(a) [L(a) →∼ S(a)] → [R(a) → L(a)] [∼ L(a)∨ ∼ S(a)] → [∼ R(a) ∨ L(a)] ∼ [∼ L(a)∨ ∼ S(a)] ∨ [∼ R(a) ∨ L(a)] ((L(a) ∧ S(a)) ∨ ∼ R(a)) ∨ L(a) 6 7 8 9 10 11 12 13 (L(a) ∧ S(a)) ∨ ∼ R(a) ∼ L(a)∨ ∼ S(a) ∼ (L(a) ∧ S(a)) ∼ R(a) ∼ R(a)∨ ∼ T (a) ∼ (R(a)∧ ∼ T (a)) ∼ S(a) ∀h ∈ D ∼ S(h) Rule ∀ instantiation ∀ instantiation Definition of → Definition of → DeMorgan’s law and associative law Disjunctive syllogism Disjunctive addition DeMorgan’s law Disjunctive syllogism Disjunctive addition DeMorgan’s law ∀ modus tollens ∀ generalization Lines Used P1 P3 2 3 4 5, 1 1 7 6, 8 9 10 11, P2 12 Another way using a conditional world with contradiction: # 1 2 3 4 5 6 7 8 9 10 11 12 13 Statement ∼ L(m) S(m) → (R(m) ∧ T (m)) [L(m) → ∼ S(m)] → [R(m) → L(m)] S(m) R(m) ∧ T (m) ∼ L(m)∨ ∼ S(m) L(m) → ∼ S(m) R(m) → L(m) ∼ R(m) R(m) R(m)∧ ∼ R(m) ∼ S(m) ∀h ∈ D ∼ S(h) Rule ∀ instantiation ∀ instantiation ∀ instantiation Assume Modus ponens Disjunctive addition Definition of → Modus ponens Modus tollens Conjunctive simplification Conjunctive addition Closing cond world w/ contra ∀ generalization Lines Used P1 P2 P3 — 2, 4 1 6 3, 7 8, 1 5 9, 10 4–11 12 2. Assume you know that ∃x ∈ S ∀y ∈ T P (x, y). Do you necessarily know that ∀y ∈ T ∃x ∈ S P (x, y)? Explain your answer in English. You may wish to provide an example to support your reasoning. Answer: Yes. Let’s say S = T = {all people} and P (x, y) = x likes y. Since you know that “∃x ∈ S ∀y ∈ T P (x, y)”, you know that it is true that there is a person (lets call him Bob) who does indeed like every person. “∀y ∈ T ∃x ∈ S P (x, y)” means that if we go down the list of all people one at a time, for each of them we can find a person who likes them. Since Bob is known to like everyone from the first statement, we could (if there were nobody else) pick Bob for each person in the list. 2 3. Assume you are given the following paragraph: 1 Tony, Mike, and John belong to the Alpine Club. Every member of the Alpine Club is either a skier, a mountain climber, or both. No mountain climber likes rain, and all skiers like snow. Mike dislikes whatever types of weather Tony likes and likes whatever types of weather Tony dislikes. Tony likes rain and snow. For this problem, you may only use the use the two sets P = {all people} and W = {all types of weather}, and the following predicates: • A(x) = “x is a member of the Alpine Club,” • M (x) = “x is a mountain climber,” • S(x) = “x is a skier,” and • L(x, y) = “x likes y.” You may also use the following constants: tony, mike, john, rain, snow. (a) Represent the information in the paragraph as predicate calculus statements. Label each statement as P1, P2, etc. Hints: You may wish to represent some of the English sentences as more than one predicate calculus statement. You will not need to use any existential quantifiers in your translations, and some translations will not need any quantifiers at all. Answer: P1 A(tony) P2 A(mike) P3 A(john) P4 ∀x ∈ P A(x) → (M (x) ∨ S(x)) P5 ∀x ∈ P M (x) → ∼ L(x, rain) P6 ∀x ∈ P S(x) → L(x, snow) P7 ∀w ∈ W L(tony, w) → ∼ L(mike, w) P8 ∀w ∈ W ∼ L(tony, w) → L(mike, w) P9 L(tony, rain) P10 L(tony, snow) (b) Complete a proof using the premises you defined to answer the question, “Of the members of the Alpine Club, who is a mountain climber but not a skier?” Follow the same format described in class for predicate calculus proofs. Answer: # Statement Rule Lines Used 1 ∼ L(mike, rain) ∀ modus ponens P7, P9 2 ∼ L(mike, snow) ∀ modus ponens P7, P10 3 ∼ S(mike) ∀ modus tollens P6, 2 4 M (mike) ∨ S(mike) ∀ modus ponens P2, P4 5 M (mike) Disjunctive syllogism 3, 4 6 M (mike)∧ ∼ S(mike) Conjunctive addition 3, 5 7 A(mike) ∧ M (mike)∧ ∼ S(mike) Conjunctive addition P2, 6 1 Adapted from a problem in Artificial Intelligence: A New Synthesis, by Nils J. Nilsson. 3 (c) Of the members of the Alpine Club, who is a mountain climber but not a skier? Answer: Mike. 4. For each of the following statements, give a proof to show it is true, or give and verify a counterexample to show it is false. (a) Given any even integer x, the sum of x − 1 and x + 1 is divisible by 4. Answer: TRUE. Proof: Let x be an arbitrary even integer. So ∃k ∈ Z such that x = 2k by the definition of even. Therefore, x − 1 = 2k − 1 and x + 1 = 2k + 1 by substitution. So (x − 1) + (x + 1) = (2k − 1) + (2k + 1) by substition, and (2k − 1) + (2k + 1) = 2k + 2k − 1 + 1 = 4k by algebra. Since k ∈ Z and (x − 1) + (x + 1) = 4k, 4|((x − 1) + (x + 1)) by the definition of divides. (b) If x and y are rational, but x/y is not rational, then y = 0. Answer: TRUE. Proof: Let x and y be arbitrary in Q. So ∃a, b, c, d ∈ Z such that x = a/b and b 6= 0, and y = c/d and d 6= 0 by the definition of rational. Therefore x/y = (a/b)/(c/d) by substitution, and (a/b)/(c/d) = (ad)/(bc) by algebra. Since we know that x/y = (ad)/(bc) is not rational, we know that either ad ∈ / Z, or bc ∈ / Z, or bc = 0. By closure of the integers under multiplication, we know that ad and bc both are in Z. So (by disjunctive syllogism) we know that bc = 0. Since bc = 0, either b or c is zero. We already know that b 6= 0, so therefore c = 0, by disjunctive syllogism. Therefore, y = 0/d = 0 by algebra. (c) If x and y are both even integers, then their sum is divisible by 4. Answer: FALSE. Counterexample: Let x = 2 and y = 4. Both 2 and 4 are even integers, but their sum, 6, is not divisible by 4. (d) x2 − 1 is odd for all integers x. Answer: FALSE. Counterexample: Let x = 3. So x2 − 1 = 32 − 1 = 9 − 1 = 8, which is not odd. (e) The sum of any two perfect squares is a perfect square. Answer: FALSE. Counterexample: Let x = y = 1. So x2 = y 2 = 1, so both x2 and y 2 are perfect squares. But x2 + y 2 = 1 + 1 = 2, which is not a perfect square. (f) There are two perfect squares such that their sum is a perfect square. Answer: TRUE. Proof: Let x = 3 and y = 4. So x2 = 9 and y 2 = 16, so both x2 and y 2 are perfect squares. Therefore x2 + y 2 = 9 + 16 = 25, which is a perfect square (25 = 52 ). 4