quantifiers.pdf

Upload: sima-khan

Post on 04-Jun-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 quantifiers.pdf

    1/6

    Discrete Math in CS QuantifiersCS 280 Fall 2005 (Kleinberg)

    1 Quantifiers

    To formulate more complex mathematical statements, we use the quantifiers there exists,written , and for all, written . IfP(x) is a predicate, then

    x: P(x) means, There exists an x such that P(x) holds.

    x: P(x) means, For all x, it is the case that P(x) holds.

    So for example, ifxdenotes a real number, then

    x: x2

    = 4 is true, since 2 is an x for which x2

    = 4. On the other hand, x: x2

    = 4is clearly false; not all numbers, when squared, are equal to 4.

    x: x2 + 1> 0 is true, but x: x2 >2 is false, since for example x = 1 doesnt satisfythe predicate. On the other hand, x: x2 >2 is true, since x= 2 is an example thatsatisfies it.

    Whenever we see a variable in a quantified expression, theres an underlying assumptionthat the variable comes from some base set. So to go back to x: x2 + 1 >0, this is truebecause we specified that x was a real number. But it would be false if we specified thatx was drawn from the complex numbers, since then x = i would not satisfy the predicate.Often well keep the underlying set implicit, but it is important to be careful about this.

    Negating quantified statements. Earlier we said that x: x2 >2 is false, because wewere able to think of an x (x= 1) that fails to satisfy the predicate. This suggests how tonegate a statement: we flip to , and then negate the predicate inside. That is,

    the negation of x: P(x) is x: P(x).

    This, incidentally, is where the term counterexample comes from. If x : P(x) is false,then x: P(x) and the x that exists to satisfy P(x) is the counterexampleto the claimx: P(x).

    On the other hand, to negate x: P(x), we must claim that P(x) fails to hold for anypossible x. So again we flip the quantifier and then negate the predicate:

    the negation of x: P(x) is x: P(x).

    1

  • 8/14/2019 quantifiers.pdf

    2/6

    Quantifiers in standard English usage. If we think about it, this is all familiar fromstandard English usage. For example, if someone says, Everyone at Cornell is at least 18years old, you might reply, No, I know someone at Cornell whos under 18. What areyou doing when you say this?

    At least subconsciously, youre interpreting this statement as x at Cornell, x is atleast 18 years old.

    To disagree with this, youre negating the statement by flipping the to and thennegating the the predicate: x at Cornell such that x is not at least 18 years old.

    Note also that were careful about the set over which x is being quantified: the set isall people at Cornell.

    The same thing happens in the reverse direction, from to : if someone says, Theresan NBA player who makes over ten million dollars a year, you might disagree by saying,No, every NBA player makes under ten million dollars a year.

    1.1 Nested Quantifiers

    Most serious mathematical statements use nestedquantifiers. For example,

    Suppose we claimed, For every real number, theres a real number larger than it.Wed write this as x y: y > x.

    Or if we wanted to claim, There exists a Boolean formula such that every truth assign-ment to its variables satisfies it, we could write this as formulaF assignmentsA:Asatisfies F.

    The difference between a statement that says xy and a statement that says x yis something to watch out for. For example, if were talking about real numbers, then ourearlier example x y: y > xis true. But writing it with the quantifiers in the other order,it would become false: y x : y > x. This version would require there to be a singlenumber thats greater than every number.

    Negating Nested Quantifiers. To negate a sequence of nested quantifiers, you flip eachquantifier in the sequence and then negate the predicate. So the negation of xy: P(x, y)is xy: P(x, y) and So the negation of xy: P(x, y) and x y: P(x, y).

    Again, after some thought, this make sense intuitively. For example, lets take the defini-

    tion of an unbounded sequence from calculus. If we have an infinite sequence of real numbersa1 a2 a3 , then we say its unbounded if for every number x, it eventually growslarger than x. You can already see the quantifiers lurking in here: xn: an > x.

    Now, some sequences, like 1, 4, 9, 16, 25, 36, . . ., are unbounded, and some, like 12

    , 34

    , 78

    , . . .,are not. What does it mean for a sequence not to be unbounded: there is an upper boundx such that every number in the sequence is at most x.

    2

  • 8/14/2019 quantifiers.pdf

    3/6

    In fact, we could have derived this mechanically by negating the definition of unbound-edness. If unbounded means x n: an > x, then not unbounded must mean (flippingquantifiers) xn : an x. Notice that this is what just said, but here we worked it outwithout even thinking about what the symbols mean.

    Nested Quantifiers in Standard English Usage. People manipulate sequences of twonested quantifiers in conversation all the time. For example, if someone says, Everyoneexperiences moments of doubt, you might reply, No, I know someone who seems never tohave experienced any moments of doubt in their whole life. What are you doing here?

    Youre interpreting the statement as people p time t : p experiences doubt attime t.

    To disagree with this, youre negating the statement by flipping each quantifier andthen negating the the predicate: person p times t : p did not experience doubtat time t. (It appears that you added in their whole life just for effect ... )

    More than two nested quantifiers. Theres no problem writing longer sequences ofnested quantifiers, but its a general rule of thumb that people really have to work, cognitively,to handle more than two. This is why most of us have such a hard time digesting the definitionof a limit when we first learn it in calculus: limxa f(x) =b means

    x: (0< |x a|< ) |f(x) b|< .

    Given their complexity, its interesting to ask how often sentences with three nestedquantifiers come up in standard conversation.

    There are certainly examples. Heres one that requires a very mild knowledge of baseball,in which all three quantifiers are hidden.

    In 1941, Joe Dimaggio had a 56-game hitting streak.

    (A record, by the way, that many people think will never be broken ... )Even if you dont know baseball, just think of the rules this way: over the course of one

    game, each player comes up to bat several times; in each at-bat, they either get a hit (a goodthing) or an out (a bad thing). So heres what the sentence above is really saying:

    In 1941, there existed a sequence of 56 consecutive games, such that for all games inthis sequence, there was at least one at-bat in which Joe Dimaggio got a hit.

    So sports fans, just like mathematicians and software designers, know how to make up

    definitions (like hitting streak) that hide a lot of complexity.Notice by the way that streaks in sports dont generally involve three nested quantifiers;in fact, they usually involve just two. For example, the Kansas City Royals 19-game losingstreak this baseball season could be written

    This past summer, there was a sequence of 15 consecutive Royals games such that forall games in this sequence, the Royals lost.

    3

  • 8/14/2019 quantifiers.pdf

    4/6

    1.2 Connections to Game-Playing

    We used Boolean formulas to model two-player games in the previous lecture; we can alsouse quantifiers for this purpose, in a very similar way. Suppose we have a game in whichplayers alternate moves, and we want to know whether Player 1 can force a win after at mostk moves by each side. If we simply try stating what this means, we notice the quantifierstructure very quickly: we want to know if theres a move for Player 1, so that for anypossible move by Player 2, theres a move for Player 1, so that for any possible move byPlayer 2, and so forth, leading to a position that is a win for Player 1.

    In symbols, let x1, x2, . . . , xk be variables corresponding to the moves by Player 1, andlet y1, y2, . . . , yk be variables corresponding to the moves by Player 2. Let the predicateP(x1, y1, x2, y2, . . . , xk, yk) be Twhen the position after moves x1, y1, . . . , xk, yk in order is awin for Player 1, and let is be Fotherwise. Then the question of a forced win is determinedsimply by the truth or falsehood of a single quantified statement:

    x1 y1 x2 y2 xk yk : P(x1, y1, . . . , xk, yk.

    And again, the strategy for Player 1 shows up here as well: every time a quantifier of theform xi is satisfied, it says that theres a way to set the value ofxi (in other words, howto choose the right move) to continue forcing the win.

    The relationship to quantifiers is so close that people often find it useful to think aboutthe relationship as going in both directions: reasoning about alternating, nested quantifiersis like thinking about a strategy in a two-player game. And this also hints at why its sohard to play games like chess well. Recall that even three nested quantifiers tends to placea large cognitive load on people; to look k moves out in chess requires manipulating 2knested quantifiers! In later courses, like CS 482, youll see actual formal evidence for whymanipulating long strings of quantifiers is a computationally intractable problem.

    1.3 Connections to Natural Language Processing

    The analysis of quantifiers also shows up in the field ofnatural language processing, which thearea of computer science concerned with getting computers to understand and communicatein human languages like English, Chinese, Arabic, and so forth. This is a very challengingproblem that is far from being solved any time soon: the complexities of any given humanlanguage are much more subtle than its native speakers tend to realize. Or to put it anotherway, our brains our doing all sorts of things to process language, and its hard to pin downprecisely what these are. These issues are also core problems in the field of linguistics, ofcourse, and there are many people who work on the boundary of natural language processing

    and linguistics.Quantifiers in sentences are one of the linguistic constructs that are hard for computersto handle in general. Some simple examples illustrate why. To begin, theres ambiguity; toparaphrase an old Groucho Marx joke,

    In America, someone steals a car every fifteen seconds. We have to find thatperson and stop them.

    4

  • 8/14/2019 quantifiers.pdf

    5/6

    Theres no better way to ruin a joke than to try writing it out in logical notation, butfor our particular purpose here its useful, since its entirely about quantifiers. Clearly thefirst sentence was meant to say: blocks of fifteen seconds, a person who is stealinga car right then. The second sentence then willfully misinterprets this by swapping thequantifiers: a person P such that blocks of fifteen seconds, P is stealing a car right

    then.But there are much bigger problems than this, if we want to get computers to understand

    the quantifiers embedded in sentences A real difficulty is that we humans resolve the sameambiguities differently depending on what the sentence is talking about. Heres a nice pair ofexample dialogues from Lillian Lee that illustrate this.

    1. How was the party after I left?

    It was fun. Everyone had a drink.

    2. How was the party after I left?

    It was fun. Everyone saw a movie.

    Did everyone have their own drink, or did they all share the same drink? Clearly everyonehad their own drink. But did everyone watch a different movie (on little personal videoplayers), or did they all sit around watching the same movie. Clearly everyone watched thesame movie.

    So the first is, people Pat the party a drink that Phad, while the second is a movie M such that people P, Psaw the movie M. In other words, we interpret theorder of quantifiers differently, even though the sentences are written exactly the same way.The differences in interpretation come about simply because we know about the differencesbetween drinks and movies. This is the kind of thing that makes life very difficult for natural

    language processing software.

    1.4 Quantifiers and Proofs

    As we discussed earlier, our main interest in quantifiers for the purposes of this course is tomanipulate mathematical statements in a careful way.

    When faced with a mathematical claim, understanding its quantifier is often a very goodstrategy for thinking about how to work out a proof. For example:

    If the statement has the form x : P(x), then the global outline is likely have theform: Consider any possible x, and show that it satisfies the property P(x).

    If the statement has the form x : P(x), then the global outline is different: Oneneeds to specify a particularx, and then show it satisfies P(x).

    Its particularly useful to watch for the role that plays in proofs. When you come to a x,it generally means: At this point, you have to describe an xthat does what you want.

    5

  • 8/14/2019 quantifiers.pdf

    6/6

    Quantifiers and Proofs by Contradiction. Of course, one can try looking for alternatestrategies, and proof by contradiction is one useful example of this. If youre trying to provex: P(x), and you dont see how to describe the x you need, you can try supposing its false

    and looking for a contradiction. Supposing its false, concretely, means assuming x: P(x).Youre now in a situation where you can assume that P(x) holds for all x, and start looking

    for a contradiction.Analogously, if you dont see how to get started proving a statement like x: P(x), you

    can similarly negate it and start searching for a contradiction. This means you can start byassuming x: P(x), which lets you assume the existence of a counterexample x for whichP(x) holds.

    6