Chapter 1: The Foundations: Logic and Proofs Trần Hòa Phú Ngày 4 tháng 9 năm 2023 Objectives Explain what makes up a correct mathematical arguments Introduce tools to construct correct arguments Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Propositions (Mệnh đề) Definition A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both. Example Sun rises in the east and sets in the west. Hue is the captial of Vietnam. 2+3=5. 2+3=6. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Which of the following sentences are propositions? a) 5+7 = 12. b) x+2 = 11. c) Answer this question! d) Today is thursday. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Operations of Propositions Let p, q are propositions. ¬p p∧q p∨q L p q p→q p↔q Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Proposition ¬p Definition Let p be a proposition. ¬p, (p) is the negation of p. Example p : My PC runs Windows. ¬p My PC doesn’t run Windows. Example p : This book has at least 300 pages. ¬p This book doesn’t have at least 300 pages. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Find the negation of each of these propositions. a) Tuan has an iphone b) There is no pollution in Singapore c) 2+1 = 3 Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Table 1: The truth table for the negation of a Proposition Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Proposition p ∧ q Definition Let p and q be propositions. p ∧ q is the proposition "p and q". Example 1 p : Sun rises in the east q : Sun sets in the west p ∧ q : Sun rises in the east and sets in the west. Example 2 p : Sun is sunning q : Sun is raining p ∧ q: "Sun is sunning and it is raining" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Proposition p ∨ q Definition Let p and q be propositions. p ∨ q is the proposition "p or q" Example p : Sun rises in the east q : Sun sets in the west p ∨ q : Sun rises in the east or it sets in the west. Example p : This book has more than 200 pages. q : This book costs 20 dollars. p ∨ q: This book has more than 200 pages or it costs 20 dollars. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Proposition p → q Definition Let p and q be propositions. p → q is the proposition "if p, then q", "p is sufficient condition for q","q is necessary condition for p" Example p: Maria learns discrete mathematics. q: Maria will find a good job. p → q if Maria learns discrete mathematics, then Maria will find a good job. p → q For Maria to get a good job, it is sufficient for her to learn discrete mathematics. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Determine whether each of these conditional statements is true or false. a) If 1 + 1 = 2, then 2 + 2 = 5 b) If 1 + 1 = 3, then 2 + 2 = 4 c) If 1 + 1 = 3, then 2 + 2 = 5 d) If monkeys can fly, then 1 + 1 = 3 Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Proposition p ↔ q Definition Let p and q be propositions. The p ↔ q is the proposition "p if and only if q". Example p: You can take the flight. q: You buy a ticket. p ↔ q: You can take the flight if and only if you buy a ticket. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Proposition p q L Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Truth Table Summary of Connectives Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Construct a truth table for each of these compound propositions. V a) p ¬p b) p ¬p W c) (p ¬q) → q W d) (p q) → (p q) W V e) (p → q) → (q → p) f) (p ↔ q) ⊕ ¬p Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Truth table from Compound Propositions Establishing truth table of proposition given below (p ∨ ¬q) → (p ∧ q) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Logic and Bit Operations Definition Computers represent information using bits. A bit is a symbol with two possible values, namely, 0(zero) and 1(one). L Bit operations: x ∧ y (AND), x ∨ y (OR), x y (XOR) (x , y are two bits.) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Bit string and Operations Definition A bit string is a sequence of zero or more bits The length of this string is the number of bits in the string Example 10101 is a bit string of length 5. Definition Operations of bit string: bitwise OR, bitwise AND, bitwise XOR. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Example Find the bitwise OR, bitwise AND and bitwise XOR of the bit strings 01 1011 0110 and 11 0001 1101. Solution Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Find the bitwise OR, bitwise AND, and bitwise XOR of each of these pairs of bit strings. a) 101 1110, 010 0001 b) 1111 0000, 1010 1010 Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise What is the value of x after each of these statements is encountered in a computer program, if x = 1 before the statement is reached? a) if x + 2 = 3 then x := x + 1 b) if (x + 1) = 3 OR (2x + 2 = 3) then x := x + 1 c) if 2x + 3 = 5 AND 3x + 4 = 7 then x := x + 1 d) if (x + 1 = 2) XOR (x + 2 = 3) then x := x + 1 Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Propositional Equivalences Câu sau đây có ý gì? "Nếu trời mưa, tôi ở nhà và trời không mưa, tôi cũng ở nhà." Tautology and Contradiction Logical Equivalences De Morgan’s Laws Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Tautology Definition: A tautology is a compound proposition that is always true Example p ∨ p is always true. p p p ∨p T F T F T T Therefore, p ∨ p is a tautology Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Contradiction Definition: A contradiction is a compound proposition that is always false. Example p ∧ p is always false. p p p ∧p T F F F T F Therefore, p ∧ p is a contradiction. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Propositional Equivalence Definition The compound propositions p and q are called logically equivalent if p ↔ q is a tautology (p, q are both True or are both False). The notation p ≡ q denotes that p and q are logically equivalent. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Example Show that ¬(p ∧ q) and ¬p ∨ ¬q are logically equivalent. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs De Morgan’s Laws Theorem Example Find the negation "He is an actor and he is rich" Solution He is not an actor or he isn’t rich". Example Find the negation "John has a cellphone or he has a laptop" Solution "John doesn’t have a cellphone andChapter doesn’t have a laptop. " Trần Hòa Phú 1: The Foundations: Logic and Proofs p → q ≡ ¬p ∨ q Problem Find the negation "If it rains, then I stay at home". Theorem p → q ≡ ¬p ∨ q. p →q ≡p∨q ≡p∧q ≡p∧q Let p: It rains q: I stay at home p → q: "If it rains, then I stay at home". p →q ≡p∧q The answer is: "It rains and I don’t stay at home" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Prove that (p → q) ∧ (p → q) ≡ q Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Tìm mệnh đề phủ định các mệnh đề sau: 1) "Mọi bông hồng đều đẹp" 2) "Có một chiếc xe hơi giá rẻ" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Predicates and Quantifiers Predicates Example Let P(x ): ”x > 3”. P is the propositional function. P(x ) is the value of the propositional function P at x . P(2) : 2 > 3, P(2) is F P(4) : 4 > 3 P(4) is T Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Example Q(x , y ) : ”x = y + 3”. What are the truth values of the propositions Q(1, 2) and Q(3, 0)? Solution Q(1, 2) : ”1 = 2 + 3” Q(1, 2) is F Q(3, 0) : ”3 = 0 + 3” Q(3, 0) is T Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Let P(x ): "the word x contains the letter a". What are these truth values? a) P(orange) b) P(lemon) c) P(true) d) P(false) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Quantifiers Definition The universal quantification of P(x ) is the statement ∀xP(x ) : "P(x ) for all values of x in the domain" ∀ : "for every", "for all" ("với mỗi", "với mọi", "với tất cả") Example P(x ) : ”x + 1 > x ”, domain consists of all real numbers. ∀xP(x ) ≡ ∀x (x + 1 > x ) : "for every real number x , x + 1 > x " ∀xP(x ) is T Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Definition The universal quantification of P(x ) is the statement ∀xP(x ): "P(x ) for all values of x in the domain" Example P(x ) : ”x reads books everyday", domain for x consists of all student. ∀xP(x )≡ ∀x (”x read books every day”): "for every student x ,x reads books everyday " " ∀xP(x ) : "Every student reads book everyday". Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Example Let Q(x ) : ”x < 2”. What is the truth values of the quantificaion ∀xQ(x ), where the domain consists of all real numbers? Solution ∀xQ(x ) : "for every real number x , x < 2". So ∀xQ(x ) is F since 3 > 2. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Determine the truth value of each of these statements if the domain consists of all integers. a) ∀n(n + 1 > n) b) ∀n(3n ≤ 4n) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs The Existential Quantifier Definition The existential quantification of P(x ) is the proposition ∃xP(x ) "there exists an element x in the domain such that P(x )” ∃ : "exists", "some" ("tồn tại", "một vài") Example P(x ) : ”x + 1 > x ”, domain consists of all real numbers. ∃xP(x ) ≡ ∃x (x + 1 > x ) : "There exists a real number x such that x + 1 > x ." ∃xP(x ) is T. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Definition The existential quantification of P(x ) is the proposition ∃xP(x ) : "there exists an element x in the domain such that P(x )” Example P(x ) : ”x reads books everyday", domain for x consists of all student. ∃xP(x ) : "There exists a student x such that x reads books everyday " ∃xP(x ) :"There exists a student who reads book everyday". Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Example P(x ) : ”x = x + 1”. What is the truth value of the quantification ∃xP(x ), where the domain consists of all real numbers? Solution ∃xP(x ):"there exists a real number x such that x = x + 1" ∃xP(x ) is F. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Example P(x ) : ”x > 2”. What is the truth value of ∃xP(x ), where the domain consists of the integers? Solution ∃xP(x ) :"there exists an integer x such that x > 2." ∃xP(x ) is T since 3 > 2. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Determine the truth value of each of these statements if the domain consists of all integers. a) ∃n(2n = 3n) b) ∃n(n = −n) c) ∃n(3n = n + 5) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Let P(x ) : ”x = x 2”, domain consists of the integers. What are these truth values? P(0) P(1) P(2) P(−1) ∃xP(x ) ∀xP(x ). Solution ∃xP(x ) : ” there exists an integer x such that x = x 2 " ∃xP(x ) is True since 1 = 12 ∀xP(x ) : "For every integer x , x = x 2 " ∀xP(x ) is F Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Let P(x ) :" x spends more than five hours every weekday in class", where the domain for x consists of all students. Translate these statements into English a) ∃xP(x ) b) ∀xP(x ) c) ∃x ¬P(x ) d) ∀x ¬P(x ) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Translate these statements into English , where C (x ) : "x is a comedian", F (x ) : "x is funny" and the domain consists of all people. a) ∀x (C (x ) → F (x )) b) ∀x (C (x ) ∧ F (x )) c) ∃x (C (x ) → F (x )) d) ∃x (C (x ) ∧ F (x )) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Negating Quantified Expression Theorem ∀xP(x ) ≡ ∃x P(x ) Example Tìm phủ định của câu "Mọi người Việt Nam đều thích phở". Solution "Có một người VN không thích phở" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Example Find negation of the statement ∀x (x 2 > x )? Solution ∀x (x 2 > x ) ≡ ∃x (x 2 > x ) ≡ ∃x (x 2 ≤ x ) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Theorem ∃xP(x ) ≡ ∀x P(x ) Example Tìm câu phủ định của mệnh đề "Có một con khỉ biết đếm". Solution "Mọi con khỉ đều không biết đếm" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Example What is the negation of the statement ∃x (x 2 = 2)? Solution ∃x (x 2 = 2) ≡ ∀x (x 2 = 2) ≡ ∀x (x 2 ̸= 2) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Tìm mệnh đề phủ định các mệnh đề sau: ) "Mọi bông hồng đều đẹp" 2) "Có một con mèo có 3 chân" 3) "Mọi xe hơi đều đắt tiền" 4) "Có một chiếc xe máy có giá hơn 200 triệu" 5) "Mọi người đều biết đi xe đạp và thích uống cà phê". 6) ∀x (x > 1 ∨ x < 0) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Translating from English into Logical Expression Example Biến đổi câu sau thành mệnh đề logic "tất cả học sinh trong lớp này đã học môn giải tích". Miền xác định là tập hợp tất cả con người Solution "tất cả học sinh trong lớp này đã học môn giải tích" ≡ "mỗi học sinh x trong lớp này, x đã học môn giải tích". ≡ "Mỗi con người x sao cho nếu x là học sinh trong lớp này thì x đã học môn giải tích" Thay "Mỗi" thành ∀, P(x ) : "x là học sinh trong lớp này". Q(x ) : ”x đã học môn giải tích" ≡ ∀x (P(x ) → Q(x )), domain: tập hợp tất cả con người. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Biến đổi những câu sau đây thành mệnh đề logic với miền xác định là những sinh vật sống. "Tất cả sư tử đều hung dữ" "Một số sư tử không thích săn mồi" "Một số sinh vật hung dữ không thích ăn thịt". Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Solution "Tất cả sư tử đều hung dữ" ≡ "Mỗi sinh vật sống x , nếu x là sư tử thì x hung dữ" Đặt A(x ) :"x là sư tử", B(x ) : ”x hung dữ" ≡ ∀x (A(x ) → B(x )), domain: creatures. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs "Một số sư tử không thích săn mồi" ≡ "Một số sinh vật sống x , x là sư tử và x không thích săn mồi" Đặt A(x ) : ”x là sư tử", B(x ) : ”x thích săn mồi" ≡ ∃x (A(x ) ∧ ¬B(x )) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs "Một số sinh vật hung dữ không thích ăn thịt" ≡ "Một số sinh vật x , x hung dữ và x không thích ăn thịt". Đặt A(x ) : ”x hung dữ", B(x ) : ”x thích ăn thịt" ≡ ∃x (A(x ) ∧ ¬B(x )) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Nested Quantifier Example Assume that the domain for the variables x and y consists of all real numbers. What is the meaning of the following statement ∀x ∀y (x + y = y + x ) Solution ∀x ∀y (x + y = y + x ) : "for every real number x for every real number y , or "x + y = y + x for all real numbers x and y ". ∀x ∀y (x + y = y + x ) is T Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Example What is the meaning of the statement ∀x ∃y (x + y = 0), where the domain for x and y consists of all real numbers? Solution ”∀x ∃y (x + y = 0)”:for every real number x , there exists a real number y such that x + y = 0. ∀x ∃y (x + y = 0) is T Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Let T (x , y ) : "the student x takes the class y" where x represents a student in a university and y represent represent a class. Translate the logical expression into a sentence ∀y ∃xT (x , y ) a) "For each class there is at least a student taking it" b) "There is a student taking all classes" c) Every student is taking at least one class d) There is a class that every student taking it. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Suppose L(x , y ) : "x buys Chirstmas gifts for y " where x and y are members of a family. Translate the statement into logical expression "Each family member buys Christmas gifts for any other member but not for himself or herself" i) ∃x (¬L(x , x )) ii) ∀x (¬L(x , x )) iii) ∀x (∀yL(x , y )) iv) ∀x (∀y ((y ̸= x ) ⇔ L(x , y ))) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Let P(x): "x is an even number" where the domain is the set of all integers. Which propositions are true? i) ∀x P(x ) → P(x + 1) ii) ∀x P(x ) ↔ P(x 2) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Find the truth values of the propositions, where x,y represent real numbers ∀x ∀y (x = y 2) ∧ (x < y ) ∃x ∃y (x = y 2) ∧ (x < y ) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Find the truth value of each of the following , where x represents an integer. ∃x [(x > 0) ∧ (x 3 < 1)] ∀x [(x > 0) ∨ (x 3 < 0)] ∃x [(x > 0) ∨ (x 3 < 1)] Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Negating Nested Quantifiers Example Find ∀x ∃y (xy = 1) so that no negation precedes a quantifer. Solution ∀x ∃y (xy = 1) ≡ ∃x ∃y (xy = 1) ≡ ∃x ∀y (xy = 1) ≡ ∃x ∀y (xy ̸= 1) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise P(x ) → Q(x ) 1. Find ∀x P(x , y ) → Q(x , y ) 2. Find ∃x ∀y 3. Find the negation of the statement "There exists a student who if he graduates, then he will find a good job". Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Rules of Inference Is the following argument is valid? "If it rains, then I stay at home" "It rains" Therefore, "I stay at home" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Is the following argument is valid? "If it rains, then I stay at home" "It doesn’t rain" Therefore, "I don’t stay at home" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Argument, Conclusion, Premises, Valid Definition An argument in propositional logic is a sequence of propositions. Final proposition is called the conclusion. All but the final proposition are called premises. An argument is valid if the truth of all its premises implies that the conclusion is true. Example "If it rains, then I stay at home" "It rains" Therefore, "I stay at home" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Valid Argument: Modus ponens Theorem The following argument is valid p→q p ∴q Example The following argument is valid. "If you work hard, you pass MAD" "you work hard" Therefore, "you pass MAD". Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Valid Argument: Modus tollens Theorem The following argument is valid p→q ¬q ∴ ¬p Example The following argument is valid. "If you are a singer, then you sing well" "You don’t sing well" Therefore, "you are not a singer". Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Valid Argument: Hypothetical syllogism Theorem The following argument is valid. p→q q→r ∴p→r Example "If it rains today, then we will not have dinner outdoor today" "If we don’t have dinner outdoor today, we will have dinner at home today " "If it rains today, we will have dinner at home today" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Valid Argument: Disjunctive syllogism Theorem The following argument is valid. p∨q ¬p ∴q Example 1 "Today is Tuesday or Wednesday" "Today is not Tuesday" Therefore "Today is Wednesday" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Valid Argument: Addition Theorem The following argument is valid. p ∴p∨q Example "He is tall" Therefore, he is tall or he can sing well. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Valid Argument: Simplification Theorem The following argument is valid. p∧q ∴p Example The following argument is valid. He sings well and can play guitars. Therefore he sings well. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Valid Argument: Conjunction Theorem The following argument is valid. p q ∴p∧q Example The following argument is valid She can speak English She can speak French Therefore, she can speak English and French. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Valid Argument: Resolution Theorem The following argument is valid. p∨q ¬p ∨ r ∴q∨r Example "it is not snowing or John is skiing" "It is snowing or Jack is playing football" Therefore, "John is skiing or Jacking is playing football" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Theorem The following argument is NOT VALID p→q ¬p ∴ ¬q Example The following argument is NOT VALID. "Nếu trời mưa thì tôi nghỉ học" "Trời không mưa" Vậy tôi không nghỉ học Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Summary Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Summary Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise What are conclusions can be drawn if premises are given as below? "If I win the lottery, then I buy a house" "If I buy a house, then I have a wife" "I am single" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise What are conclusions can be drawn if premises are given as below? "If I eat spicy foods, then I have strange dreams" "I have strange dreams if there is thunder while I sleep" "I did not have strange dream." Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise What are conclusions can be drawn if the premises are given as below? "I am either clever or lucky" "I am not lucky" "If I am lucky, then I will win the lottery" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise What are conclusions can be drawn if premises are given: "I can speak English or Germany" "If I can speak Germany, I will study a master degree in German" "I do not study a master degree in Germany" ? A. I can speak both English and Germany B. I can speak Germany but cannot speak English C. No conclusion is drawn D. I can speak English but cannot speak Germany. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Rules of Inference for Quantified Statements Theorem The following argument is valid ∀xP(x ), x ∈ domain D ∴ P(c), c is an element of domain D. Example 1 The following argument is valid "All Vietnamese people like Phở " Therefore, Tuấn like Phở. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Combining Rules of Inference for Propositions and Quantified Statements Theorem The following argument is valid ∀x (P(x ) → Q(x )) P(a), a is a particular element in the domain ∴ Q(a) Example The following argument is valid. "Everyone in this class has taken Calculus" "Tuan is in this class" Therefore, Tuan has taken Calculus Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Example Show that the following argument is valid. "Everyone in this class has taken MAD" "Tuan is in this class" Therefore, Tuan has taken MAD. Solution P(x ) : "x is in this class" Q(x ) : "x has taken MAD" "Everyone in this class has taken MAD": ∀x (P(x ) → Q(x )) "Tuan is in this class": ∴ "Tuan has taken MAD" Q(Tuan) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Theorem The following argument is valid ∀x (P(x ) → Q(x )) ¬Q(a), a is a particular element in the domain ∴ ¬P(a) Example The following argument is valid. "Everyone in this class has taken English" "Tuan has not taken English" Therefore, Tuan is not in this class Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Example Show that the following argument is valid. "Everyone in this class has taken MAD" "Tuan has not taken MAD" Therefore, Tuan is not in this class . Solution P(x ) : "x is in this class" Q(x ) : "x has taken MAD" "Everyone in this class has taken MAD": ∀x (P(x ) → Q(x )) "Tuan has not taken MAD":¬Q(Tuan) ∴ "Tuan is not in this class" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise What are conclusions can be drawn if the following premises are given as below? "Every computer science major has a personal computer " "Ralph does not have a personal computer" "Ann has a personal computer" Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Determine whether each of the following arguments is valid or not valid. a) All parrots like fruit. My pet bird is not a parrot. Therefore, my pet bird does not like fruit. b) Everyone who eats granola everyday is healthy. Linda is not healthy. Therefore, Linda does not eat granola every day. c) If Mai knows French, Mai is smart. But Mai doesn’t know French. So she is not smart. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Given the premises: "Every Computer Science major studies Discrete Mathematics" "Every Math major studies Calculus" "An studies Discrete Mathematics" "Binh studies Calculus" Which conclusions can be drawn? i) An is a Computer Science major ii) Binh is a Math major. A. Only i B. Only ii. C. Both D. None of them Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Given the premises: "Lisa is a mathematics and computer science major" "Every computer science major has a computer" "Some mathematics majors speak French very well" Which conclusion can be implied? A. Lisa has a computer B. Lisa has a computer and speaks English very well C. Lisa cannot speak French D. Lisa has not a computer but speaks French very well Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise State true or false i) 1 + 1 = 3 if and only if 2 + 2 = 3 ii) If it is hot, then it is hot A. T,F B. T,T C. F,T D. F,F Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Find the negation of the statement: For every student, if this student is a fresh man, then he/she is taking a math course A. For every student, if this student is a fresh man, then he/she is not taking any math course B. There are some freshman who are not taking any math course C. For every student, if this student is NOT a fresh man, then he/she is taking a math course D. For every student, if this student is NOT a freshman, then he/she is NOT taking any math course. Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Select correct statement(s). p denotes any proposition. A. p ∧ T ≡ T B. p ∨ T ≡ p C. p ≡ p ∧ p D. p ∧ ¬p ≡ T Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Let Q(w): "the word w contains the letter e". Find the truth value of each of following propositions i) Q(lemon) ii) Q(false) A. F,F B. F,T C. T,T D. T,F Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Suppose the variable x represents students, F(x): "x is a freshman", M(x): "x is math major" Translate ¬(∀x (¬F (x ) ∨ ¬M(x ))) into English statement. A. No math major is a freshman B. Every math major is a freshman C. Some freshman are math majors D. None of these Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Which statements are true i) p ∨ (q ∧ r ) ≡ (p ∧ q) ∨ (p ∧ r ) ii) p → (¬q ∧ r ) ≡ ¬p ∨ ¬(r → q) A. only i B. only ii C. Both D. Neither Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Suppose the variable x represents students, F(x):"x is a freshman" M(x): "x is math major" Translate ∀x (F (x ) → ¬M(x )) into English statement A. No math major is a freshman B. Some freshman are math majors C. Every math major is a freshman D. None of these Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Write the statement in the "If-then" form "It is necessary to score a goal to win the match" Which one is true? i) If the team scores a goal, they will win the match ii) If the team doesn’t score a goal, they don’t win the match A. Only i B. only ii C. Both Trần Hòa Phú D. Neither Chapter 1: The Foundations: Logic and Proofs Exercise Find the negation of the statement "If Lan knows Python, then Lan knows calculus" A. None of these B. If Lan doesn’t know Python, then Lan doesn’t know calculus C. Lan knows calculus and Lan doesn’t know Python D. If Lan knows Python, then Lan doesn’t know calculus E. Lan knows Python but Lan doesn’t know calculus Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Which arguments are valid? i) All Wowy’s fans can sing the song "Thiên đàng". I cannot sing "Thiên đàng". Therefore, I am not a fan of Wowy. ii) All Son Tung MTP’s fans like the MV "Chạy ngay đi". I like this MV. Therefore, I am a fan of Sơn Tùng. A. only i B. only ii C. Neither Trần Hòa Phú D. Both Chapter 1: The Foundations: Logic and Proofs Exercise Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise How many rows are there in the truth table for the compount proposition ¬(r → ¬q) ∨ (p ∧ ¬r )? A. None of these B. 6 C. 4 D. 16 E. 8 Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Which propositions are tautology? i) (p → q) ∧ (¬p → q) ii) ((p → ¬q) ∧ q) → ¬p A.Only i B. only ii C. Both Trần Hòa Phú Neither Chapter 1: The Foundations: Logic and Proofs Exercise Suppose the variable x represents students F(x)" "x is a freshman", M(x):"x is a math major" Translate ∀x (M(x ) → F (x )) into English statement A. Some freshman are math majors B. Every math major is a freshman C. No math major is a freshman D. None of these Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Suppose the truth value of p → ¬(p ∧ ¬q) is False Find the truth value of p, q. A. F,F B. T,F C. F,T D. T,T Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Suppose the variable x represents students, F(x): "x is a freshman" M(x):"x is a math major" Translate ∀x (M(x ) → ¬F (x )) into English statement A. Every math major is a freshman B. Some freshman are math majors C. No freshman is a math major D. None of these Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Using c for "it is cold" and r for "it is rainy" Write " It is rainy if it is not cold" by symbols. i) ¬c → r ii) r → ¬c iii) c → r iv) ¬c ∧ r Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs Exercise Let T (x , y ) : "Student x has studied subject y" R(x , z): "student x is in class z". Translate the following sentence into a logical expression "Every student in class MAD101 has studied Calculus". i) ∀x (T (x , Calculus) → R(x , MAD101)) ii) ∀x (R(x , MAD101) → T (x , MAD101)) iii) ∃x (T (x , Calculus) → R(x , MAD101)) iv) ∃x (R(x , MAD101) → T (x , Calculus)) Trần Hòa Phú Chapter 1: The Foundations: Logic and Proofs