Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 1.3: Predicate Logic CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.

Similar presentations


Presentation on theme: "Lecture 1.3: Predicate Logic CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren."— Presentation transcript:

1 Lecture 1.3: Predicate Logic CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren

2 12/19/2015Lecture 1.3 - 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

3 12/19/2015Lecture 1.3 - Predicate Logic3 Outline Predicate Logic (contd.)

4 12/19/2015Lecture 1.3 - 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

5 12/19/2015Lecture 1.3 - 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

6 12/19/2015Lecture 1.3 - 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.

7 12/19/2015Lecture 1.3 - 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)

8 12/19/2015Lecture 1.3 - 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.”

9 12/19/2015Lecture 1.3 - 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

10 12/19/2015Lecture 1.3 - 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


Download ppt "Lecture 1.3: Predicate Logic CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren."

Similar presentations


Ads by Google