Section 1.3: Predicates and Quantifiers

Slides:



Advertisements
Similar presentations
Chapter 3 Direct Proof and Proof by Contrapositive
Advertisements

CPSC 121: Models of Computation Unit 6 Rewriting Predicate Logic Statements Based on slides by Patrice Belleville and Steve Wolfman.
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.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
Section 1.4: Nested Quantifiers We will now look more closely at how quantifiers can be nested in a proposition and how to interpret more complicated logical.
RMIT University; Taylor's College This is a story about four people named Everybody, Somebody, Anybody and Nobody. There was an important job to be done.
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.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 11 Introduction to Predicate Logic Limitations of Propositional Logic Predicates, quantifiers and propositions.
Lecture # 21 Predicates & Quantifiers
1 Predicates and Quantifiers CS 202, Spring 2007 Epp, Sections 2.1 and 2.2 Aaron Bloomfield.
Predicates and Quantifiers
Predicates and Quantifiers
Chapter 1: The Foundations: Logic and Proofs
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
The Foundations: Logic and Proofs
Logical Equivalence & Predicate Logic
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
Section 1.2: Propositional Equivalences In the process of reasoning, we often replace a known statement with an equivalent statement that more closely.
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.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
CSS342: Quantifiers1 Professor: Munehiro Fukuda. CSS342: Quantifiers2 Review of Propositions Proposition: a statement that is either true or false, but.
Lecture 7 – Jan 28, Chapter 2 The Logic of Quantified Statements.
Discrete Mathematics CS 2610 August 22, Agenda Last class Propositional logic Logical equivalences This week Predicate logic & rules of inference.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
Discrete Structures – CNS 2300
Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication.
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.
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
Discrete Mathematics Mathematical reasoning: think logically; know how to prove Combinatorial analysis: know how to count Discrete structures: represent.
1 Outline Quantifiers and predicates Translation of English sentences Predicate formulas with single variable Predicate formulas involving multiple variables.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
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.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Propositional and predicate logic
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 1 Predicates and Quantifiers 1.4.
Logic Hubert Chan [O1 Abstract Concepts] [O2 Proof Techniques]
Chapter 2 Sets and Functions.
CSE15 Discrete Mathematics 01/23/17
Logic Hubert Chan [O1 Abstract Concepts] [O2 Proof Techniques]
Predicate Calculus Discussion #14 Chapter 2, Section 1 1/20.
Discussion #14 Predicate Calculus
Chapter 1 The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
CS201: Data Structures and Discrete Mathematics I
CS 220: Discrete Structures and their Applications
Predicate Calculus Discussion #14 Chapter 2, Section 1.
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Negations of quantifiers
Discrete Mathematics Lecture 3: Predicate and Quantifier
Discrete Mathematics CMP-200 Propositional Equivalences, Predicates & Quantifiers, Negating Quantified Statements Abdul Hameed
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Predicates and Quantifiers
CS201: Data Structures and Discrete Mathematics I
Predicate Calculus. Predicate Calculus Topics Predicates Variables and instantiation Quantifiers Logical expressions Bound and free variables.
Presentation transcript:

Section 1.3: Predicates and Quantifiers We will now discuss the area of predicate logic. Predicate logic builds on propositional logic by introducing quantifiers to handle special types of “variables” in a mathematical statement. With quantifiers and predicates, we can express a great deal more than we could using propositional logic.

Predicates Consider the statement “x > 3” read as “x is greater than 3”. Recall that this is not a proposition, since it isn’t either true or false but not both. We can break this statement into two parts. First of all, we have the variable “x”. The second part of the statement, “is greater than 3”, is a property that the variable x may or may not possess. We call such a property a predicate. We could denote the predicate “is greater than 3” by the symbol P. Then we will use P(x) to denote the statement “x is greater than 3”. In this way, we can consider P(x) to be a propositional function and if we give the variable x a value then P(x) will take on a truth value and hence become a proposition.

Ex: P(4) is the proposition “4 is greater than 3” which is true. P(0) is the proposition “0 is greater than 3” which is false. We can also consider statements that have more than one variable, such as “x + y = 7”. We can use Q(x, y) to denote this predicate. If we assign values to the variables x and y, then this statement now becomes a proposition with a truth value. Ex: Q(3, 4) is the proposition “3 + 4 = 7” which is true. Ex: Let R(x, y, z) denote “x + y = z”. Then R(2, 3, 4) is the proposition “2 + 3 = 4” which is false.

