Math.3336: Discrete Mathematics Nested Quantifiers Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall 2018 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 1/22
Assignments to work on Homework #2 due Wednesday, 9/5, 11:59pm No credit unless turned in by 11:59pm on due date Late submissions not allowed, but lowest homework score dropped when calculating grades Homework will be submitted online in your CASA accounts. You can find the instructions on how to upload your homework in our class webpage. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 2/22
Chapter 1 - The Foundations: Logic and Proofs Chapter 1 - Overview Propositional Logic The Language of Propositions Section 1.1 Applications* Section 1.2 Logical Equivalences Section 1.3 Predicate Logic The Language of Quantifiers Section 1.4 Logical Equivalences Section 1.4 Nested Quantifiers Section 1.5 Proofs Rules of Inference Section 1.6 Proof Methods Section 1.7 Proof Strategy Section 1.8 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 3/22
Chapter 1 - The Foundations: Logic and Proofs Chapter 1 - Overview Propositional Logic The Language of Propositions Section 1.1 Applications* Section 1.2 Logical Equivalences Section 1.3 Predicate Logic The Language of Quantifiers Section 1.4 Logical Equivalences Section 1.4 Nested Quantifiers Section 1.5 Proofs Rules of Inference Section 1.6 Proof Methods Section 1.7 Proof Strategy Section 1.8 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 4/22
Part II Predicate Logic Predicate Logic Summary The Language of Quantifiers Logical Equivalences Nested Quantifiers Translation from Predicate Logic to English Translation from English to Predicate Logic Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 5/22
Section 1.4 Predicate Logic (continued) Predicate Logic uses these new features: Variables: x, y, z Predicates: P(x), M (x) Quantifiers: universal, existential Propositional functions are a generalization of propositions. They contain variables and a predicate, eg. P(x). Variables can be replaced by elements from their domain (also known as universe of discourse) Propositional functions become propositions (and have truth values) when their variables are each replaced by a value from the domain or bound by a quantifier. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 6/22
Quantified Propositions Predicate logic lets us to make statements about groups of objects. To do this, we use special quantified expressions. There are two quantifiers in predicate logic: 1 Universal quantifier ( ): refers to all objects Example: All UH CS-major graduates have to pass Math.3336 2 Existential quantifier ( ): refers to some object Example: Some UH CS-major students graduate with honor. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 7/22
Universal Quantifier/Existential Quantifier Universal quantification of P(x), x P(x), is the proposition P(x) holds for all objects x in the universe of discourse. x P(x) is true if predicate P is true for every object in the universe of discourse, and false otherwise Existential quantification of P(x), written x P(x), is There exists an element x in the domain such that P(x) is true. x P(x) is true if there is at least one element in the domain such that P(x) is true Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 8/22
Quantifiers Summary Statement When True? When False? x P(x) P(x) is true for every x P(x) is false for some x x P(x) P(x) is true for some x P(x) is false for every x Consider finite universe of discourse with objects o 1,..., o n x.p(x) is true iff P(o 1 ) P(o 2 )... P(o n ) is true x.p(x) is true iff P(o 1 ) P(o 2 )... P(o n ) is true Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 9/22
More Examples of Quantified Formulas Consider the domain of integers and the predicates even(x) and div4(x) which represents if x is divisible by 4 What is the truth value of the following quantified formulas? x (div4(x) even(x)) true x (even(x) div4(x)) false x ( div4(x) even(x)) true x ( div4(x) even(x)) true x ( div4(x) even(x)) false Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 10/22
Precedence of Quantifiers The quantifiers and have higher precedence than all the other logical operators. For example, x P(x) Q(x) means ( x P(x)) Q(x). x (P(x) Q(x)) means something different. Unfortunately, often people write x P(x) Q(x) when they mean x (P(x) Q(x)). Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 11/22
Translating English Into Quantified Formulas Assume freshman(x) means x is a freshman and Math3336(x) x is taking Math3336. Then express the following in predicate logic notation: Someone in Math3336 is a freshman x (freshman(x) Math3336(x)) No one in Math3336 is a freshman ( x (freshman(x) Math3336(x)) Everyone taking Math3336 are freshman ( x (Math3336(x) freshman(x)) Every freshman is taking Math3336 ( x (freshman(x) Math3336(x)) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 12/22
Translation with Quantifiers Let A(x) and S(x) be two predicates. Universal quantifiers usually go with implications All A(x) is S(x): No A(x) is S(x): x (A(x) S(x)) x (A(x) S(x)) Existential quantifiers usually go with conjunctions Some A(x) is S(x): x (A(x) S(x)) Some A(x) is not S(x): x (A(x) S(x)) Observation: Universal quantifiers usually go with implications, and existential quantifiers go with conjunctions Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 13/22
DeMorgan s Laws for Quantifiers Learned about De Morgan s laws for propositional logic: (p q) p q (p q) p q DeMorgan s laws extend to predicate logic, e.g., (even(x) div4(x)) ( even(x) div4(x)) Two new De Morgan s laws for quantifiers: x P(x) x P(x) x P(x) x P(x) When you push negation in, flips to and vice versa Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 14/22
Using DeMorgan s Laws Expressed Noone in Math3336 is a freshman as x (Math3336(x) freshman(x)) Let s apply DeMorgan s law to this formula: x ( Math3336(x) freshman(x)) Using the fact that p q is equivalent to p q, we can write this formula as: x (Math3336(x) freshman(x)) Therefore, these two formulas are equivalent! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 15/22
Section 1.5 Nested Quantifiers Sometimes, more than one quantifier may be necessary to capture the meaning of a statement in the predicate logic. Example: Every real number has an additive inverse. Translation: a real number is denoted x and its additive inverse y A predicate P(x, y) denotes x + y = 0 Then, we can write x y P(x, y). Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 16/22
More Nested Quantifier Examples Using the loves(x,y) predicate which represents x loves y, how can we say the following? Everyone loves someone x y loves(x, y) Someone loves everyone x y loves(x, y) There is someone who doesn t love anyone x y loves(x, y) There is someone who is not loved by anyone x y loves(y, x) Everyone loves everyone x y loves(x, y) There is someone who doesn t love herself/himself. x loves(x, x) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 17/22
Summary of Nested Quantifiers Statement x y P(x, y) y x P(x, y) x y P(x, y) x y P(x, y) x y P(x, y) y x P(x, y) When True? P(x, y) is true for every pair x, y For every x, there is a y for which P(x, y) is true There is an x for which P(x, y) is true for every y There is a pair x, y for which P(x, y) is true Observe: Order of quantifiers is only important if quantifiers are of different kinds! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 18/22
Understanding Quantifiers Which formulas are true/false? If false, give a counterexample x y (sameshape(x, y) differentcolor(x, y)) false x y (samecolor(x, y) differentshape(x, y)) true x (triangle(x) ( y (circle(y) samecolor(x, y)))) true Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 19/22
Understanding Quantifiers, cont. Which formulas are true/false? If false, give a counterexample x y ((triangle(x) square(y)) samecolor(x, y)) false x y sameshape(x, y) false x (circle(x) ( y ( circle(y) samecolor(x, y)))) true Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 20/22
Satisfiability, Validity in Predicate Logic The concepts of satisfiability, validity also important in Predicate Logic A predicate logic formula F is satisfiable if there exists some domain and some interpretation such that F evaluates to true Example: Prove that x P(x) Q(x) is satisfiable. D = { }, P( ) = true, Q( ) = true A predicate logic formula F is valid if, for all domains and all interpretations, F evaluates to true Prove that x P(x) Q(x) is not valid. D = { }, P( ) = true, Q( ) = false Formulas that are satisfiable, but not valid are contingent, e.g., x P(x) Q(x) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 21/22
Equivalence Two formulas F 1 and F 2 are equivalent if F 1 F 2 is valid In propositional logic, we could prove equivalence using truth tables, but not possible in predicate logic. However, we can still use known equivalences to rewrite one formula as the other. Example: Prove that ( x (P(x) Q(x))) and x (P(x) Q(x)) are equivalent. Example: Prove that x y P(x, y) and x y P(x, y) are equivalent. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 22/22