Discrete Maths Objective to introduce predicate logic (also called the predicate calculus) 242-213, Semester 2, 2014-2015 3. Predicate Logic 1.

Slides:



Advertisements
Similar presentations
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Advertisements

Section 1.3. More Logical Equivalences Constructing New Logical Equivalences We can show that two expressions are logically equivalent by developing.
Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
Predicates and Quantifiers
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
Discrete Maths 4. Proofs Objectives
Discrete Mathematics Lecture 2 Alexander Bukharovich New York University.
Discrete Structures Chapter 3: The Logic of Quantified Statements
Formal Logic Mathematical Structures for Computer Science Chapter 1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
First Order Logic. Propositional Logic A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
1 Predicates and Quantifiers CS 202, Spring 2007 Epp, Sections 2.1 and 2.2 Aaron Bloomfield.
Predicates and Quantifiers
Section 1.3: Predicates and Quantifiers
Predicates and Quantifiers
Chapter 1: The Foundations: Logic and Proofs
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
The Foundations: Logic and Proofs
Logical Equivalence & Predicate Logic
1st-order Predicate Logic (FOL)
CS 103 Discrete Structures Lecture 05
1 Predicates and Quantifiers CS/APMA 202, Spring 2005 Rosen, section 1.3 Aaron Bloomfield.
Chapter 2 The Logic of Quantified Statements. Section 2.4 Arguments with Quantified Statements.
Section 1.5. Section Summary Nested Quantifiers Order of Quantifiers Translating from Nested Quantifiers into English Translating Mathematical Statements.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Chapter 1, Part II With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the.
© Jalal Kawash 2010Peeking into Computer Science George Boole English Mathematician His The Mathematical Analysis of Logic, 1848 is the first.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations 1.
Statements with Multiple Quantifiers. When a statement contains more than one quantifier, we imagine the actions suggested by the quantifiers as being.
Section Predicates & Quantifiers. Open Statement 2 x > 8 p < q -5 x = y + 6 Neither true nor false.
(CSC 102) Lecture 8 Discrete Structures. Previous Lectures Summary Predicates Set Notation Universal and Existential Statement Translating between formal.
Predicates and Quantified Statements
Chapter 2 The Logic of Quantified Statements. Section 2.1 Intro to Predicates & Quantified Statements.
Nested Quantifiers Section 1.5.
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations 1.
Discrete Structures – CNS 2300
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
Predicates and Quantifiers Dr. Yasir Ali. 1.Predicates 2.Quantifiers a.Universal Quantifiers b.Existential Quantifiers 3.Negation of Quantifiers 4.Universal.
Discrete Mathematics Mathematical reasoning: think logically; know how to prove Combinatorial analysis: know how to count Discrete structures: represent.
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
1 Introduction to Abstract Mathematics Chapter 3: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 3.1.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Section 1.5. Section Summary Nested Quantifiers Order of Quantifiers Translating from Nested Quantifiers into English Translating Mathematical Statements.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations 1.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 1 Predicates and Quantifiers 1.4.
The Foundations: Logic and Proofs
CSE15 Discrete Mathematics 01/23/17
The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
Chapter 1 The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
CS201: Data Structures and Discrete Mathematics I
1st-order Predicate Logic (FOL)
Discrete Mathematics Lecture 3: Predicate and Quantifier
George Boole English Mathematician
Predicates and Quantifiers
Discrete Mathematics Lecture 4 Logic of Quantified Statements
The Foundations: Logic and Proofs
CS201: Data Structures and Discrete Mathematics I
The Foundations: Logic and Proofs
1st-order Predicate Logic (FOL)
Presentation transcript:

Discrete Maths Objective to introduce predicate logic (also called the predicate calculus) , Semester 2, Predicate Logic 1

Overview 1. Motivation 2. Predicate Logic 3. Quantifiers 4. From English to Logic 5. Domain Affects Translation 6. Translation Examples 7. More Information 2

1. Motivation Two sentences: “All men are mortal.” “Socrates is a man.” Is Socrates mortal? These sentences and question cannot be represented in propositional logic. We need a logic that talks about objects (things), their properties, and their relations. 3

2. Predicate Logic Based on prop. logic. The new features: Variables: x, y, z Predicates: P(x), M(x, y), etc. a bit like functions Two quantifiers ( ,  to be covered in a few slides) Predicates can be used to represent properties and relations. 4

