nested quantifiers
DESCRIPTION
Nested Quantifiers. CS/APMA 202, Spring 2005 Rosen, section 1.4 Aaron Bloomfield. Multiple quantifiers. You can have multiple quantifiers on a statement xy P(x, y) “For all x, there exists a y such that P(x,y)” Example: xy (x+y == 0) xy P(x,y) - PowerPoint PPT PresentationTRANSCRIPT
11
Nested QuantifiersNested QuantifiersCS/APMA 202, Spring 2005CS/APMA 202, Spring 2005
Rosen, section 1.4Rosen, section 1.4
Aaron BloomfieldAaron Bloomfield
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)
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
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)
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”
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|)
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
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))
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)
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
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
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