Lecture 1.3: Predicate Logic CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren
12/19/2015Lecture Predicate Logic2 Course Admin Slides from last lectures all online Both ppt and pdf Any questions? Competency exam today (last 15 minutes) A 15 minute exam testing for some basic math questions A must take for every student Don’t worry – this will NOT affect your enrollment for, and grade in, CS 250 Part of accreditation of CS programs
12/19/2015Lecture Predicate Logic3 Outline Predicate Logic (contd.)
12/19/2015Lecture Predicate Logic4 Quantifiers – another way to look at them To simplify, let us say that the universe of discourse is {x 1, x 2 } x P(x) P(x 1 ) P(x 2 ) x P(x) P(x 1 ) P(x 2 ) This is very useful in proving equivalences involving propositions that use quantifiers Let us see some examples
12/19/2015Lecture Predicate Logic5 Laws and Quantifiers Negation or De Morgan’s Law (we saw this last time): x P(x) x P(x) x P(x) x P(x) Distributivity: x (P(x) Q(x)) x P(x) x Q(x) x (P(x) Q(x)) x P(x) x Q(x) Can’t distribute universal quantifier over disjunciton or existential quantifier over conjunction
12/19/2015Lecture Predicate Logic6 Predicates – Free and Bound Variables A variable is bound if it is known or quantified. Otherwise, it is free. Examples: P(x)x is free P(5)x is bound to 5 x P(x) x is bound by quantifier Reminder: in a proposition, all variables must be bound.
12/19/2015Lecture Predicate Logic7 Predicates – Nested Quantifiers To bind many variables, use many quantifiers! Example: P(x,y) = “x > y”; universe of discourse is natural numbers x P(x,y) x y P(x,y) x y P(x,y) x P(x,3) a)True proposition b)False proposition c)Not a proposition d)No clue c)b)
12/19/2015Lecture Predicate Logic8 Predicates – Meaning of Nested Quantifiers 1. x y P(x,y) 2. x y P(x,y) 3. x y P(x,y) 4. x y P(x,y) P(x,y) true for all x, y pairs. For every value of x we can find a y so that P(x,y) is true. P(x,y) true for at least one x, y pair. There is at least one x for which P(x,y) is always true. 1 and 2 are commutative 3 and 4 are not commutative Suppose P(x,y) = “x’s favorite class is y.”
12/19/2015Lecture Predicate Logic9 Nested Quantifiers – example N(x,y) = “x is sitting by y” x y N(x,y) x y N(x,y) x y N(x,y) x y N(x,y) False True False
12/19/2015Lecture Predicate Logic10 Today’s Reading and Next Lecture Rosen 1.5 Again, please start solving the exercises at the end of each chapter section! Please read 1.6 and 1.7 in preparation for the next lecture