A Predicate as a Property Let P(x) mean “x > 0” for integers. Then: P(- 3 ) is falseP( 0 ) is false P( 3 ) is trueP(5) is true We can draw properties as sets, and their objects (things) as elements in the sets: 5 U (domain) is the integers P

A Predicate as a Relation Let “x + y = z” be R(x, y, z) and U be the integers: R( 2,-1, 5 )is false R( 3,4,7 )is true R(x, 3, z)invalid (no unbound variables allowed) Let “x - y = z” be Q(x, y, z), with U as the integers: Q( 2,-1,3 )is true Q( 3,4,7 )is false Q(x, 3, z)invalid 6

Drawing a Relation There's no standard set way of drawing relations, because relations are more powerful than sets. One possible drawing for example 1: 7 U is the integers R... -2—1—5... 3—4—7

Compound Expressions All the operators from prop logic can be used in predicate logic (i.e. , , ,  ) e.g. let P(x) be “x > 0” Then: P( 3 ) ∨ P(-1) is true P( 3 ) ∧ P(-1) is false P( 3 ) → P(1) is true P( 3 ) → P(-1) is false Invalid, since unbound variables are not allowed: P( 3 ) ∧ P(y) P( x ) → P(y) 8

3. Quantifiers We use quantifiers to 'bind' variables in expressions: Two quantifiers: Universal Quantifier, “For all,” symbol:  English: every, all Existential Quantifier, “There exists,” symbol:  English: some, at least one 9 continued

3.1. Universal Quantifier  x P(x) is read as “For all x, P(x)” or “For every x, P(x)” Examples: If P(x) means “x > 0” and U is the integers, then  x P(x) is false If P(x) means “x > 0” and U+ is the positive integers, then  x P(x) is true If P(x) means “x is even ” and U is the integers, then  x P(x) is false 10

P(x) means “x > 0” and U+ is the positive integers, then  x P(x) is true 11  x as a Set Diagram U+ is the positive integers P  x means that all the values in U+ must be inside P; outside P is empty

3.2. Existential Quantifier  x P(x) is read as “For some x, P(x)”, or “There is an x such that P(x),” or “For at least one x, P(x).” Examples: If P(x) means “x > 0” and U is the integers, then  x P(x) is true. If P(x) means “x < 0” and U + is the positive integers, then  x P(x) is false If P(x) means “x is even ” and U is the integers, then  x P(x) is true. 12

 x as a Set Drawing If P(x) means “x > 0” and U is the integers, then  x P(x) is true. e.g. 13 U is the integers P  x means that some of the values in U must be inside P; outside P does not need to be empty

3.3. De Morgan’s Laws for Quantifiers The rules for negating quantifiers are: The table shows that: 14

as Set Diagrams 15 P U not  P U  x P(X) means every value is inside P  x P(X) means not every value is inside P this means there are some values outside P  x P(X) means there are some values inside P  x  P(X) means there are some values outside P the same

4. From English to Logic The translation of English to predicate logic is difficult because we now have quantifiers (  and  ). There are special translations for sentences using: 1. all-are 2. all-and-are 3. some-are 4. no-are 5. some-are-not 6. not-all-are 7. all-are-not 8. only-are 16 these two are the most important to memorize these two are the most important to memorize variations of 4.3 variations of 4.1

4.1. All-are: All p's are q's All   ; are   "All ps are q's" becomes  x (p(x)  q(x)) e.g. "All students are hard-working" becomes  x (s(x)  hw(x)) The common mistake is to translate all-are into  and  "All ps are q's" is NOT  x (p(x)  q(x)) Logically this is "too strong" 17  Memorize this one

All-are as Set Diagrams Why is  and  too strong? Consider non-students. Can non-students be hard-working?  and  allows this, but  and  does not. we use  and  because it is closest to the English meaning 18 U S hw U S  x (s(x)  hw(x))  x (s(x)  hw(x))  "All students are hard-working"

4.2. All-and-are "All men and women are human" becomes  x ( m(x)  w(x)  h(x)) Why not translate to:  x ( m(x)  w(x)  h(x)) The  is "too strong" 19 

Why "too strong"? Consider the meaning of m(x)  w(x) and m(x)  w(x) 20  mw  mw  These are people who are both men and women, which is too small a group. All men and women are...

