Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 56 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
56
Dung lượng
725,99 KB
Nội dung
WUCT121 Discrete Mathematics Logic Tutorial Exercises Logic Predicate Logic Proofs Set Theory Relations and Functions WUCT121 Logic Tutorial Exercises Section 1: Logic Question1 For each of the following collections of words: (a) Determine if it is a statement (b) If it is a statement, determine if it is true or false (c) Where possible, translate the statement into symbols, using the connectives presented in lectures (i) If x = , then x < (ii) If x = or x = , then x = x (iii) There exists a natural number x for which x = −2 x (iv) If x ∈ and x > , then if x > then x > (v) xy = ⇒ x = and y = or x = and y = (vi) xy = ⇒ x = or y = (vii) If x and y are real numbers, xy = yx (viii) There is a unique even prime number Question2 Translate into symbols the following compound statements and give the form of the compound statement In each case, list the statements p, q, r … (a) If x is odd and y is odd then x + y is even (b) (c) (d) (e) It is not both raining and hot It is neither raining nor hot It is raining but it is hot −1 ≤ x ≤ Question3 Let P be the statement “Mathematics is easy” and Q be the statement “I not need to study” Write down in words the following statements, and simplify if possible: (a) P∨ Q (d) ~P (e) ~ P∧Q (a) P∧Q (f) P⇒Q (b) ~Q (c) ~~Q Question4 Let p and q be statements (a) Write down the truth tables for (~ p ∨ q ) ∧ q and (~ p ∧ q ) ∨ q What you notice about the truth tables? Based on this result, a creative student concludes that you can always interchange ∨ and ∧ without changing the truth table Is the student right? (b) Write down the truth tables for (~ p ∨ q ) ∧ p and (~ p ∧ q ) ∨ p What you think of the rule formulated by the student in 4(a)? WUCT121 Logic Tutorial Exercises Question5 (a) Construct truth tables for the compound statements p ∨ ~ p and p ∧ ~ p (b) What you notice about each of the statements in part (a)? (c) Determine the truth-value of the compound statements ( p ∨ ~ p ) ∨ q and ( p ∧ ~ p ) ∧ q What you notice? Question6 (a) Construct truth tables for the compound statements ( p ∨ ~ p ) ∧ (q ∨ r ) and q ∨ r What you notice? (b) Construct truth tables for the compound statements ( p ∧ ~ p ) ∨ (q ∧ r ) and q ∧ r What you notice? Question7 Determine which of the following statements are tautologies using the quick method where possible ( p ⇒ q) ∨ ( p ⇒ ~ q) (a) (b) ~ ( p ⇒ q ) ∨ (q ⇒ p ) ( p ∧ q ) ⇒ (~ r ∨ ( p ⇒ q )) (c) Question8 Using Logical Equivalences and Substitution of Equivalence, write the following expressions using only ∨ , ∧ and ~ Further, write the expression in the simplest form ( p ∧ q) ⇒ r (a) (b) p ⇒ ( p ∨ q) Question9 Let p, q and r be statements Using Logical Equivalences, Substitution and Substitution of Equivalence, prove the following (g) ~ ( p ⇒ q) ≡ ( p ∧ ~ q) (( p ∧ ~ q ) ⇒ r ) ≡ ( p ⇒ (q ∨ r )) (h) Question10 reasons (a) (b) In each case, decide whether the proposition is True or False Give some If x is a positive integer and x ≤ then x = (~ ( x > 1) ∨ ~ ( y ≤ 0)) ⇔ ~ (( x ≤ 1) ∧ ( y > 0)) Question11 Using Logical Equivalences and Substitution of Equivalence, write the following logical expressions using ∨ and ∧ only (even without ~) (a) ~ ( x > 1) ⇒ ~ ( y ≤ ) ( y ≤ 0) ⇒ ( x > 1) (b) Question12 WUCT121 Simplify the expression ~ (~ ( p ∨ q ) ∧ ~ q ) , using Logical Equivalences Logic Tutorial Exercises Section :Predicate Logic Question1 Write each of the following statements in words Write down whether you think the statement is true or false (a) ∀x ∈ , ( x ≠ ⇒ ( x > ∨ x < )) (b) (c) ∀x ∈ , x ∈ ∀ students s in WUCT121, ∃ an assigned problem p, s can correctly solve p Question2 Write each of the following statements using logical quantifiers and variables Write down whether you think the statement is true or false (a) If the product of two numbers is 0, then both of the numbers are (b) Each real number is less than or equal to some integer (c) There is a student in WUCT121 who has never laughed at any lecturer’s jokes Question3 Translate each of the following statements into the notation of predicate logic and simplify the negation of each statement Which statements you think are true? (a) P: Someone loves everybody (b) P: Everybody loves everybody (c) P: Somebody loves somebody (d) P: Everybody loves somebody (e) P: All rational numbers are integers (f) P: Not all natural numbers are even (g) P: There exists a natural number that is not prime (h) P: Every triangle is a right triangle Question4 Are the following statements true or false? Give brief reasons why (a) ∀x ∈ , ( x > ⇒ x > ) (b) ∀x ∈ , ( x > ⇒ x > ) ( ) (c) ∃ x ∈ , x > ⇒ x > x (d) ⎛ x 1⎞ ∃x ∈ , ⎜⎜ x > ⇒ < ⎟⎟ x +1 ⎠ ⎝ (e) ∀x ∈ , ∀y ∈ , x + y = (f) ∀x ∈ , ∃y ∈ , x < y + (g) ∃x ∈ , ∀y ∈ , x + y ≥ (h) ∃x ∈ , ∃y ∈ , x < y ⇒ x < y ( ) Question5 For each of the following statements, (a) Write down the negation of the statement, (b) Write down whether the statement or its negation is false, and (c) THINK about how you would disprove it WUCT121 Logic Tutorial Exercises (i) ∀ξ > 0, ∃x ≠ 0, x < ξ (ii) ∃y ∈ , ∀x ∈ , y < x (iii) ∀y ∈ , ∀x ∈ , x < y ⇒ x < x+ y ⇒ x − y < ε ) Question9 Write down the negations of the following statements In each case decide whether the statement or its negation is false, giving a brief reason (a) ∀y ∈ , ( y > −1 ⇒ y > 1) (b) (c) (d) ∃x ∈ , x + = ∀x, y , z ∈ , x − ( y − z ) ≠ ( x − y ) − z ∀x ∈ , ∃y ∈ , x + y = Question10 Write the following statements using quantifiers Find their negations and determine in each case whether the statement or its negation is false, giving brief reason where possible (a) P: For each natural number there is a smaller natural number (b) P: The square of any real number is non-negative (c) P: Some dogs are vegetarians (d) P: There is a real number that is rational (e) P: Every student likes at least one Mathematics subject WUCT121 Logic Tutorial Exercises Section 3: Proofs Question1 Each of the following demonstrates the Rule of Modus Ponens, Modus Tollens or the Law of Syllogism In each case, answer the question or complete the sentence and indicate which of the logical rules is being demonstrated (a) If Peter is unsure of an address, then he will phone Peter is unsure of John’s address What does Peter do? (b) If x − x + = , then ( x − 2)( x − 1) = If ( x − 2)( x − 1) = , then x − = or x − = If x − = or x − = , then x = or x = Therefore, if x − x + = , then … (c) We know that if x is a real number, then its square is positive or zero If y = −1 , what we know about y? Question2 Prove or disprove the following statements (a) For all n ∈ , the expression n + n + 29 is prime (b) ∃x ∈ , ∀y ∈ , xy ≠ (c) ∀a , b ∈ , ( a + b ) = a + b (d) The average of any two odd integers is odd Question3 Find the mistakes in the following “proofs” (a) Result: ∀k ∈ , k > ⇒ k + 2k + is not prime Proof: For k = 2, k + 2k + = , which is not prime Therefore the result is true (b) Result: The difference between any odd integer and any even integer is odd Proof: Let n be any odd integer and m be any even integer By definition of odd n = 2k + 1, k ∈ , and by definition of even m = 2k , k ∈ Then n − m = ( 2k + 1) − 2k = But is odd Therefore the result holds Question4 Prove each of the following results using a direct proof: (a) For x ∈ , x + ≥ x (b) For n ∈ , if n is odd, n is odd (c) The sum of any two odd integers is even (d) If the sum of two angles of a triangle is equal to the third angle, then the triangle is a right angled triangle Question5 Prove that if x is a negative real number, then ( x − 2)2 > Question6 Prove that there is an integer n > , such that n − is prime Question7 number Prove that for each integer n such that ≤ n ≤ 10, n − n + 41 is a prime WUCT121 Logic Tutorial Exercises Question8 Prove that if n is an odd integer, then ( −1) n = −1 Question9 Prove, by contraposition, that if n is even, then n is even Question10 Prove by cases, if m is an integer, then m + m + is always odd Question11 Disprove the statement: ∀a , b ∈ , a ≠ 0, b ≠ 0, 1 = + Are there a +b a b any values for a, b that make the statement true? Explain Question12 Prove or disprove this statement: For all integers, a, b if a < b , then a [...]... following: (a) (1 3 4)(3 2 4) (b) (1 3 4) −1 (c) (2 5 4 1) −1 (d) (3 2)(3 2 4)(3 1)(4 2) WUCT121 Logic Tutorial Exercises 12 WUCT121 Discrete Mathematics Logic Tutorial Exercises Solutions 1 Logic 2 Predicate Logic 3 Proofs 4 Set Theory 5 Relations and Functions WUCT121 Logic Tutorial Exercises Solutions 1 Section 1: Logic Question1 (i) If x = 3 , then x < 2 (a) Statement (b) False (c) x = 3⇒ x < 2 (ii) If... T T F T T F T T T F F T F F F F T T T T T T T T F T T T T T F T T T T T T F F T T F F F Step: 2 1 4* 3 1* Notice that the two statements are logically equivalent In fact, the truth value of the first is dependent entirely on the second p T T T T F F F F WUCT121 Logic Tutorial Exercises Solutions 4 (b) The truth tables for the statements ( p ∧ ~ p ) ∨ (q ∧ r ) and q ∧ r q r (p ∧ ~p) ∨ (q ∧ r) q ∧ r... Implication Law Negation of ≤ Question12 ~ (~ ( p ∨ q ) ∧ ~ q ) ≡ ~~ ( p ∨ q ) ∨ ~~ q ≡ ( p ∨ q) ∨ q ≡ p∨q∨q ≡ p∨q WUCT121 De Morgan' s Double Negation Associativity Idempotent Law Logic Tutorial Exercises Solutions 7 Section 2 :Predicate Logic Question1 (a) Every real number that is not zero is either positive or negative The statement is true (b) The square root of every natural number is also a natural number... p and (~ p ∧ q ) ∨ p p q (~p ∨ q) ∧ p (~p ∧ q) ∨ p T T F T F F T T T F F F F F F T F T T T T T F T F F T T T F F F Step: 1 2 1 2 3* 3* The tables are not the same The student’s guess is false WUCT121 Logic Tutorial Exercises Solutions 3 Question5 (a) The truth tables for p ∨ ~ p and p ∧ ~ p p p T F ∨ ~p p ∧ ~p T F F T T T F F 2* 1 2* 1 (b) p ∨ ~ p is a tautology i.e always true; p ∧ ~ p is a contradiction,... 12) ∈ R (iii) (3, 8) ∈ R Question9 Define the relations R and S on as follows: R = {( x, y ) : y =| x |} S = {( x, x ) : x = 0} Find simple expressions for the relations: (a) R ∪ S on WUCT121 (b) Logic Tutorial Exercises R∩S on 11 Question10 Write down the domain and range of the relation R on the given set A A = {h : h is a human being} , R = {( h1 , h2 ) : h1 is the sister of h2 } Question11... q ∧ r q r (p ∧ ~p) ∨ (q ∧ r) q ∧ r T T F F T T T T F F F F F F F T F F F F F F F F F F F F T T F T T T T T F F T F F F F T F T F F F F F F T F F F Step: 2 1 4* 3 1* Notice that the two statements are logically equivalent In fact, the truth value of the first is again dependent entirely on the second p T T T T F F F F Conclusion: If you have a compound statement R of the form “ T ∧ P ”, where T stands... ⇒ must be T 2nd ⇒ , q must be T and p must be F 1st ⇒ p can be F and q can be T, ~( 2 p ⇒ 1 q) ∨ 4* F F F T F T F T no conflict There is no contradiction, thus the statement is not a tautology WUCT121 Logic Tutorial Exercises Solutions 5 (c) ( p ∧ q ) ⇒ (~ r ∨ ( p ⇒ q )) (p Step Place F under main connective ∧ must be T and ∨ must be F ∧ p must be T and q must be T ∨ ~r must be F and ⇒ must be F ∧ q)... RHS (b) LHS = ( p ∧ ~ q ) ⇒ r ≡~ ( p ∧ ~ q ) ∨ r ≡ (~ p ∨ ~~ q ) ∨ r WUCT121 Implication Law De Morgan' s ≡ (~ p ∨ q ) ∨ r ≡~ p ∨ (q ∨ r ) Double Negation Associativity ≡ p ⇒ (q ∨ r ) = RHS Implication Logic Tutorial Exercises Solutions 6 Question10 (a) If x is a positive integer and x 2 ≤ 3 then x = 1 The proposition is True If x is a positive integer, then x 2 ≤ 3 ⇒ x ≤ 3 Now 3 ≈ 1.7 and so x = 1... 0 implies x = 0 or y = 0 (vi) (a) (b) (c) Statement True xy = 0 ⇒ x = 0 ∨ y = 0 (vii) xy = yx (a) Statement (b) True (viii) There is a unique even prime number (a) Statement (b) True, x = 2 WUCT121 Logic Tutorial Exercises Solutions 2 Question2 (a) If x is odd and y is odd then x + y is even p: x is odd q: y is odd r: x + y is even Form: p ∧ q ⇒ r (b) It is not both raining and hot p: It is raining... definitely true! (d) P : ∀p ∈ H , ∃q ∈ H , p loves q ~ P : ~ (∀p ∈ H , ∃q ∈ H , p loves q ) ≡ ∃p ∈ H , ~ (∃q ∈ H , p loves q ) ≡ ∃p ∈ H , ∀q ∈ H , p doesn' t love q In our world, P is probably true! WUCT121 Logic Tutorial Exercises Solutions 8 P : ∀x ∈ , x ∈ ~ P : ~ (∀x ∈ , x ∈ (e) ) ≡ ∃x ∈ , x ∉ ~ P is true (f) P : ~ (∀n ∈ , ∃p ∈ , n = 2 p ) ≡ ∃n ∈ , ~ (∃p ∈ , n = 2 p ) ≡ ∃n ∈ , ∀p ∈ , n ≠ 2 p ~ P : ~ ~