Predicates and Quantifiers. Nested Quantifiers Discrete Mathematic. Chapter 1: Logic and Proof

Similar documents
Nested Quantifiers. Predicates and. Quantifiers. Agenda. Limitation of Propositional Logic. Try to represent them using propositional.

Section Summary. Section 1.5 9/9/2014

Discrete Mathematics and Its Applications

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

ICS141: Discrete Mathematics for Computer Science I

Thinking of Nested Quantification

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Section Summary. Predicates Variables Quantifiers. Negating Quantifiers. Translating English to Logic Logic Programming (optional)

! Predicates! Variables! Quantifiers. ! Universal Quantifier! Existential Quantifier. ! Negating Quantifiers. ! De Morgan s Laws for Quantifiers

Propositional Logic Not Enough

1.3 Predicates and Quantifiers

Proposi'onal Logic Not Enough

Lecture Predicates and Quantifiers 1.5 Nested Quantifiers

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Predicate Calculus lecture 1

Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo

Introduction to Sets and Logic (MATH 1190)

CSI30. Chapter 1. The Foundations: Logic and Proofs Nested Quantifiers

Predicate Logic & Quantification

Lecture 4. Predicate logic

CS 220: Discrete Structures and their Applications. Predicate Logic Section in zybooks

Chapter 1, Part II: Predicate Logic

Logical equivalences 12/8/2015. S T: Two statements S and T involving predicates and quantifiers are logically equivalent

Recall that the expression x > 3 is not a proposition. Why?

Discrete Structures Lecture 5

Predicate Logic. Example. Statements in Predicate Logic. Some statements cannot be expressed in propositional logic, such as: Predicate Logic

Predicate Logic Thursday, January 17, 2013 Chittu Tripathy Lecture 04

Topic #3 Predicate Logic. Predicate Logic

Introduction to first-order logic:

Predicate Calculus - Syntax

First order Logic ( Predicate Logic) and Methods of Proof

Discrete Structures Lecture Predicates and Quantifiers

Mat 243 Exam 1 Review

Before you get started, make sure you ve read Chapter 1, which sets the tone for the work we will begin doing here.

Predicates and Quantifiers. CS 231 Dianna Xu

Math.3336: Discrete Mathematics. Nested Quantifiers

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

Transparencies to accompany Rosen, Discrete Mathematics and Its Applications Section 1.3. Section 1.3 Predicates and Quantifiers

Predicate in English. Predicates and Quantifiers. Predicate in Logic. Propositional Functions: Prelude. Propositional Function

