DISCRETE MATHEMATICS & APPLICATIONS 1 Chapter 1: Propositional Logic 1.1. Propositional Logic 1.2. Propositional Equivalences 1.3. Predicates and Quantifiers 1.4. Nested Quantifiers 1.5. Rules of Inference 2 1.1 Propositional Logic 3 DEFINITION Definition. A proposition is a declarative sentence that is either true or false. Examples. (1) If π₯ is divisible by 6 then π₯ is divisible by 3. (2) 1 is the smallest prime number. (3) After rain comes sunshine! (4) π₯ + 2 > 0. (5) For every π₯ ∈ β, if π₯ + 3 ≥ π and π ≤ 1 then π₯ ≥ −2. Convention. If a proposition π is true then we say that its truth value is true (denoted by π). Otherwise, we will say that the truth value of π is false (denoted by πΉ). 4 COMPOUND PROPOSITIONS Definition. Let π be a proposition. (1) The negation of π: ¬π = not π = proposition that is true if π is false, and is false if π is true. Example. π = "She is not only naughty but also obstinate". ¬π = "She is neither naughty nor obstinate". 5 COMPOUND PROPOSITIONS Let π and π be two propositions. (2) The conjunction of π and π: π ∧ π = "π and π" = proposition that is true when both π and π are true, and is false otherwise. Example. Let π = "She is very naughty", π = "She is not obstinate". π ∧ π = "She is very naughty but not obstinate". 6 COMPOUND PROPOSITIONS (cont.) Let π and π be two propositions. (3) The disjunction of π and π: π ∨ π = "π or π"= proposition that is false when both π and π are false, and is true otherwise. Example. π = "Students who have missed more than 6 slots can not pass this class". π = "Students who have not taken any progress test can not pass this class". π ∨ π = "Students who have not taken any progress or have missed more than 6 slots can not pass this class. 7 COMPOUND PROPOSITIONS (cont.) Let π and π be two propositions. (4) The exclusive or of π and π: π ⊕ π = "only π or only π" = proposition that is true when exactly one of π and π is true, and is false otherwise. Example. π = "You can adopt a cat". π = "You can adopt a hamster". π ⊕ π = "You can adopt a cat or a hamster, but not both". 8 COMPOUND PROPOSITIONS (cont.) Let π and π be two propositions. (5) Conditional statement: π βΆ π = "if π then π" = proposition that is false when π is true and π is false, and is true otherwise. Example. π = "You get a 9 on the final exam". π = "You will pass this class". 9 COMPOUND PROPOSITIONS (cont.) Let π and π be two propositions. (6) Biconditional statement: π β· π = proposition that is true when π and π have the same truth value, and is false otherwise. Example. π = "He is now at least 18 years old". π = "He is allowed to get married this year". 10 SUMMARY Remark. A bit is a symbol taking two values, 0 and 1. A bit can represent the truth value of a proposition: 1 = πππ’π and 0 = πΉπππ π. Table. Combined truth table using bit operations. 11 LOGICAL EXPRESSIONS Example. Translate the following propositions into logical expressions. (1) When I am over 25, I will marry her. Put π = "I am over 25 years old", π = "I marry her". Then logical expression of (1) is π βΆ π. (2) I would marry Daisy or Kate when I am rich and famous. Put π = "I am rich" , π = "I am famous" π = "I marry Daisy" and π = "I marry Kate". Then logical expression of (2) is (π ∧ π) βΆ (π ⊕ π ). 12 1.2 Propositional Equivalences 13 LOGICAL EQUIVALENCES Definition. (1) A compound proposition that is always true, no matter what the truth values of propositions that occur in it, is called a tautology. (2) A compound proposition that is always false is called a contradiction. (3) A compound proposition that is neither a tautology nor a contradiction is called a contigency. Definition. Two compound propositions are said to be (logically) equivalent if (π β· π) is a tautology. If π and π are equivalent, we will write π ≡ π. 14 SOME BASIC LOGICAL EQUIVALENCES 15 LOGICAL EQUIVALENCES - TRUTH TABLE METHOD In practice, one can verify logical equivalences using truth tables. Example. Prove that ¬(π ⊕ π) ≡ (¬π ∨ π) ∧ (π ∨ ¬π). π π 0 0 0 1 1 0 1 1 π⊕π ¬(π ⊕ π) (¬π ∨ π) ∧ (π ∨ ¬π) 16 PRACTICE Verify the following logical equivalences. (a) π βΆ π ≡ ¬π ∨ π ≡ (¬π) βΆ (¬π). (b) π β· π ≡ πβΆπ ∧ πβΆπ . (c) ¬(π ⊕ π) ≡ (¬π ∨ π) ∧ (π ∨ ¬π). (d) π ⊕ π ≡ ¬ π β· π . (e) ¬ π βΆ π ≡ π ∧ ¬π. 17 1.3 Predicates and Quantifiers 18 PREDICATE Statements involving variables such as "π₯ > 3", "π₯ + π¦ ≤ 5", "π₯ + π¦ = π§" are not propositions. Such statements are called propositional function. Example. Consider π π₯ = "π₯ > 3". For specified values of π₯, then it becomes a proposition. For instance, π 1 = πΉπππ π and π 4 = πππ’π. Remark. In π π₯ , the symbol "π₯" is called variable and the part " > 3" is called predicate. 19 QUANTIFIERS: ∀, ∃ Let π(π₯) be a propositional function. β Universal quantification: ∀π₯π π₯ = "For all values of π₯, π(π₯) is true". β Existential quantification: ∃π₯π(π₯) = "There is at least a value of π₯ such that π(π₯) is true". 20 LOGICAL EXPRESSIONS WITH QUANTIFIERS Example. For each of the following statements, find a logical expression using quantifiers and propositional functions. (1) "Every prime number is not divisible by 2". Solution. First, introduce a variable π₯: "For every number π₯ that is prime, π₯ is not divisible by 2". Next, put π π₯ = "π₯ is not divisible by 2". With the domain π· = πππππ ππ’πππππ , we find the logical expression ∀π₯π π₯ . 21 "Some student in HT’s class has visited Thach That district". (2) Solution. First, introduce a variable π₯: "There is a student π₯ in HT’s class with the property that π₯ has visited Thach That district". Next, put π π₯ = "π₯ has visited Thach That district". With the domain π· = {students in HT’s class}, we find the logical expression ∃π₯π π₯ . (3) "Every student of FPT University has visited Thach That and Quoc Oai". Solution. 22 1.4 Nested Quantifiers 23 NESTED QUANTIFIERS Exercise. Translate the following statements into English, where the domain of variables is β. a) ∀π₯∃π¦π π₯, π¦ where π π₯, π¦ = "π₯ < π¦". b) ∃π₯∀π¦π π₯, π¦ where π π₯, π¦ = "π₯ + π¦ ≥ π¦". c) ∀π₯∀π¦π π₯, π¦ where π π₯, π¦ = "[(π₯ ≥ 0) ∧ (π¦ ≥ 0)] βΆ (π₯π¦ ≥ 0)". 24 LOGICAL EXPRESSIONS WITH NESTED QUANTIFIERS Examples. For each of the following statements, find a logical expression using quantifiers and propositional functions. (1) "Some student of FPT University gave flowers to all female students". Solution. First, introduce two variables π₯ and π¦: "There is a student π₯ of FPT University gave flower to all students π¦ that are female". Next, put π π₯, π¦ = "π₯ gave flower to π¦" and π π¦ = "π¦ is female". With the domain π· = {students of FPTU}, we find the logical expression ∃π₯∀π¦ π π¦ βΆ π π₯, π¦ . 25 (2) "If a person is female and is a parent, then this person is someone’s mother". Solution. First, introduce two variables π₯ and π¦: "For every person π₯, if π₯ is female and π₯ is a parent, then there is a person π¦ such that π₯ is the mother of π¦". Next, put π π₯, π¦ = "π₯ is the mother of π¦", π π₯ = "π₯ is female" and π π₯ = "π₯ is a parent". With the domain π· = {all people}, we find the logical expression ∀π₯∃π¦ π π₯ ∧ π π₯ βΆ π π₯, π¦ . 26 NEGATING NESTED QUANTIFIERS (1) ¬ ∀π₯π π₯ ≡ ∃π₯¬π(π₯). (2) ¬ ∃π₯π π₯ ≡ ∀π₯¬π(π₯). (3) ¬ ∀π₯∀π¦π π₯, π¦ ≡ ∃π₯∃π¦¬π(π₯, π¦). (4) ¬ ∃π₯∀π¦π π₯, π¦ ≡ ∀π₯∃π¦¬π(π₯, π¦). (5) ¬ ∃π₯∃π¦π π₯, π¦ ≡ ∀π₯∀π¦¬π(π₯, π¦). (6) ¬ ∀π₯∃π¦π π₯, π¦ ≡ ∃π₯∀π¦¬π(π₯, π¦). 27 1.5 Rules of Inference 28 AN EXAMPLE Example. Suppose we have an argument: "If you have one million dollars, then you can buy a villa". Put π = "You have one million dollars" and π = "You can buy a villa". How do we deduce that π is true provided π is true? Observe that π ∧ π βΆ π βΆ π is a tautology. Now, since both π and π βΆ π are true, it implies that π must be true also. β In summary, the process of inference can be depicted as 29 DEFINITIONS Definition. (1) An argument is a sequence of propositions π1 , π2 , β― , ππ , π. The final proposition π is called the conclusion, while π1 , β― , ππ are called premises. (2) An argument is said to be valid if the truth of all premises implies that the conclusion is true. (3) The verification of validity must be based on a tautology. Otherwise, arguments are called fallacies. 30 TABLE: RULES OF INFERENCES 31 Example. Show that the following premises "If you send me an email, then I will finish writing the program", "If you do not send me an email, then I will go to sleep early", "If I go to sleep early, then I will wake up feeling refreshed" together lead to the conclusion "If I do not finish writing the program, then I will wake up feeling refreshed". Solution. Put π1 = "You send me an email", π3 = "I will go to sleep early", π2 = "I will finish writing the program", π4 = "I will wake up feeling refreshed". π = (¬π2 βΆ π4 ). 32 TABLE: RULES OF INFERENCES FOR QUANTIFIED STATEMENTS 33 EXAMPLE Example. Show that the following premises π1 = "Everyone in this class has taken a course in computer science", π2 = "Jillian is a student in this class" together lead to the conclusion "Jillian has taken a course in computer science". Solution. π π₯ = "π₯ has taken a course in computer science". With domain π· = students in this class , the logical expression of π1 is ∀π₯π π₯ . Put π = Jillian, we have π ∈ π·. The inference is 34 PRACTICE 35 PRACTICE 36 PRACTICE 37 PRACTICE 38 PRACTICE 39 PRACTICE 40 PRACTICE 41 PRACTICE 42 PRACTICE 43 PRACTICE 44 45 46 47 48 49 50 51