nested quantifiers

12
1 Nested Quantifiers Nested Quantifiers CS/APMA 202, Spring 2005 CS/APMA 202, Spring 2005 Rosen, section 1.4 Rosen, section 1.4 Aaron Bloomfield Aaron Bloomfield

Upload: charla

Post on 06-Jan-2016

147 views

Category:

Documents


1 download

DESCRIPTION

Nested Quantifiers. CS/APMA 202, Spring 2005 Rosen, section 1.4 Aaron Bloomfield. Multiple quantifiers. You can have multiple quantifiers on a statement xy P(x, y) “For all x, there exists a y such that P(x,y)” Example: xy (x+y == 0) xy P(x,y) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Nested Quantifiers

11

Nested QuantifiersNested QuantifiersCS/APMA 202, Spring 2005CS/APMA 202, Spring 2005

Rosen, section 1.4Rosen, section 1.4

Aaron BloomfieldAaron Bloomfield

Page 2: Nested Quantifiers

22

Multiple quantifiersMultiple quantifiers

You can have multiple quantifiers on a statementYou can have multiple quantifiers on a statement

xxy P(x, y)y P(x, y) ““For all x, there exists a y such that P(x,y)”For all x, there exists a y such that P(x,y)” Example: Example: xxy (x+y == 0)y (x+y == 0)

xxy P(x,y)y P(x,y) There exists an x such that for all y P(x,y) is true”There exists an x such that for all y P(x,y) is true” xxy (x*y == 0)y (x*y == 0)

Page 3: Nested Quantifiers

33

Order of quantifiersOrder of quantifiers

xxy and y and xxy are not equivalent!y are not equivalent!

xxy P(x,y)y P(x,y) P(x,y) = (x+y == 0) is falseP(x,y) = (x+y == 0) is false

xxy P(x,y)y P(x,y) P(x,y) = (x+y == 0) is trueP(x,y) = (x+y == 0) is true

Page 4: Nested Quantifiers

44

Negating multiple quantifiersNegating multiple quantifiers

Recall negation rules for single quantifiers:Recall negation rules for single quantifiers: ¬¬x P(x) = x P(x) = x ¬P(x)x ¬P(x) ¬¬x P(x) = x P(x) = x ¬P(x)x ¬P(x) Essentially, you change the quantifier(s), and negate Essentially, you change the quantifier(s), and negate

what it’s quantifyingwhat it’s quantifying

Examples:Examples: ¬(¬(xxy P(x,y)) y P(x,y))

= = x ¬x ¬y P(x,y)y P(x,y)= = xxy ¬P(x,y)y ¬P(x,y)

¬(¬(xxyyz P(x,y,z)) z P(x,y,z)) = = x¬x¬yyz P(x,y,z)z P(x,y,z)= = xx¬y¬yz P(x,y,z)z P(x,y,z)= = xxyyz ¬P(x,y,z)z ¬P(x,y,z)

Page 5: Nested Quantifiers

55

Negating multiple quantifiers 2Negating multiple quantifiers 2

Consider ¬(Consider ¬(xxy P(x,y)) = y P(x,y)) = xxy ¬P(x,y)y ¬P(x,y) The left side is saying “for all x, there exists a y such The left side is saying “for all x, there exists a y such

that P is true”that P is true” To disprove it (negate it), you need to show that To disprove it (negate it), you need to show that

“there exists an x such that for all y, P is false”“there exists an x such that for all y, P is false”

Consider ¬(Consider ¬(xxy P(x,y)) = y P(x,y)) = xxy ¬P(x,y)y ¬P(x,y) The left side is saying “there exists an x such that for The left side is saying “there exists an x such that for

all y, P is true”all y, P is true” To disprove it (negate it), you need to show that “for To disprove it (negate it), you need to show that “for

all x, there exists a y such that P is false”all x, there exists a y such that P is false”

Page 6: Nested Quantifiers

66

Translating between English and Translating between English and quantifiersquantifiers

Rosen, section 1.4, question 20Rosen, section 1.4, question 20

The product of two negative integers is positiveThe product of two negative integers is positive xxy ((x<0) y ((x<0) (y<0) → (xy > 0)) (y<0) → (xy > 0)) Why conditional instead of and?Why conditional instead of and?

The average of two positive integers is positiveThe average of two positive integers is positive xxy ((x>0) y ((x>0) (y>0) → ((x+y)/2 > 0)) (y>0) → ((x+y)/2 > 0))

