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,

Slides:



Advertisements
Similar presentations
Nested Quantifiers Section 1.4.
Advertisements

1.3 Predicates and Quantifiers
Rosen 1.3 Propositional Functions Propositional functions (or predicates) are propositions that contain variables. Ex: Let P(x) denote x > 3 P(x) has.
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.
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 
2009/91 Predicates and Quantifiers (§1.3) In the sentence “x is greater than 3”: The phrase “x” denotes the subject - the object or entity that the sentence.
Predicate Logic and Quantifies
Discrete Mathematics Math 6A Instructor: M. Welling.
CSE115/ENGR160 Discrete Mathematics 01/25/11 Ming-Hsuan Yang UC Merced 1.
Formal Logic Mathematical Structures for Computer Science Chapter 1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
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.
Predicates and Quantifiers
Section 1.3: Predicates and Quantifiers
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.
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
The Foundations: Logic and Proofs
Logical Equivalence & Predicate Logic
MATH 213 A – Discrete Mathematics for Computer Science Dr. (Mr.) Bancroft.
Formal Logic Mathematical Structures for Computer Science Chapter Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
Nested Quantifiers. 2 Nested Iteration Let the domain be {1, 2, …, 10}. Let P(x, y) denote x > y.  x,  y, P(x, y) means  x, (  y, P(x, y) ) Is the.
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: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
(CSC 102) Lecture 8 Discrete Structures. Previous Lectures Summary Predicates Set Notation Universal and Existential Statement Translating between formal.
Nested Quantifiers Section 1.5.
CompSci 102 Discrete Math for Computer Science January 24, 2012 Prof. Rodger Slides modified from Rosen.
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 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 Predicates and Quantifiers 1.4 Nested Quantifiers.
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
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
Copyright © Peter Cappello 2011 Predicates & Quantifiers.
Discrete Mathematics Mathematical reasoning: think logically; know how to prove Combinatorial analysis: know how to count Discrete structures: represent.
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.
Discrete Mathematical الرياضيات المتقطعة. Example 12 June OR Q(x,y): x+y=x-y a) Q(1,1): 2=0 False b) Q(2,0): 2+0=2-0 True c) Q(1,y): 1+y=1-y False(take.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 1 Predicates and Quantifiers 1.4.
CSE15 Discrete Mathematics 01/25/17
CSE15 Discrete Mathematics 01/23/17
Predicates & Quantifiers
Chapter 1 The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
CS 220: Discrete Structures and their Applications
CHAPTER 1: LOGICS AND PROOF
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 4 & 5: Predicate and Quantifier
Discrete Mathematics Lecture 3: Predicate and Quantifier
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
ICS 253: Discrete Structures I
Predicates and Quantifiers
Lecture 1.3: Predicate Logic
Presentation transcript:

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, which is the variable (x in this case) –the predicate, which is the property the subject may (or may not) have (< 3 in the example) We can denote such a predicate as a propositional function on x, or P(x) When x has a value, P(x) is a proposition

3 Propositional Functions Let Q(x,y) denote the statement “x is the capital of y” What are the truth values of: Q(Denver, Colorado) Q(Detroit, Michigan) Q(Massachusetts, Boston) Q(New York, New York) A propositional function can include more than one variable; for example:

4 Propositional Functions and Programs In a program, a selection structure involves evaluating a propositional function For example: if (x > 0) x++; Means let P(x) = x > 0 if P(x) is true, increment x otherwise, do nothing

5 Quantifiers As we have seen, we can create a proposition from a propositional function by assigning a value to its subject(s) We can also create a proposition by quantifying the propositional function There are two types of quantifiers: –universal –existential

6 Universal Quantification The domain of a problem is called its universe of discourse The universal quantification of P(x) is the assertion that P(x) is true for all values of x in the universe of discourse Universal quantification is denoted  xP(x) which may be read “for all (or every) value of x, P(x) is true”

7 Universal Quantification Suppose P(x) is the statement “x spends more than 3 hours every day in class” and the universe of discourse is the set of all students Then  xP(x) would be the statement “All students spend more than 3 hours every day in class” This could also be expressed:  x(S(x)  P(x)) where S(x) = “x is a student”

8 Universal Quantification & Conjunction When all elements in a universe of discourse can be listed, e.g. (x 1, x 2, …, x n ) then  xP(x) can be written as: P(x 1 )  P(x 2 )  …  P(x n ) For example, suppose P(x) = x < x 2 where the universe of discourse is the positive integers less than 5 For  xP(x) to be true, P(0)  P(1)  P(2)  P(3)  P(4) would have to be true; since 0 < 0 and 1 < 1 are untrue,  xP(x) is false

9 Existential Quantification The assertion that there is an element with a certain property The notation  xP(x) means there exists at least one element x in the universe of discourse for which P(x) is true

10 Existential Quantification & Disjunction When all elements in a universe of discourse can be listed, e.g. (x 1, x 2, …, x n ) then  xP(x) can be written as: P(x 1 )  P(x 2 )  …  P(x n ) For example, suppose P(x) = x < x 2 where the universe of discourse is the positive integers less than 5 For  xP(x) to be true, P(0)  P(1)  P(2)  P(3)  P(4) would have to be true; since 2 < 4,  xP(x) is true

11 Universal vs. Existential Quantification  xP(x)True if P(x) is trueFalse if there for all values of xis at least one in universe ofvalue x where discourseP(x) is false  xP(x)True if there existsFalse if P(x) is at least one value xfalse for every x for which P(x)in the universe is trueof discourse

12 Quantifiers & Looping Can be helpful to think in terms of looping and searching when seeking truth value of a quantification For  xP(x), loop through all N values in universe of discourse; if all are true,  xP(x) is true For  xP(x), loop through all N values; if any are true,  xP(x) is true

13 Binding Variables A variable is said to be bound if it has a value assigned to it or if a quantifier is used on it A variable is free if neither of these conditions applies

14 Binding Variables In order to turn a propositional function into a proposition, all variables in the function must be bound Can have multiple quantifications for propositional functions involving more than one variable The order of quantifiers is important unless all are of the same type (all existential or all universal)

15 Example Are these quantifications logically equivalent?  x  y P(x,y)  y  x P(x,y) There exists an x forFor every value of y there which P(x,y) is trueis a value of x for which for every value of yP(x,y) is true So there must be an xSo x can depend on y for which the function is true regardless of y - x is an independent constant If the first is true, the second is true - but not vice-versa

16 Translating Quantified Expressions Suppose W(x,y) is the propositional function “student x has taken class y” and the universe of discourse for x is students in this class, while the universe of discourse for y is classes at Kirkwood Then the quantification  y(W(Tim,y)  W(Dan,y)) means there exists a class at Kirkwood for which the statements “Tim has taken this class” and “Dan has taken this class” is true What does  y  x(W(x,y)) mean?

17 Translating Quantified Statements Suppose the universe of discourse for x, y and z is the set of real numbers. What is the meaning of the following quantification?  x  y  z (z * (x + y) = (z * x) + (z * y)) This is the distributive law for multiplication: For all real numbers x, y and z, the product of z and the sum of x and y is equal to the sum of the products of z and x and z and y

18 Translating Quantified Statements Can translate from English into logical expressions, as well as vice versa For example, suppose L(x,y) is the propositional function x loves y, and the universe of discourse for x and y is all the people in the world The quantification “Everybody loves me” can be denoted as:  x L(x, me) How would you denote “I love everybody” and “Somebody loves me?”

19 More “love” examples There is somebody whom everybody loves:  y  x L(x,y) Everybody loves somebody:  x  y L(x,y) There is somebody whom nobody loves:  y  x  (L(x,y))

20 Nested Loops & Multiple Quantifications  x  y P(x,y): loop through all values of x; in each x loop, loop through all values of y; true if no false values found  x  y P(x,y): loop through all values of x; loop through all y values at each x until a y is found for which P(x,y) is true - proposition is true if there is such a y for every x

21 Nested Loops & Multiple Quantifications  x  y P(x,y): loop through all values of x until we find an x for which P(x,y) is true for all values of y  x  y P(x,y): start looping through x values; at each x, loop through y values - if we hit at least one x,y where P(x,y) is true, then the proposition is true

22 Summary of truth values for multiple quantifications  x  y P(x,y)True if P(x,y) isFalse if there is at least one  y  x P(x,y)true for everyx,y pair for which P(x,y) x,y pairis false  x  y P(x,y)True if there is aFalse if there is an x for y that makes P(x,y)which P(x,y) is false for true for every xevery y  x  y P(x,y)True if there is anFalse if for every x there x for which P(x,y)is a y for which P(x,y) true for every yis false  x  y P(x,y)True if there is atFalse if P(x,y) is false  y  x P(x,y) least 1 x,y pair forfor every x,y pair which P(x,y) is true

23 Negations of quantified expressions The negation of a universal quantification is the existential quantification of the negation The negation of an existential quantification is the universal quantification of the negation

24 Negations of quantified expressions  x P(x)   x  P(x) True if P(x) is falseFalse if there is an x for for every value of xwhich P(x) is true  x P(x)   x  P(x) True if there existsFalse if P(x) is true for an x for which P(x)every x is false

25 Section 1.3 Predicates & Quantifiers - ends -