200 likes | 621 Views
Lecture 1.3: Predicate Logic, and Rules of Inference*. CS 250, Discrete Structures, Fall 2011 Nitesh Saxena * Adopted from previous lectures by Cinda Heeren. Course Admin. Slides from last lecture were posted Both ppt and pdf Expect HW1 to be coming in a week from now
E N D
Lecture 1.3: Predicate Logic, and Rules of Inference* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren
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 Lecture 1.3 - Predicate Logic, and Rules of Inference
Outline • Predicate Logic (contd.) • Rules of Inference for mathematical proofs Lecture 1.3 - Predicate Logic, and Rules of Inference
Quantifiers – another way to look at them • To simplify, let us say that the universe of discourse is {x1, x2 } • x P(x) P(x1) P(x2) • x P(x) P(x1) P(x2) • This is very useful in proving equivalences involving propositions that use quantifiers • Let us see some examples Lecture 1.3 - Predicate Logic, and Rules of Inference
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 Lecture 1.3 - Predicate Logic, and Rules of Inference
Reminder: in a proposition, all variables must be bound. 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 Lecture 1.3 - Predicate Logic, and Rules of Inference
True proposition • False proposition • Not a proposition • No clue c) b) b) b) 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) • xy P(x,y) • xy P(x,y) • x P(x,3) Lecture 1.3 - Predicate Logic, and Rules of Inference
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.” Predicates – Meaning of Nested Quantifiers • xy P(x,y) • xy P(x,y) • xy P(x,y) • xy P(x,y) Lecture 1.3 - Predicate Logic, and Rules of Inference
False True True False Nested Quantifiers – example N(x,y) = “x is sitting by y” • xy N(x,y) • xy N(x,y) • xy N(x,y) • xy N(x,y) Lecture 1.3 - Predicate Logic, and Rules of Inference
How do we know it? 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! Lecture 1.3 - Predicate Logic, and Rules of Inference
Axiom, postulates, hypotheses and previously proven theorems. Rules of inference Proof 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. Lecture 1.3 - Predicate Logic, and Rules of Inference
What rule of inference can we use to justify it? 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 Lecture 1.3 - Predicate Logic, and Rules of Inference
p p q Tautology: (p (p q)) q q 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. Inference Rule: Modus Ponens Lecture 1.3 - Predicate Logic, and Rules of Inference
q p q Tautology: (q (p q)) p p 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. Inference Rule: Modus Tollens Lecture 1.3 - Predicate Logic, and Rules of Inference
p Tautology: p (p q) p q Rules of Inference – Addition I am not a great skater. I am not a great skater or I am tall. Inference Rule: Addition Lecture 1.3 - Predicate Logic, and Rules of Inference
p q Tautology: (p q) p p Rules of Inference – Simplification I am not a great skater and you are sleepy. you are sleepy. Inference Rule: Simplification Lecture 1.3 - Predicate Logic, and Rules of Inference
p q q Tautology: ((p q) q) p p 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! Inference Rule: Disjunctive Syllogism Lecture 1.3 - Predicate Logic, and Rules of Inference
p q q r Tautology: ((p q) (q r)) (p r) p r 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. Inference Rule: Hypothetical Syllogism Lecture 1.3 - Predicate Logic, and Rules of Inference
Addition Modus Tollens Examples Amy is a computer science major. Amy is a math major or a computer science major. If Ernie is a math major then Ernie is geeky. Ernie is not geeky! Ernie is not a math major. Lecture 1.3 - Predicate Logic, and Rules of Inference
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 Lecture 1.3 - Predicate Logic, and Rules of Inference