Discrete Maths 2003 Lecture 14 3 Slides Pp

Embed Size (px)

Citation preview

  • 8/13/2019 Discrete Maths 2003 Lecture 14 3 Slides Pp

    1/4

    Lecture 14, 21-August-200Discrete Mathematics 2003

    1

    4.7 Predicate Logic

    To date weve looked atpropositional logic(the logic of propositions)

    However, sometimes this is inadequate

    because it cant cope with logical structure

    that may be present withinpropositions

    The following example illustrates this point

    2

    Example of the Inadequacy of

    Propositional Logic

    Example: Consider the argument:

    It is not true that all animals are cows.

    Therefore there is at least one animal that

    is not a cow.

    This seems a perfectly reasonable argument

    However, we run into difficulties if we try

    to use propositional logic to show the

    argument is valid

    3

    Example (continued)

    Letp, q denote the atomic propositions:

    p: All animals are cows

    q: There is at least one animal that is not a cow

    Then the argument is p q Is this a tautology?

    NO! for ifp and q are both false, then p qis false

    Thus the original argument, which seems quitereasonable, doesnt appear to be logically valid

  • 8/13/2019 Discrete Maths 2003 Lecture 14 3 Slides Pp

    2/4

    Lecture 14, 21-August-200Discrete Mathematics 2003

    4

    Why isnt the Argument Valid?

    The problem occurs because were unable

    to break down further the propositions Allanimals are cows and There is at least one

    animal that is not a cow into component

    propositions, to reveal the full extent of

    what is contained in the statements

    To achieve this, we need to usepredicate

    logic

    5

    Predicates

    Apredicate is a statement containing one or

    more variables. If values are assigned to all

    the variables, the result is a proposition.

    Example: y 7 is a predicate, wherey is a

    variable denoting any real number

    Example: x is in Africa is a predicate,

    wherex is a variable denoting the name of a

    country

    6

    Propositions from Predicates

    A proposition can be obtained from apredicate by means other than allocatingvalues to the variable(s)

    Example: From the predicate y

    7 wecan obtain the proposition For ally,y 7

    Note that For ally,y 7 isfalse

    However, it is true thaty 7 for somevalues ofy

    Thus the proposition There exists ay suchthaty 7 is true

  • 8/13/2019 Discrete Maths 2003 Lecture 14 3 Slides Pp

    3/4

    Lecture 14, 21-August-200Discrete Mathematics 2003

    7

    Quantifiers

    The expressions for all and there exists arecalled quantifiers

    The process of applying a quantifier to avariable is called quantifying the variable

    A variable that has been quantified is said tobe bound

    Example: In There exists ay such thaty 7,the variabley is bound by the quantifier thereexists

    A variable that is not bound is said to befree

    8

    Notation for Predicates & Quantifiers

    Use capitals for predicates e.g. A predicate

    P that contains a variablex is denoted by P(x);

    if it containsx &y, it is denoted by P(x,y)

    The quantifier for all is denoted by

    The quantifier there exists is denoted by

    Example: Write in symbols There exists ay

    such thaty 7

    Solution: Let P(y) denote the predicate y 7.

    Then the proposition is y P(y)

    9

    Another Example

    Example: Write in symbols

    For ally,y < 7 ory 7

    Solution: Let P(y) & Q(y) denote the

    predicates y < 7 & y 7, respectively. Then the proposition can be written as

    y [P(y) Q(y)].

    Note: Since Q(y) is equivalent to P(y),

    this can also be written as

    y [P(y) P(y)]

  • 8/13/2019 Discrete Maths 2003 Lecture 14 3 Slides Pp

    4/4

    Lecture 14, 21-August-200Discrete Mathematics 2003

    10

    An Example with 2 Variables

    Example: Write the propositions in symbols:

    1. For every numbery there is a numberx

    such thatx =y 3 2. There is a numberx such that, for every

    numbery,x =y 3

    Solution: Let P(x,y) denote the predicatex =y 3. Then the propositions are:

    1. y x P(x,y)

    2. x y P(x,y)

    Question: Are these propositions true or false?

    11

    Practical Use of the Notation

    Example: In a car-hire business, supposeB(c, d)denotes the predicate Car c is booked for day d.Put the following in symbolic form.

    1. The Toyota Corolla is booked for Sept 7 Answer: B(Toyota Corolla, Sept 7)

    2. The Ford Falcon is not booked for Aug 28 Answer: B(Ford Falcon, Aug 28)

    3. Cars c1 and c2 are booked for Sept 22 Answer: B(c1, Sept 22) B(c2, Sept 22)

    4. All cars are booked for Aug 30

    Answer: cB(c, Aug 30)

    12

    Practical Use of the Notation (contd)

    5. Car c is not booked for every day

    Answer: [dB(c, d)] or d[B(c, d)]

    6. All cars are booked for all days

    Answer: cdB(c, d)

    7. Car c is booked for at least two days Answer: d1d2 [B(c, d1) B(c, d2) (d1d2)]

    8. No more than one car is booked for day d

    Answer: c1c2{[B(c1, d) B(c2, d)] (c1=c2)}

    9. Exactly one car is booked for day d

    Answer: [cB(c, d)]

    [c1c2{[B(c1, d) B(c2, d)] (c1=c2)}]