1. Trang chủ
  2. » Tất cả

F tutorial logic 3 answers

2 0 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

F tutorial logic 3 answers dvi Exercises + sample answers for the tutorial on predicate logic in CS1512 N B Translations between logic and English (in both directions) can always be done in many diffe[.]

Exercises + sample answers for the tutorial on predicate logic in CS1512 N.B Translations between logic and English (in both directions) can always be done in many different ways Consequently, most of the following questions allow many different answers Translate these statements into English, where C(x) means ”x is a comedian” and F (x) is ”(x) is funny”, and the universe of discourse consists of all people a b c d ∀x(C(x) → F (x)) For example: Every comedian is funny ∀x(C(x) ∧ F (x)) Everyone is a funny comedian ∃x(C(x) → F (x)) There is someone who is either funny or not a comedian ∃x(C(x) ∧ F (x)) Funny comedians exist To know whether a formula of predicate logic is true, one must know what the intended universe of discourse (u.d.) is (as well as what the predicates and constants mean) a Describe a u.d in which (1a) is false b Describe a u.d in which (1b) is false c Describe a u.d in which (1c) is false d Describe a u.d in which (1d) is false Answers: a,b,d are easy For example, a is false iff the u.d contains a comedian who is not funny c This statement is false in any situation in which two things are true: (1) everyone is a comedian, and (2) noone is funny The simplest example is a situation in which there are no comedians; a slightly more complex one is a situation with one comedian, while that comedian is not funny Let the universe of discourse be the set of all integers Let p, q, r, s, and t be as follows: p(x) : x > q(x) : x is even r(x) : x is a perfect square s(x) : x is (exactly) divisible by t(x) : x is (exactly) divisible by (a) Write the following statements in symbolic form: i At least one integer is even Answer: ∃xq(x) ii There exists a positive integer that is even Answer: ∃x(p(x) ∧ q(x)) iii If x is even, then x is not divisible by Answer: ∀x(q(x) → ¬t(x)) iv No even integer is divisible by Answer: (Same as previous) v There exists an even integer divisible by Answer: ∃x(q(x) ∧ t(x)) (b) Determine which of i-v is true For each false statement, provide a counterexample Only iii and iv are false In both cases, 20 is a counterexample (c) Express each of the following symbolic notations in English: i ∀x(r(x) → p(x)) Answer: All perfect squares are positive ii ∀x(s(x) → q(x)) Answer: Etc iii ∀x(s(x) → ¬t(x)) iv ∃x(s(x) ∧ ¬r(x)) (d) Provide a counterexample for each false statement in part (c) Answer: is a counterexample to i 20 is a counterexample to iii 4 Suppose the u.d of the propositional function P (x) consists of the integers 0, 1, 2, 3, Write out each of these propositios using disjunctions, conjunctions, and negations a ∃xP (x) Answer: P (0) ∨ P (1) ∨ P (2) ∨ P (3) ∨ P (4) ∨ P (5) Etc b ∀xP (x) c ∃x¬P (x) d ∀x¬P (x) e ¬∃xP (x) f ¬∀xP (x) Translate into logical expressions using predicates, quantifiers, and logical connectives a No one is perfect Answer: ¬∃xP (x) b Not everyone is perfect Answer: ¬∀xP (x) c All your friends are perfect Answer: ∀x(F (x) → P (x)) d One of your friends is perfect Answer: ∃x(F (x) ∧ P (x)) e Everyone is your friend and is perfect Answer: ∀x(F (x) ∧ P (x)) f Not everyone is your friend, or someone is not perfect Answer: ¬∀xF (x) ∨ ∃x¬P (x) g A passenger on an airline qualifies as an elite flyer if the passenger flies more than 25,000 miles or takes more than 25 flights (Use E(x) as short for ”x qualifies as an elite passenger”, F (x, y for ”x flies more than y miles”, and S(x, y for ”x takes more than y flights”.) Answer: ∀x((F (x, 25000) ∨ S(x, 25)) → E(x)) An interesting variant arises when the conditional (→) is replaced by a biconditional (↔) (It seems that the sentence can be interpreted in that way.) h (As (g), but taking into account that each of the relevant flights should be made in the same year.) Answer: this could be done in different ways, but here is one possibility: ∀x((F (x, 25000, z) ∨ S(x, 25, z)) → E(x, z)), with analogous changes to the meaning of E, F , and S (a) Use predicates, quantifiers, logical connectives, and mathematical operators to express the statement that every positive integer is the sum of the squares of four integers One answer: ∀x(x > → ∃y1 ∃y2 ∃y3 ∃y4 (x = y12 + y22 + y32 + y42 )) (b) Use predicates, quantifiers, logical connectives, and mathematical operators to express the statement that there is a positive integer that is not the sum of three squares One answer: ∃x(x > ∧ ¬∃y1 ∃y2 ∃y3 (x = y12 + y22 + y32 )) ... perfect Answer: ¬∀xP (x) c All your friends are perfect Answer: ∀x (F (x) → P (x)) d One of your friends is perfect Answer: ∃x (F (x) ∧ P (x)) e Everyone is your friend and is perfect Answer: ∀x (F. .. more than 25 flights (Use E(x) as short for ”x qualifies as an elite passenger”, F (x, y for ”x flies more than y miles”, and S(x, y for ”x takes more than y flights”.) Answer: ∀x( (F (x, 25000)... ∀x (F (x) ∧ P (x)) f Not everyone is your friend, or someone is not perfect Answer: ¬∀xF (x) ∨ ∃x¬P (x) g A passenger on an airline qualifies as an elite flyer if the passenger flies more than 25,000

Ngày đăng: 27/02/2023, 22:06

Xem thêm:

w