Quantifiers As we have seen, if we assign values to all of the variables in a propositional function, the resulting statement becomes a proposition. We will now discuss a technique, called quantification, whereby we stipulate how we want a variable to be treated which will also result in a proposition if we do this for all variables.

Universal Quantification Some mathematical statements assert that a property is true for all values that a variable can take on (called the universe of discourse). We use universal quantification to denote this. Def: The universal quantification of P(x) is the proposition “P(x) is true for all values of x in the universe of discourse.” This is denoted xP(x) and read as “for all x, P(x)”.

Ex: Let P(x) denote the statement “x + 1 > x” Ex: Let P(x) denote the statement “x + 1 > x”. What is the truth value of xP(x) where the universe of discourse is all integers? The proposition xP(x) is “x + 1 > x for all integers x”. This proposition is true. If you take x to be any integer value, then x + 1 is always going to turn out to be greater than x. Ex: Let Q(x) denote the statement “x > 5”. What is the truth value of xQ(x) where the universe of discourse is all integers? The proposition xQ(x) is “x > 5 for all integers x”. This proposition is false. “x > 5” is not true for all integers x. If you take x to be 4, for example, “4 > 5” is false. Note that if all elements in the universe of discourse could be listed, say el1, el2, el3, …, eln, then xP(x) is logically equivalent to “P(el1)  P(el2)  P(el3)  …  P(eln)”.

Ex: Let P(x) denote “x2 < 10” Ex: Let P(x) denote “x2 < 10”. What is the truth value of the proposition xP(x) where the universe of discourse for x is the integers 1, 2, 3, and 4? The proposition is false since P(4), which is “x2 < 10” is false. Note that since P(x) is true for x = 1, x = 2, and x = 3, then the proposition would have been true if 4 weren’t in the universe of d. Realize that to show that a universally quantified statement, xP(x), is false, we need only find one value from the universe of discourse that x can take on which makes P(x) false. Such a value of x is called a counterexample. However to show that xP(x) is true, we have to show that P(x) is true for every possible value in the universe of discourse that x can take on.

Existential Quantification Some mathematical statements assert that there is some value (from the universe of discourse) that a variable can take on for which a property is true. We use existential quantification to denote this. Def: The existential quantification of P(x) is the proposition “There exists an element x in the universe of discourse for which P(x) is true.” This is denoted xP(x) and read as “for some x, P(x)”.

Ex: Let P(x) denote the statement “x + 1 > x” Ex: Let P(x) denote the statement “x + 1 > x”. What is the truth value of xP(x) where the universe of discourse is all integers? The proposition xP(x) is “x + 1 > x for some integer x”. This proposition is true. If you take x to be 5, for example, then x + 1 = 6 which is greater than 5. So 5 is a satisfying value. Ex: Let Q(x) denote the statement “x > 5”. What is the truth value of xQ(x) where the universe of discourse is all integers? The proposition xQ(x) is “x > 5 for some integer x”. This proposition is true. “x > 5” is true for x = 10, for example. Note that if all elements in the universe of discourse could be listed, say el1, el2, el3, …, eln, then xP(x) is logically equivalent to “P(el1)  P(el2)  P(el3)  …  P(eln)”.

Ex: Let P(x) denote “x2 > 16” Ex: Let P(x) denote “x2 > 16”. What is the truth value of the proposition xP(x) where the universe of discourse for x is the integers 1, 2, 3, and 4? The proposition is false since P(x), which is “x2 > 16” is false for x = 1, x =2, x =3, and x =4 (all values from the universe of discourse). Note that to show that an existentially quantified statement, xP(x), is true, we need only find one value from the universe of discourse that x can take on which makes P(x) true. However to show that xP(x) is false, we have to show that P(x) is false for every possible value in the universe of discourse that x can take on. If we know that xP(x) is true for some predicate P(x), what can we say about xP(x)? xP(x)  xP(x) [but not conversely].

Binding Variables Def: When a quantifier is used on a variable or when we assign it a value in a propositional function, we say that this variable is bound. An occurrence of a variable that is not bound is said to be free. All of the variables that appear in a propositional function must be bound to turn it into a proposition.

