Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 1.3: Predicate Logic, and Rules of Inference* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.

Similar presentations


Presentation on theme: "Lecture 1.3: Predicate Logic, and Rules of Inference* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren."— Presentation transcript:

1 Lecture 1.3: Predicate Logic, and Rules of Inference* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren

2 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference2 Course Admin Slides from last lecture were posted Both ppt and pdf Expect HW1 to be coming in a week from now Competency exam/quiz today (last 15 minutes) A 15 minute exam testing for some basic math questions A must take for every student

3 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference3 Outline Predicate Logic (contd.) Rules of Inference for mathematical proofs

4 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference4 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 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference5 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 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference6 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 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference7 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 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference8 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 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference9 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 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference10 Proofs – How do we know? The following statements are true: If I am Mila, then I am a great swimmer. I am Mila. What do we know to be true? I am a great swimmer! How do we know it?

11 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference11 Proofs – How do we know? A theorem is a statement that can be shown to be true. A proof is the means of doing so. Axiom, postulates, hypotheses and previously proven theorems. Rules of inference Proof

12 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference12 Proofs – How do we know? The following statements are true: If I have taken MA 106, then I am allowed to take CS 250 I have taken MA 106 What do we know to be true? I am allowed to take CS 250 What rule of inference can we use to justify it?

13 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference13 Rules of Inference – Modus Ponens I have taken MA 106. If I have taken MA 106, then I am allowed to take CS 250.  I am allowed to take CS 250. p p  q  q Tautology: (p  (p  q))  q Inference Rule: Modus Ponens

14 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference14 Rules of Inference – Modus Tollens I am not allowed to take CS 250. If I have taken MA 106, then I am allowed to take CS 250.  I have not taken MA 106.  q p  q  p p Tautology: (  q  (p  q))   p Inference Rule: Modus Tollens

15 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference15 Rules of Inference – Addition I am not a great skater.  I am not a great skater or I am tall. p  p  q Tautology: p  (p  q) Inference Rule: Addition

16 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference16 Rules of Inference – Simplification I am not a great skater and you are sleepy.  you are sleepy. p  q  p Tautology: (p  q)  p Inference Rule: Simplification

17 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference17 Rules of Inference – Disjunctive Syllogism I am a great eater or I am a great skater. I am not a great skater.  I am a great eater! p  q  q  p Tautology: ((p  q)   q)  p Inference Rule: Disjunctive Syllogism

18 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference18 Rules of Inference – Hypothetical Syllogism If you are an athlete, you are always hungry. If you are always hungry, you have a snickers in your backpack.  If you are an athlete, you have a snickers in your backpack. p  q q  r  p  r Tautology: ((p  q)  (q  r))  (p  r) Inference Rule: Hypothetical Syllogism

19 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference19 Examples Amy is a computer science major.  Amy is a math major or a computer science major. Addition If Ernie is a math major then Ernie is geeky. Ernie is not geeky!  Ernie is not a math major. Modus Tollens

20 8/23/2011 Lecture 1.3 - Predicate Logic, and Rules of Inference20 Today’s Reading and Next Lecture Rosen 1.5 and 1.6 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, and Rules of Inference* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren."

Similar presentations


Ads by Google