2/18/14. What is logic? Proposi0onal Logic. Logic? Propositional Logic, Truth Tables, and Predicate Logic (Rosen, Sections 1.1, 1.2, 1.

DISCRETE MATHEMATICS BA202

PREDICATE LOGIC. Schaum's outline chapter 4 Rosen chapter 1. September 11, ioc.pdf

Today s Lecture. ICS 6B Boolean Algebra & Logic. Predicates. Chapter 1: Section 1.3. Propositions. For Example. Socrates is Mortal

ECOM Discrete Mathematics

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

Announcements CompSci 102 Discrete Math for Computer Science

Propositional and First-Order Logic

Denote John by j and Smith by s, is a bachelor by predicate letter B. The statements (1) and (2) may be written as B(j) and B(s).

Chapter 2: The Logic of Quantified Statements. January 22, 2010

Discrete Structures for Computer Science

Lecture 3 : Predicates and Sets DRAFT

Propositional Functions. Quantifiers. Assignment of values. Existential Quantification of P(x) Universal Quantification of P(x)

Predicates, Quantifiers and Nested Quantifiers

MAT2345 Discrete Math

Logic and Propositional Calculus

Logic and Propositional Calculus

Predicate Calculus. Formal Methods in Verification of Computer Systems Jeremy Johnson

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

Solutions to Exercises (Sections )

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

Review: Potential stumbling blocks

Math Fundamentals of Higher Math

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

2. Use quantifiers to express the associative law for multiplication of real numbers.

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

MACM 101 Discrete Mathematics I. Exercises on Predicates and Quantifiers. Due: Tuesday, October 13th (at the beginning of the class)

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Department of Computer Science & Software Engineering Comp232 Mathematics for Computer Science

Logic and Proof. Aiichiro Nakano

2-4: The Use of Quantifiers

1 Predicates and Quantifiers

Variable Names. Some Ques(ons about Quan(fiers (but answers are not proven just stated here!) x ( z Q(z) y P(x,y) )

Predicate Calculus. CS 270 Math Foundations of Computer Science Jeremy Johnson

For all For every For each For any There exists at least one There exists There is Some

Introduction. Predicates and Quantifiers. Discrete Mathematics Andrei Bulatov

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

Predicate Calculus. Lila Kari. University of Waterloo. Predicate Calculus CS245, Logic and Computation 1 / 59

software design & management Gachon University Chulyun Kim

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

Reasoning. Inference. Knowledge Representation 4/6/2018. User

CS 1571 Introduction to AI Lecture 14. First-order logic. CS 1571 Intro to AI. Midterm

Announcement. Homework 1

ITS336 Lecture 6 First-Order Logic

1 The Foundation: Logic and Proofs

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

Predicate Logic. Andreas Klappenecker

Intro to Logic and Proofs

Predicate Logic: Sematics Part 1

MATH 22 INFERENCE & QUANTIFICATION. Lecture F: 9/18/2003

Lecture 3. Logic Predicates and Quantified Statements Statements with Multiple Quantifiers. Introduction to Proofs. Reading (Epp s textbook)

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

III. Elementary Logic

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

Semantics I, Rutgers University Week 3-1 Yimei Xiang September 17, Predicate logic

Chapter 2: The Logic of Quantified Statements

Logic Overview, I. and T T T T F F F T F F F F

Transcription:

Discrete Mathematic Chapter 1: Logic and Proof 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers Dr Patrick Chan School of Computer Science and Engineering South China University of Technology http://125.216.243.100/dm/ 2

Agenda Ch1.3 Predicates and Quantifiers Predicates Quantifiers Quantifiers with Restricted Domains Precedence of Quantifiers Logical Equivalences Involving Quantifiers Translation Ch1.4 Nested Quantifiers Nested Quantifiers 3 Limitation of Propositional Logic Limitation 1: p : John is a SCUT student q : Peter is a SCUT student r : Mary is a SCUT student Try to represent them using propositional variable However, these propositions are very similar A more powerful type of logic named Predicate Logic will be introduced 4

Predicates Predicate logic is an extension of propositional logic that permits concisely reasoning about whole classes of entities Joh n Peter Mary Propositional Logic treats simple propositions as atomic entities???? Predicate Logic distinguishes the subject of a sentence from its predicate 5 Predicates Predicate is a function of proposition Example: Propositional Function / Predicate Variable Conv enti on: lowerc as e variables denote object s UP PE RCASE variables denote predicates Predicate P(x) : x is greater than 3 Refer to The truth value of proposition function can only be determined when the values of variables are known 6

Predicates Example: P(x) : x > 3 What is P(4)? What is P(2)? P(x) : x is a singer P(Michael Jackson)? P(Bruce Lee)? 7 Predicates Propositional function can have more than one variables Example: P(x, y): x + y = 7 P(2, 5) Q(x, y, z): x = y + z Q(5, 2, 8) 8

Predicates General case A statement involving the n variables x 1, x 2,, x n can be denoted by P(x 1, x 2,, x n ) A statement of the form P(x 1, x 2,, x n ) is the value of the propositional function P at the n-tuple (x 1, x 2,, x n ) P is also called a n-place predicate or a n-ary predicate 9 Limitation of Propositional Logic Limitation 2: Given P: Every student in SCUT is clever Q: Peter is SCUT student What can we conclude? Peter is clever Given P: Peter cannot pass this Discrete Maths subject Q: Peter is a SCUT student What can we conclude? At least one student in SCUT cannot pass this Discrete Maths subject No rules of propositional logic can conclude the truth of this statement 10

Limitation of Propositional Logic Propositional Logic does not adequately express the following meanings Every, all, some, partial, at least one, one, etc A more powerful tool, Quantifiers, will be introduced 11 Quantifiers Quantification expresses the extent to which a predicate is true over a range of elements For example Using Propositional Logic p: Peter has iphone q: Paul has iphone r: Mary has iphone Using Predicate P(x) : x has iphone P(Peter) P(Paul) P(Mary) Peter Paul iphone Our class Using Quantifier P(x) : x has iphone For all x, P(x) is true Domain consists of all student in this class Mary Assume our class only contains three students 12

Quantifiers Four aspects should be mentioned in Quantification 1. Quantifier (e.g. all, some ) 2. Variable 3. Predicate 4. Domain Peter Paul Mary P(x) : x has iphone For all x, P(x) is true Our class Domain consists of all student in this class The area of logic that deals with predicates and quantifiers is called the Predicate Calculus 13 Quantifiers Universes of Discourse (U.D.s) Also called the domain of discourse Refers to the collection of objects being discussed in a specific discourse Example: P(x) : x breaths oxygen Domain consists of humans P(x) is true for all x? Domain consists of creatures P(x) is true for all x? Alien I do not need O 2 Creatures Human 14

Quantifiers Two types of quantification will be focused: Universal Quantification i.e. all, none Existential Quantification i.e. some, few, many 15 Quantifi ers Universal Quantifiers (ALL) Definition Universal quantification of P(x) is the statement P(x) is true for all values of x in the domain Notation: x P(x) LL, reversed A Read as "for all x P(x)" "for every x P(x)" Truth value True when P(x) is true for all x False otherwise An element for which P(x) is false is called a counterexam ple 16

Quantifi ers Universal Quantifiers When all of the elements in the universe of discourse can be listed one by one (discrete) (e.g. x 1,x 2,,x n ), x P(x) P(x 1 ) P(x 2 )... P(x n ) For example Our class has three students: John, Peter and Mary Every student in our class has attended the class I am he re ~ I am he re ~ I am he re ~ and and Our class John Peter Mary 17 Quantifi ers Existential Quantifiers (SOME) Definition Existential quantification of P(x) is the proposition There exists an element x in the domain such that P(x) is true Notation: x P(x) XIST, reversed E Read as There is an x such that P(x) There is at least one x such that P(x) "For some x P(x)" Truth value True when P(x) is false for all x False otherwise 18

Quantifi ers Existential Quantifiers When all of the elements in the universe of discourse can be listed one by one (discrete) (e.g. x 1,x 2,,x n ), x P(x) P(x 1 ) P(x 2 )... P(x n ) For example Our class has three students: John, Peter and Mary Any student in our class has attended the class I am he re ~ I am he re ~ I am he re ~ or or Our class John Peter Mary 19 Quantifiers Examples: P(x): x+1>x, U.D.s: the set of real number x P(x)? x P(x)? Q(x): x<2, U.D.s: the set of real number x Q(x)? x Q(x)? S(x): 2x<x, U.D.s: the set of real positive number x S(x)? x S(x)? True True False True False False P(x) is always true Q(y) is false when y 3 Q(y) is true when y < 2 S(x) is always false (counterexamp les) 20

Universal Quantifiers Examples: P(x): x 2 <10, U.D.s. the positive integer not exceeding 4 x P(x)? x P(x) P(1) P(2) P(3) P(4) F x P(x)? x P(x) P(1) P(2) P(3) P(4) T counterexample P(1) P(2) P(3) P(4) 21 Quantifiers How can we prove the followings: Universal quantification is true Universal quantification is false Existential quantification is true Existential quantification is false Attend the class? Joh n Peter Mary Finding one is ok Need to consider ALL Statement x P(x) x P(x) When true? P(x) is true for every x There is an x for which P(x) is true. When false? There is an x for which P(x) is false. P(x) is false for every x. 22

Precedence of Quantifiers Recall, Precedence 1 2 3 4 5 Operator NOT AND OR XOR Imply Equiva lent and have higher precedence than all logical operators from proposition calculus Example x P(x) Q(x) ( xp(x)) Q(x) x (P(x) Q(x)) 23 Small Exercise How to interpret the following expression: x (P(x) z Q(x,z) y R(x,y)) Q(x,y) x ( P(x) ( z Q(x,z)) ( y R(x,y)) ) Q(x,y) x ( (P(x) ( z Q(x,z))) ( y R(x,y)) ) Q(x,y) 24

Bound and Free Variable Free Variable: No any restriction Bound Variable: Some restrictions (quantifier or condition) Example: P(x) : x > 3 P(x) : x > 3 and x = 4 x P(x, y) Free Variable Not Proposition Bound Variable Proposition x:bound Variable y:free Variable Not Proposition All the variables that occur in a quantifier must be bounded to turn it into a proposition i.e. the truth value can be determined Giving restrictions on a free variable is called blinding 25 Scope The part of a logical expression to which a quantifier is applied is called the scope of this quantifier For example x (P(x) ( y Q(y)) ) R(z) Scope of x Scope of y 26

Small Exercise x ( (P(x) ( z Q(x,z))) ( y R(x,y)) ) Q(x,y) Scope of z: Q(x,z) Scope of y: R(x,y) Scope of x: P(x) z Q(x,z) y R(x,y) Free Variable: x, y in Q(x,y) Bound Variable: x, y, z in the first component 27 Small Exercise x x P(x) Any problem? x is not a free variable in x P(x), therefore the x binding is not used x P(x) Q(x) Is x a free variable? Not a free variable The variable x in Q(x) is outside of the scope of the x quantifier, and is therefore free ( x P(x)) ( x Q(x)) 1 st x is Bounded variable Different variables Are x the same? This is legal, because there are 2 different x 2 nd x is Free variable 28

Recall. x (x 2 >1) Domain of x is real number Domain of x is between -1 and 1 x (x 2 1) Domain of x is integer Domain of x is positive integer 29 Recall, the Equivalences Two propositions P and Q are logically equivalent if P Q is a tautology P Q means (P Q) (Q P) (P Q) : Given P, Q is true (Q P) : Given Q, P is true Therefore, if we want to show P Q, we can show P Q and Q P 30

Quantifi ers: Logical Implication & Equivalence Universal Quantification x (P(x) Q(x)) x P(x) x Q(x) x (P(x) Q(x)) x P(x) x Q(x) P(x): x is lazy Q(x): x likes beer Peter John Mary Jessica P(x): x is lazy Q(x): x likes beer Peter John Mary Jessica x P(x) x Q(x) x (P(x) Q(x)) 31 Quantifi ers: Logical Implication & Equivalence Universal Quantification x (P(x) Q(x)) x P(x) x Q(x) x (P(x) Q(x)) x P(x) x Q(x) P(x): x is lazy Q(x): x likes beer Peter John Mary Jessica Peter John Mary Jessica x P(x) x Q(x) x (P(x) Q(x)) P(x): x is lazy Q(x): x likes beer 32

Quantifi ers: Logical Implication & Equivalence Existential Quantification x (P(x) Q(x)) x P(x) x Q(x) x (P(x) Q(x)) x P(x) x Q(x) P(x): x is lazy Q(x): x like beer Peter John Mary Jessica x P(x) x Q(x) x (P(x) Q(x)) P(x): x is lazy Q(x): x like beer Peter John Mary Jessica 33 Quantifi ers: Logical Implication & Equivalence Existential Quantification x (P(x) Q(x)) x P(x) x Q(x) x (P(x) Q(x)) x P(x) x Q(x) P(x): x is lazy Q(x): x like beer Peter John Mary Jessica x P(x) x Q(x) x (P(x) Q(x)) P(x): x is lazy Q(x): x like beer Peter John Mary Jessica 34

Quantifi ers Logical Implication & Equivalence For Universal Quantifiers, x (P(x) Q(x)) x P(x) x Q(x) x P(x) x Q(x) x (P(x) Q(x)) For Existential Quantifiers, x (P(x) Q(x)) x P(x) x Q(x) x (P(x) Q(x)) x P(x) x Q(x) 35 Quantifiers: Logical Equivalence x (A P(x)) A x P(x) x (A P(x)) A x P(x) x (A P(x)) A xp(x) x (A P(x)) A xp(x) x P(x) A x (P(x) A) A x P(x) x (A P(x)) x P(x) A x (P(x) A) A x P(x) x (A P(x)) * A does not consist of free variable x xp(x) A ( xp(x)) A x ( P(x)) A x ( P(x) A) x (P(x) A) A xp(x) (A) xp(x) x( (A) P(x)) x(a P(x)) 36

Negating Quantifiers Universal Quantification De Morgan s Laws for Quantifiers x P(x) x P(x) Not all students are good There is a student is bad Yes????? No P(x): x is a good student 37 Negating Quantifiers Existential Quantification De Morgan s Laws for Quantifiers x P(x) x P(x) There is not exist a good student All students are bad Yes????? No P(x): x is a good student 38

Small Exercise What are the negation of the following statements? x (x 2 >x) x(x 2 >x) x (x 2 >x) x (x 2 x) x (x 2 =2) x(x 2 =2) x (x 2 =2) x (x 2 2) 39 Small Exercise Show that x(p(x) Q(x)) x(p(x) Q(x)) x (P(x) Q(x)) x ( P(x) Q(x)) x ( P(x) Q(x)) x (P(x) Q(x)) 40

Translation Using Quantifiers Translating from English to Logical Expressions with quantifiers 41 Translation Using Quantifiers Universal Quantification Using predicates and quantifiers, express the statement Every student in this class is lazy x Universe of Discourse Predicate Quantifier: Universal Quantifier Variable: x Universe of discourse: the students in the class Propositional Function: P(x) : x is lazy Answer: x P(x) 42

Translation Using Quantifiers Universal Quantification Another way to express the statement: Quantifier: Universal Quantifier Variable: x Universe of discourse: Any person Propositional Function: P(x): x is lazy Q(x): x is a student in this class Answer: x (Q(x) P(x)) Every student in this class is lazy x The universal quantifier connects with a implication Predicate (Q) Predicate (P) For every person, if he/she is in this class, he/she is lazy x (Q(x) P(x)) For every person, he/she is in this class and lazy 43 Translation Using Quantifiers Existential Quantification Using predicates and quantifiers, express the statement Some students in this class are lazy x Universe of Discourse Predicate Quantifier: Existential Quantifier Variable: x Universe of discourse: the students in the class Propositional Function: P(x) : x is lazy Answer: x P(x) 44

Translation Using Quantifiers Existential Quantification Another way to express the statement: Quantifier: Existential Quantifier Variable: x Universe of discourse: Any person Propositional Function: P(x): x is lazy Q(x): x is a student in this class Answer: x (Q(x) P(x)) Some students in this class are lazy x The existential quantifier connects with a conjunction Predicate (Q) Predicate (P) For some persons, if he/she is in this class, he/she is lazy x (Q(x) P(x)) For some persons, he/she is in this class and lazy 45 Small Exercise Using predicates and quantifiers, set the domain as 1. Staff in IBM company 2. Any persons express the following statements: Every staff in IBM company has visited Mexico Some staff in IBM company has visited Canada or Mexico 46

Small Exercise Every staff in IBM company has visited Mexico Solution 1: Universal Quantifier Variable: x U.D.: Staffs in IBM company Let P(x): x has visited Mexico x P(x) Solution 2: Universal Quantifier Variable: x U.D.: Any person Let Q(x): x is a staff in IBM company Let P(x): x has visited Mexico x (Q(x) P(x)) 47 Small Exercise Some staff in IBM company has visited Canada or Mexico Solution 1: Existential Quantifier Variable: x U.D.: Staffs in IBM company Let P(x): x has visited Mexico Let Q(x): x has visited Canada x (P(x) Q(x)) Solution 2: Existential Quantifier Variable: x U.D.: Any person Let S(x): x is a staff in IBM company Let P(x): x has visited Mexico Let Q(x): x has visited Canada x (S(x) (P(x) Q(x))) 48

Small Exercise Some students in this class has visited Canada or Mexico Better Solution: Existential Quantifier Variable: x U.D.: Any person Let S(x): x is a student in this class Let P(x, loc): x has visited loc x (S(x) (P(x, Canada) P(x, Mexico))) Solution 2: Existential Quantifier Variable: x U.D.: Any person Let S(x): x is a student in this class Let P(x): x has visited Mexico Let Q(x): x has visited Canada x (S(x) (P(x) Q(x))) 49 Quantifiers with Restricted Domains An abbreviated notation is often used to restrict the domain of a quantifier Example the square of any real number which greater than 10 is greater than 100 Using Domain x (x 2 >100), U.D.s: the set of real number which is bigger than 10 Using Predicate x (x>10 x 2 >0), U.D.s: the set of real number Using Abbreviated Notation x >10 (x 2 >100), U.D.s: the set of real number 50

Quantifiers with Restricted Domains Example Given that the domain in each case consists of the real number, what do the following statements mean? x<0 (x 2 >0) x (x<0 x 2 >0) The square of negative real number is positive y 0 (y 3 0) y (y 0 y 3 0) The cube of nonzero real number is nonzero z>0 (z 2 =2) z (z > 0 z 2 =2) There is a positive square root of 2 51 Small Exercise Using predicates and quantifiers, express the following statements: Every mail message larger than one megabyte will be compressed If a user is active, at least one network link will be available. 52

Small Exercise Every mail message larger than one megabyte will be compressed Solution: Let S(m, y) be "Mail message m is larger than y megabytes" Domain of m : all mail messages Domain of y : positive real number Let C(m) denote "Mail message m will be compressed" m (S(m, 1) C(m)) 53 Small Exercise If a user is active, at least one network link will be available. Solution Let A(u) be "User u is active" Domain of u : all users Let S(n, x) be "Network link n is in state x" Domain of n : all network links Domain of x : all possible states for a network link u A(u) n S(n, available) 54

Nested Quantifiers Two quantifiers are nested if one is within the scope of the other How to interpret it? If quantifiers are same type, the order is not a matter x y x+y=0 Same meaning y x x+y=0 If quantifiers are different types, read from left to right x y x+y=0 Different meaning y x x+y=0 55 Nested Quanti fiers Different Type If quantifiers are different types, read from left to right Example 1: P(x, y) = x loves y x y P(x, y) VS y x P(x, y) x y x loves y For all x, there is at least one y, to make P(x,y) happens For all persons, there is a person they love ALL people loves some people y x x loves y At least one y, all x, to make P(x,y) happens There is a person who is loved by all persons Some people are loved by ALL people 56

Nested Quanti fiers Different Type Example 2: P(x, y) = x+y=0 x y P(x, y) VS y x P(x, y) x y (x+y=0) For all x, there is at least one y, to make P(x,y) happens Every real number has an additive inverse y x (x+y=0) At least one y, all x, to make P(x,y) happens There is a real number which all real number are its inverse additio n 57 Nested Quanti fiers Same Type If quantifiers are the same type, the order is not a matter Example: Given Parent(x,y) : x is a parent of y Child(x,y) : x is a child of y x y (Parent(x,y) Child(y,x)) y x (Parent(x,y) Child(y,x)) Two equivalent ways to represent the statement: For all x and y, if x is a parent of y, y is a child of x 58

Nested Quantifiers: Example 1 Let domain be the real numbers, P(x,y): xy = 0 Which one(s) is correct? x y P(x, y) x y P(x, y) x y P(x, y) x y P(x, y) e.g. y = 0 e.g. x = 0 59 Nested Quantifiers: Example 2 Translate the statement x (C(x) y (C(y) F(x,y))) into English, where C(x) is x has a computer, F(x,y) is x and y are friends and the universe of discourse for both x and y is the set of all students in your school Every student in your school has a computer and has a friend who has a computer. 60

Nested Quantifiers: Example 3 Translate the statement If a person is female and is a parent, then this person is someone s mother as a logical expression Let F(x): x is female P(x): x is a parent M(x,y): x is y s mother The domain is the set of all people (F(x) P(x)) M(x, y) All x x ( (F(x) P(x)) y M(x, y) ), or x y ( (F(x) P(x)) M(x, y) ) At least one y 61 Small Exercise Translating the following statement into logic expression: The sum of the two positive integers is always positive x y (x+y > 0) The domain for two variables consists of all positive integers x y ((x>0) (y>0) (x+y > 0)) The domain for two variables consists of all integers 62

Small Exercise Q(x, y, z) be the statement "x + y = z" The domain of all variables consists of all real What are the meaning of the following statements? x y z Q(x,y,z) For all real numbers x and for all real numbers y there is a real number z such that x + y = z z x y Q(x,y,z) There is a real number z such that for all real numbers x and for all real numbers y it is true that x + y = z 63 Small Exercise Translate the statement x y z ( (F(x,y) F(x,z) (y z)) F(y,z) ) into English, where F(a,b) means a and b are friends and the universe of discourse for x, y and z is the set of all students in your school There is a student none of whose friends are also friends each other 64

Negating Nested Quantifiers Recall, De Morgan s Laws for Quantifiers x P(x) x P(x) x P(x) x P(x) They also can be applied in Nested Quantifiers 65 Negating Nested Quantifiers Example: What is the negation of x y (xy = 1)? x y (xy = 1) = x ( y (xy = 1)) Not every x, there are some y, can make xy=1 success = x ( y (xy = 1)) = x ( y (xy = 1)) Some x, for all y, cannot make xy = 1 success = x ( y (xy 1)) = x y (xy 1) 66

67