Ex: Let R(x, y, z) denote “x + y = z” Ex: Let R(x, y, z) denote “x + y = z”. Let the universe of discourse for x, y, and z be all integers. Consider xyR(x,y,z). In this statement, the variables x and y are bound, but z is left free. Consequently, this is not a proposition. Ex: Now consider xyR(x,y,10). Now all three variables are bound so this is a proposition. What is it’s truth value? The statement is “for all x, there exists some y, such that x + y = 10”. This is true. For any x, there does exist some y (namely 10 - x) such that x + y = 10.

I like to think of determining the truth value of a quantified statement as an adversarial game. The quantifiers are read from left to right. When a universal quantifier is encountered (), my adversary gets to choose the value of that variable. My adversary is trying to force the statement to be false. When an existential quantifier is encountered (), I get to choose the value of the variable. I am trying to force the statement to be true. If I can win this game (that is, force the statement to be true) no matter how my adversary chooses, then the quantified statement is true. However, if my adversary can win this game (that is, force the statement to be false) no matter how I choose, then the quantified statement is false. The order that the quantifiers occur is very important.

Ex: Let us consider our previous example, xyR(x,y,10). Since the first quantifier I encounter is the universal quantification of x, my adversary must choose a value for x first. He may choose any integer value that he wants. Let us say he chooses the integer c. Now x = c (c may be 6, or –100, or any possible integer, but I need to think of it in arbitrary terms because I must be able to counter my adversary for any possible choice he could make. The important point is that x is now fixed to some integer c that he has chosen. Next I encounter the existential quantification of y. Now I must choose a value for y, but I do know what my adversary chose for x since he had to choose first. I want to make this statement true so I choose y to be equal to 10 – c. Now the statement “x + y = 10” becomes “c + 10 – c = 10” which is true. Since I left c as an arbitrary choice then I know that no matter what move my adversary makes, I can force the statement to be true. So the proposition xyR(x,y,10) is true.

Ex: What if the order were reversed, yxR(x,y,10)? Now I must choose y first. I can choose anything, so let’s represent my choice as c. Then my adversary must choose. He can choose to make x any integer other than 10 – c and he will force the statement to be false. So the proposition yxR(x,y,10) is false. Ex: What about xy(xy = 0)? This proposition is true. First my adversary chooses an integer value for x. Say he chooses the value c. Then I must choose a value for y that will force the statement to be true. I choose y = 0. Then c0 = 0. Ex: What about yx(xy = 0)? Now I must choose first but in this case it doesn’t matter. I choose y = 0. Then when my adversary chooses x, no matter what he chooses x0 = 0. So this proposition is true as well.

Note that yxP(x,y)  xyP(x,y) Note that yxP(x,y)  xyP(x,y). That is, if I can choose first and thwart my adversary no matter what value he chooses (even taking my choice into account), then surely if he has to choose first, I can still thwart him. I simply choose the same value that I would have chosen to thwart him if I had had to choose first. Ex: y(y > 5). In this case, my adversary has no moves at all. I choose a value for y that makes y > 5 (I could choose 6). So this proposition is true. Ex: x(x + 1 > x). In this case, I have no moves. My adversary must try to choose a value for x which would make this statement false. However, there is no possible value for x that makes this statement false. So the proposition is true.

Negations Sometimes we will want to consider the negation of a quantified statement. Recall that the negation of a statement is true if the original statement is false and the negation is false if the original statement is true. This will be helpful to us in determining the truth value of a quantified statement.

Ex: Consider the statement “Every apple is red” Ex: Consider the statement “Every apple is red”. We can express this universally quantified statement as aR(a), where R(a) is the predicate “a is red” and the universe of discourse for a is all apples. The negation of this statement is “It is not the case that Every apple is red”. This statement says that there is some apple that is not red. This could be expressed as an existentially quantified statement, a¬R(a). The above example illustrates the equivalence: ¬xP(x)  xP(x) Ex: Consider the statement “Some apple is red”. We can express this existentially quantified statement as aR(a), where R(a) is the predicate “a is red” and the universe of discourse for a is all apples. The negation of this statement is “It is not the case that Some apple is red”. This statement says that every apple is not red. This could be expressed as a universally quantified statement, a¬R(a). This example illustrates the equivalence: xP(x)  x¬P(x)

Recall De Morgan’s laws: (p  q)  p  q (p  q)  p  q Remember that we said we could generalize these laws to an arbitrary number of propositions: (p1  p2  …  pn)  p1  p2  …  ¬pn (p1  p2  …  pn)  p1  p2  …  ¬pn These previous two equivalences are simply the generalization of De Morgan’s laws to an infinite number of props: ¬xP(x)  xP(x) is (P(x1)  P(x2)  P(x3)  … )  P(x1)  P(x2)  ¬P(x3)  … xP(x)  x¬P(x) is (P(x1)  P(x2)  P(x3)  … )  P(x1)  P(x2)  ¬P(x3)  …

Ex: What is the negation of x(x2 = 2)? We are looking for ¬x(x2 = 2) so by applying the rule we have x¬(x2 = 2) which is the same as x(x2  2). What is the truth value of x(x2 = 2)? Sort of a trick question. I never specified the universe of discourse for x. If it is the integers, then the statement is false. There is no integer x for which x2 = 2. However, if our universe of discourse were all real numbers then the statement is true since for x = 2 then x2 = 2. Ex: What is the negation of xy(x + y = 0)? This requires two applications of our formulas. We are looking for ¬xy(x + y = 0)  xy(x + y = 0)  xy(x + y = 0)  xy(x + y  0). It turns out that the original statement is true, for any x, I can find a y (namely –x) such that the sum of x and y is 0. Hence the negation is false. This is the case for reals or integers.

Translating from English Once again, we have introduced all of this machinery in order to be able to express a mathematical statement in precise terms. So once again, it will be a very important task to be able to take a statement made in English and translate it into an appropriate statement in predicate logic using quantifiers.

Ex: “Every student in this class has studied calculus.” There are multiple levels of detail that we could choose to go to when translating this statement but first of all we will need a predicate C(x): “x has studied calculus”. 1. xC(x) where the universe of discourse for x is all students in this class. 2. x(S(x)C(x)) where the universe of discourse for x is all people and C(x) is “x is a student in this class”. The level of detail that you choose to go to is highly dependent on what you will be using the quantified statement for. In some instances, you may need to consider all people and use a predicate such as S(x) to indicate people who are students in this class. In other situations, you may only need to consider students in this class and so the introduction of an S(x) predicate is unnecessary. It is acceptable to simply restrict the universe of discourse to students in this class. [Precedence discussion; p  q  r; p:T, q:F, r:T; p  q  r; F,T,F]

Ex: “Everyone has a mother.” xyM(y, x) [notice the order] where the universe of discourse for x and y is all people and M(m, c) is “m is the mother of c”. Once again, if we didn’t want this level of detail the statement could have been simply represented as a universally quantified P(x) where P(x) is “x has a mother”. Ex: “There are at least two people who play both soccer and tennis.” Let’s use a predicate P(p, s): “p plays s”. One way to express it is xy(P(x, soccer)  P(x, tennis)  P(y, soccer)  P(y, tennis)  (x  y)) The last part x  y is important. Notice that I want to express that there are at least two people. The two existential quantifications (of x and y) give me some x and some y, but the last part is necessary to ensure that x and y are different people. This sort of subtle issue (where a variable may become instantiated to the same value) often arises in programs.

Quantified logic statements will provide the foundation for the mathematical reasoning that we will do throughout the class. Consequently, the ability to form quantified logical statements is very important. Because we can express a desired English statement in predicate logic in a large number of ways (the best of which is dependent on the subsequent reasoning that will be done) there are no good guidelines or rules of thumb. But though there are an enormous number of ways to correctly translate an English statement into a quantified logic statement, there is an even larger number of ways to incorrectly express the statement with quantified logic. This is a highly intuitive and very creative sort of task so the best way to learn this material is to work examples. There are a great deal of examples in section 1.3 of the text that we did not go through in lecture. I strongly suggest that you spend the time to read through and understand these examples. When you work the exercises given in the coming homework, for each attempted translation you should ask yourself whether the translation has the intended meaning of the stmt.

Homework problems from Section 1.3 Problems 2, 5, 8, 10, 12, 13, 15, 21, 23, 31, 33, 48 from this section will be included on the next homework assignment. Homework 2 is now posted to the toolkit.