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

Nested Quantifiers

Embed Size (px)

DESCRIPTION

elementary logic

Citation preview

  • *Nested QuantifiersCS/APMA 202, Spring 2005Rosen, section 1.4Aaron Bloomfield

  • *Multiple quantifiersYou 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)

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

  • *Order of quantifiersxy and xy are not equivalent!

    xy P(x,y)

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

    xy P(x,y)

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

  • *Negating multiple quantifiersRecall negation rules for single quantifiers:

    x P(x) = x P(x)x P(x) = x P(x)Essentially, you change the quantifier(s), and negate what its quantifying

    Examples:

    (xy P(x,y)) = x y P(x,y)= xy P(x,y)(xyz P(x,y,z)) = xyz P(x,y,z)= xyz P(x,y,z)= xyz P(x,y,z)

  • *Negating multiple quantifiers 2Consider (xy P(x,y)) = xy P(x,y)

    The left side is saying for all x, there exists a y such that P is trueTo disprove it (negate it), you need to show that there exists an x such that for all y, P is false

    Consider (xy P(x,y)) = xy P(x,y)

    The left side is saying there exists an x such that for all y, P is trueTo disprove it (negate it), you need to show that for all x, there exists a y such that P is false

  • *Translating between English and quantifiersRosen, section 1.4, question 20

    The product of two negative integers is positive

    xy ((x0) (y>0) ((x+y)/2 > 0))The difference of two negative integers is not necessarily negative

    xy ((x

  • *Translating between English and quantifiersRosen, section 1.4, question 24

    xy (x+y = y)

    There exists an additive identity for all real numbersxy (((x0) (y 0))

    A non-negative number minus a negative number is greater than zeroxy (((x0) (y0)) (x-y > 0))

    The difference between two non-positive numbers is not necessarily non-positive (i.e. can be positive)xy (((x0) (y0)) (xy 0))

    The product of two non-zero numbers is non-zero if and only if both factors are non-zero

  • *End of lecture on 8 February 2005

  • *Rosen, section 1.4 question 30Rewrite these statements so that the negations only appear within the predicates

    yx P(x,y)yx P(x,y)yx P(x,y)xy P(x,y)xy P(x,y)xy P(x,y)y (Q(y) x R(x,y))y (Q(y) x R(x,y))y (Q(y) (x R(x,y)))y (Q(y) x R(x,y))

  • *Rosen, section 1.4 question 31Express the negations of each of these statements so that all negation symbols immediately precede predicates.

    xyz T(x,y,z)(xyz T(x,y,z))xyz T(x,y,z)xyz T(x,y,z)xyz T(x,y,z)xyz T(x,y,z)xy P(x,y) xy Q(x,y)(xy P(x,y) xy Q(x,y))xy P(x,y) xy Q(x,y)xy P(x,y) xy Q(x,y)xy P(x,y) xy Q(x,y)

  • *Quick surveyI felt I understood the material in this slide set

    Very wellWith some review, Ill be goodNot reallyNot at all

  • *Quick surveyThe pace of the lecture for this slide set was

    FastAbout rightA little slowToo slow

  • *Quick surveyHow interesting was the material in this slide set? Be honest!

    Wow! That was SOOOOOO cool!Somewhat interestingRather bortingZzzzzzzzzzz