The difference of two negative integers is not necessarily The difference of two negative integers is not necessarily negativenegative

xxy ((x<0) y ((x<0) (y<0) (y<0) (x-y≥0)) (x-y≥0)) Why and instead of conditional?Why and instead of conditional?

The absolute value of the sum of two integers does not The absolute value of the sum of two integers does not exceed the sum of the absolute values of these integersexceed the sum of the absolute values of these integers

xxy (|x+y| ≤ |x| + |y|)y (|x+y| ≤ |x| + |y|)

Page 7: Nested Quantifiers

77

Translating between English and Translating between English and quantifiersquantifiers

Rosen, section 1.4, question 24Rosen, section 1.4, question 24

xxy (x+y = y)y (x+y = y) There exists an additive identity for all real numbersThere exists an additive identity for all real numbers

xxy (((x≥0) y (((x≥0) (y<0)) → (x-y > 0)) (y<0)) → (x-y > 0)) A non-negative number minus a negative number is A non-negative number minus a negative number is

greater than zerogreater than zero

xxy (((x≤0) y (((x≤0) (y≤0)) (y≤0)) (x-y > 0)) (x-y > 0)) The difference between two non-positive numbers is The difference between two non-positive numbers is

not necessarily non-positive (i.e. can be positive)not necessarily non-positive (i.e. can be positive)

xxy (((x≠0) y (((x≠0) (y≠0)) ↔ (xy ≠ 0)) (y≠0)) ↔ (xy ≠ 0)) The product of two non-zero numbers is non-zero if The product of two non-zero numbers is non-zero if

and only if both factors are non-zeroand only if both factors are non-zero

Page 8: Nested Quantifiers

99

Rosen, section 1.4 question 30Rosen, section 1.4 question 30

Rewrite these statements so that the negations Rewrite these statements so that the negations only appear within the predicatesonly appear within the predicates

a)a) yyx P(x,y)x P(x,y)yyx P(x,y)x P(x,y)yyx x P(x,y)P(x,y)

b)b) xxy P(x,y)y P(x,y)xxy P(x,y)y P(x,y)xxy y P(x,y)P(x,y)

c)c) y (Q(y) y (Q(y) x x R(x,y))R(x,y))y y (Q(y) (Q(y) x x R(x,y))R(x,y))y (y (Q(y) Q(y) ((x x R(x,y)))R(x,y)))y (y (Q(y) Q(y) x R(x,y))x R(x,y))

Page 9: Nested Quantifiers

1010

Rosen, section 1.4 question 31Rosen, section 1.4 question 31

Express the negations of each of these statements so Express the negations of each of these statements so that all negation symbols immediately precede that all negation symbols immediately precede predicates.predicates.

a)a) xxyyz T(x,y,z)z T(x,y,z)((xxyyz T(x,y,z))z T(x,y,z))xxyyz T(x,y,z)z T(x,y,z)xxyyz T(x,y,z)z T(x,y,z)xxyyz T(x,y,z)z T(x,y,z)xxyyz z T(x,y,z)T(x,y,z)

b)b) xxy P(x,y) y P(x,y) xxy Q(x,y)y Q(x,y)((xxy P(x,y) y P(x,y) xxy Q(x,y))y Q(x,y))xxy P(x,y) y P(x,y) xxy Q(x,y)y Q(x,y)xxy P(x,y) y P(x,y) xxy Q(x,y)y Q(x,y)xxy y P(x,y) P(x,y) xxy y Q(x,y)Q(x,y)

Page 10: Nested Quantifiers

11

Quick surveyQuick survey

I felt I understood the material in this I felt I understood the material in this slide set…slide set…

a)a) Very wellVery well

b)b) With some review, I’ll be goodWith some review, I’ll be good

c)c) Not reallyNot really

d)d) Not at allNot at all

Page 11: Nested Quantifiers

12

Quick surveyQuick survey

The pace of the lecture for this The pace of the lecture for this slide set was…slide set was…

a)a) FastFast

b)b) About rightAbout right

c)c) A little slowA little slow

d)d) Too slowToo slow

Page 12: Nested Quantifiers

13

Quick surveyQuick survey

How interesting was the material in How interesting was the material in this slide set? Be honest!this slide set? Be honest!

a)a) Wow! That was SOOOOOO cool!Wow! That was SOOOOOO cool!

b)b) Somewhat interestingSomewhat interesting

c)c) Rather bortingRather borting

d)d) ZzzzzzzzzzzZzzzzzzzzzz