Predicates and Quantifiers

Slides:



Advertisements
Similar presentations
Nested Quantifiers Needed to express statements with multiple variables Example 1: “x+y = y+x for all real numbers”  x  y(x+y = y+x) where the domains.
Advertisements

The Logic of Quantified Statements
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Section 1.3. More Logical Equivalences Constructing New Logical Equivalences We can show that two expressions are logically equivalent by developing.
Predicates and Quantifiers
Propositions and Connectives Conditionals and Bi-conditionals Quantifiers.
22C:19 Discrete Structures Logic and Proof Spring 2014 Sukumar Ghosh.
Discrete Mathematics Lecture 2 Alexander Bukharovich New York University.
Propositional Logic. Negation Given a proposition p, negation of p is the ‘not’ of p.
Discrete Mathematics Math 6A Instructor: M. Welling.
Discrete Structures Chapter 3: The Logic of Quantified Statements
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
Predicates & Quantifiers Goal: Introduce predicate logic, including existential & universal quantification Introduce translation between English sentences.
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.
The Foundations: Logic and Proofs
Discrete Maths Objective to introduce predicate logic (also called the predicate calculus) , Semester 2, Predicate Logic 1.
MATH 213 A – Discrete Mathematics for Computer Science Dr. (Mr.) Bancroft.
CS 103 Discrete Structures Lecture 05
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
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.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations 1.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
Section Predicates & Quantifiers. Open Statement 2 x > 8 p < q -5 x = y + 6 Neither true nor false.
Predicates and Quantified Statements
Chapter 2 The Logic of Quantified Statements. Section 2.1 Intro to Predicates & Quantified Statements.
CompSci 102 Discrete Math for Computer Science January 24, 2012 Prof. Rodger Slides modified from Rosen.
1 Sections 1.3 and 1.4 Predicates & Quantifiers. 2 Propositional Functions In a mathematical assertion, such as x < 3, there are two parts: –the subject,
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.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations 1.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
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.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Predicates and Quantifiers Dr. Yasir Ali. 1.Predicates 2.Quantifiers a.Universal Quantifiers b.Existential Quantifiers 3.Negation of Quantifiers 4.Universal.
Copyright © Peter Cappello 2011 Predicates & Quantifiers.
Section 1.5 and 1.6 Predicates and Quantifiers. Vocabulary Predicate Domain Universal Quantifier Existential Quantifier Counterexample Free variable Bound.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
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.
 To combine propositions using connectives  To construct the truth table of a given compound proposition  To define de Morgan Law for logic  To define.
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
3. The Logic of Quantified Statements Summary
CSE15 Discrete Mathematics 01/23/17
Truth Tables and Equivalent Statements
Chapter 1 – Logic and Proof
Predicates & Quantifiers
Rules of inference for quantifiers
The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
CMSC Discrete Structures
Chapter 1 The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
CSE 311 Foundations of Computing I
Nested Quantifiers Nested quantifiers are often necessary to express the meaning of sentences in English as well as important concepts in computer science.
Discrete Mathematics Lecture 3: Predicate and Quantifier
Predicates and Quantifiers
Discrete Mathematics Lecture 4 Logic of Quantified Statements
The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
Presentation transcript:

Predicates and Quantifiers

Propositional Logic Not Enough Given the statements: “All men are mortal.” “Socrates is a man.” It follows that “Socrates is mortal.” This can’t be represented in propositional logic. Need a language that talks about objects, their properties, and their relations.

Introducing Predicate Logic Predicate logic uses: Variables: x, y, z, … These represent objects, not propositions Predicates: P, Q, … These express properties of objects Example: let x be an integer and P denote the property “is a perfect square”; then P(x) means “x is a perfect square” Predicates are also called Propositional functions They are a generalization of propositions They become propositions (and have truth values) when their variables are replaced by actual values Example: P(9) is a true proposition, P(8) is a false

Propositional Functions Examples: Let P(x) denote “x > 0”; then: P(–3) is F. P(0) is F. P(3) is T. Let R(x, y, z) denote “x + y = z”; Find these truth values: R(2, –1, 5) ≡ 2 – 1 = 5 is F. R(3, 4, 7) ≡ 3 + 4 = 7 is T. R(1, 3, z) ≡ 1 + 3 = z is not a proposition