4.3. Some-are: Some p's are q's Some   ; are   "Some ps are q's" becomes  x (p(x)  q(x)) e.g. "Some women are tall" becomes  x (w(x)  t(x)) Why not:  x (w(x)  t(x)) Logically this is "too weak" 21  Memorize this one

Why too weak? The  and  is too weak since it allows a non-women to be tall which does not 'fit' the English meaning. 22 U w t U wt  x (w(x)  t(x))  x (w(x)  t(x))  Some women are tall

4.4. No-are: No p's are q's "No" = 0 = not (1 or more) =   x "No p's are q's" becomes   x (p(x)  q(x))   x  (p(x)  q(x))   x (  p(x)   q(x))   x (p(x)   q(x)) or   x (  q(x)   p(x)) // reverse the p and q terms   x (q(x)   p(x)) translation + an outer not 4.3 translation + an outer not

4.5 Some-are-not Some p's are not q's becomes  x (p(x)   q(x)) translation + an inner not 4.3 translation + an inner not

4.6. Not-all-are Not all p's are q's becomes  x (p(x)  q(x))   x  (  p(x)  q(x))   x (p(x)   q(x))  "Some p's are not q's" translation + an outer not 4.1 translation + an outer not same as 4.5!

4.7. All-not All p's are not q's becomes  x (p(x)   q(x)) This is the same as 4.4. "No p's are q's" translation + an inner not

4.8. Only-are "Only p's are q's" can be drawn as "subset": Another way of saying this is "All q's are p's" which becomes:  x (q(x)  p(x)) The diagram for this is not the same shape as the one above because it also includes p's which are not q's: 27 U q p U q p

5. Domain Affects Translation “Every student in this class knows Java.” Decide on the domain U. Solution 1 : If U is all students in this class, let J(x) be “x knows Java”. Translate as  x J(x) Solution 2 : If U is all people, let S(x) be “x is a student in this class”. Translate as  x (S(x)→ J(x)) 28 U is 'class students' J U is 'all people' s j This one is better since U is more general. This one is better since U is more general.

6. Translation Examples 1. “Some student in this class has visited Mexico.” Solution: Let M(x) be “x has visited Mexico” and S(x) be “x is a student in this class,” and U be all people.  x (S(x) ∧ M(x)) 2. “Every student in this class has visited Canada or Mexico.” Solution: Let C(x) be “x has visited Canada.”  x (S(x)→ (M(x) ∨ C(x))) 29 Translation 4.3 Translation 4.1

U = {fleegles, snurds, thingamabobs} F(x): x is a fleegle S(x): x is a snurd T(x): x is a thingamabob Translate “Everything is a fleegle” Solution:  x F(x) 30 continued

U = {fleegles, snurds, thingamabobs} F(x): x is a fleegle S(x): x is a snurd T(x): x is a thingamabob “Nothing is a snurd.” Solution: ¬  x S(x) 31 continued Nothing == zero == not (1 or more) == ¬  x Nothing == zero == not (1 or more) == ¬  x

U = {fleegles, snurds, thingamabobs} F(x): x is a fleegle S(x): x is a snurd T(x): x is a thingamabob “All fleegles are snurds.” Solution:  x (F(x)→ S(x)) 32 continued Translation 4.1

U = {fleegles, snurds, thingamabobs} F(x): x is a fleegle S(x): x is a snurd T(x): x is a thingamabob “Some fleegles are thingamabobs.” Solution:  x (F(x) ∧ T(x)) 33 continued Translation 4.3

U = {fleegles, snurds, thingamabobs} F(x): x is a fleegle S(x): x is a snurd T(x): x is a thingamabob “No snurd is a thingamabob.” Solution: ¬  x (S(x) ∧ T(x)) 34 continued Translation 4.4

U = {fleegles, snurds, thingamabobs} F(x): x is a fleegle S(x): x is a snurd T(x): x is a thingamabob “If any fleegle is a snurd then it is also a thingamabob.” Solution:  x ((F(x) ∧ S(x))→ T(x)) 35 "any" suggests  and , but since it is the condition of if-then, just use  "any" suggests  and , but since it is the condition of if-then, just use 

7. More Information See the "Translation Tips" file on the course website goes into more detail about English translations Discrete Mathematics and its Applications Kenneth H. Rosen McGraw Hill, 2007, 7th edition chapter 1, section