Compound Expressions Connectives from propositional logic carry over to predicate logic. If P(x) denotes “x > 0,” then: P(3) ∨ P(–1) is T P(3) ∧ P(–1) is F Expressions with variables are not propositions and therefore do not have truth values. For example, P(3) ∧ P(y) P(x) → P(y) They become propositions when: variables are bound to values, or the expressions are used with quantifiers

Quantifiers Quantifiers express the meaning of the words all and some: Charles Peirce (1839-1914) Quantifiers express the meaning of the words all and some: “All men are Mortal.” “Some cats do not have fur.” The two most important quantifiers are: Universal Quantifier, “For all,” symbol:  Existential Quantifier, “There exists,” symbol:  Quantifiers are applied to values in a given domain U x P(x) asserts P(x) is T for every x in the domain x P(x) asserts P(x) is T for some x in the domain

Universal Quantifier Examples: x P(x) is read as: “For all x, P(x)” or “For every x, P(x)” Examples: If P(x) denotes “x > 0” and U is the domain of integers, then x P(x) is F. If P(x) denotes “x > 0” and U is the domain of positive integers, then x P(x) is T. If P(x) denotes “x is even” and U is the domain of integers, then x P(x) is F.

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) denotes “x > 0” and U is integers, then x P(x) is T. If P(x) denotes “x < 0” and U is positive integers, then x P(x) is F. If P(x) denotes “x is even” and U is integers, then x P(x) is T.

Thinking about Quantifiers as Loops To evaluate x P(x) loop through all x in the domain. If at every step P(x) is T, then x P(x) is T. If at a step P(x) is F, then x P(x) is F and the loop terminates. To evaluate x P(x) loop through all x in the domain. If at some step, P(x) is T, then x P(x) is T and the loop terminates. If the loop ends without finding an x for which P(x) is T, then x P(x) is F. Even if the domains are infinite, we can still think of the quantifiers in this fashion, but the loops may not terminate.

Thinking about Quantifiers as Conjunctions and Disjunctions A proposition with  is equivalent to a conjunction of propositions without quantifiers A proposition with  is equivalent to a disjunction of propositions without quantifiers. Example: If U consists of the integers 1, 2, 3 then: Even if the domains are infinite, we can still think of the quantifiers in this way, but the expressions will be infinite.

Properties of Quantifiers The truth value of quantifiers depend on both the function P(x) and the domain U. Examples: Assume P(x) is “x < 2” If U is positive integers then x P(x) is T, butx P(x) is F. If U is negative integers then both x P(x) and x P(x) are T. If U consists of 3, 4, and 5 then both x P(x) andx P(x) are F.

Translating from English to Logic Example 1: Translate this sentence into predicate logic: “Every student in this class has taken a course in Java.” Solution: First decide on the domain U. Solution 1: If U is all students in this class, define a propositional function J(x) denoting “x has taken a course in Java” and translate as x J(x). Solution 2: But if U is all people, also define a propositional function S(x) denoting “x is a student in this class” and translate as x (S(x)→ J(x)). Note: x (S(x) ∧ J(x)) is not correct. What does it mean?

Translating from English to Logic Example 2: Translate the following into predicate logic: “Some student in this class has taken a course in Java.” Solution: First decide on the domain U. Solution 1: If U is all students in this class, then x J(x) Solution 1: But if U is all people, then translate as x (S(x) ∧ J(x)) Note: x (S(x)→ J(x)) is not correct. What does it mean?

Equivalences in Predicate Logic Statements with predicates and quantifiers are logically equivalent iff they have the same truth value for every predicate used in these statements and for every domain used for the variables in the expressions The notation S≡T indicates that S and T are logically equivalent. Example: x ¬¬S(x) ≡ x S(x)

Negating Quantified Expressions Example: Express “Every student in this class has taken a course in Java.” The domain is students in this class J(x) is “x has taken a course in Java” The statement is: x J(x) Negate the statement: “It is not the case that every student in this class has taken Java.” ¬x J(x) This implies that: “There is a student in this class who has not taken calculus.” x ¬J(x)

Negating Quantified Expressions Now Consider: “There is a student in this class who has taken a course in Java.” x J(x) Negating the statement: “It is not the case that there is a student in this class who has taken Java.” ¬x J(x) This implies that: “No student in this class has taken Java,” or (more awkwardly) “Every student in this class has not taken Java.” x ¬J(x)

De Morgan’s Laws for Quantifiers The formal rules for negating quantifiers are: