20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

Embed Size (px)

Citation preview

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    1/27

    http://fskik.upsi.edu.my

    1.3 PREDICATES AND

    QUANTIFIER

    MTK3013

    DISCRETE STRUCTURES

    1

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    2/27

    http://fskik.upsi.edu.my

    Predicates

    A predicate is a statement that contains

    variables.

    Example:

    P(x) :x > 3

    Q(x,y) :x =y + 3

    R(x,y,z) :x +y =z

    2

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    3/27

    http://fskik.upsi.edu.my

    Predicates

    A predicate becomes a proposition if thevariable(s) contained is(are)

    Assigned specific value(s) Quantified

    P(x) :x > 3.What are the truth values of

    P(4) andP(2)? Q(x,y) :x =y + 3. What are the truth values

    ofQ(1,2) and Q(3,0)?

    3

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    4/27

    http://fskik.upsi.edu.my

    Quantifiers

    Two types of quantifiers

    Universal Existential

    Universe of discourse - the particular

    domain of the variable in a propositional

    function

    4

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    5/27

    http://fskik.upsi.edu.my

    Universal Quantification

    P(x) is true for all values ofx in the universe

    of discourse.

    x P(x)

    for allx,P(x)

    for everyx

    ,P(x)

    The variablex is bound by the universal

    quantifier, producing a proposition

    5

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    6/27

    http://fskik.upsi.edu.my

    Example

    U= {all real numbers},P(x):x+1 >x

    What is the truth value of x P(x)

    U= {all real numbers}, Q(x):x < 2

    What is the truth value of x Q(x)

    U= {all students in MTK3013}

    R(x) :x has an account on Tabung Haji

    What does x R(x) mean?

    6

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    7/27

    http://fskik.upsi.edu.my

    For universal quantification

    P(x) P(x1) P(x2) P(xn)

    If the elements in the universe of discourse can belisted, U= {x1, x2, , xn}x P(x)P(x

    1

    ) P(x2

    ) P(xn

    )

    Example

    U= {positive integers not exceeding 3} andP(x):

    x2 < 10 What is the truth value of x P(x)

    P(1) ^ P(2) ^ P (3)

    T ^ T ^ T

    T 7

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    8/27

    http://fskik.upsi.edu.my

    Existential Quantification

    P(x) is truefor somex in the universe ofdiscourse

    x P(x) for somex,P(x)

    There exists anx such thatP(x)

    There is at least onex

    such thatP(x)

    The variablex is bound by the existentialquantifier, producing a proposition

    8

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    9/27

    http://fskik.upsi.edu.my

    Example

    U= {all real numbers}, P(x):x> 3 What is the truth value of x P(x)

    U= {all real numbers}, Q(x):x=x+ 1 What is the truth value ofx Q(x)

    U= {all students in MTK 3013}

    R(x) :xhas an account on Tabung Haji What does x R(x) mean?

    9

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    10/27

    http://fskik.upsi.edu.my

    For existential quanti f ication

    P(x)P(x1) P(x2) P(xn)

    If the elements in the universe of discourse

    can be listed, U= {x1, x2, , xn}

    x P(x) P(x1) P(x2)

    P(xn)

    Example

    U= {positive integers not exceeding 4} andP(x):x2 > 10 What is the truth value ofx P(x)

    P(1) v P(2) v P(3) v P(4)

    10

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    11/27

    http://fskik.upsi.edu.my

    Binding Variables

    Boundvariable: if a variable is quantified

    Free variable: Neither bound nor assigned aspecific value

    Example: x P(x) x Q(x,y)

    Scope of Quantifiers: Part of a logicalexpression to which a quantifier is applied

    Example: x (P(x) Q(x)) x R(x)

    11

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    12/27

    http://fskik.upsi.edu.my

    Negation of Quantifiers

    Distributing a negation operator across a

    quantifier changes a universal to an

    existential and vice versa.

    ~x P(x) x ~P(x)

    ~x P(x) x ~P(x)

    Example:

    P(x) :x has taken a course in calculus

    12

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    13/27

    http://fskik.upsi.edu.my

    Translating from English

    Many ways to translate a given sentence

    Goal is to produce a logical expression that is

    simple and can be easily used in subsequentreasoning

    Steps:

    Clearly identify the appropriate quantifier(s)

    Introduce variable(s) and predicate(s)

    Translate using quantifiers, predicates, andlogical operators

    13

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    14/27

    http://fskik.upsi.edu.my

    Example

    Every student in this class has studied

    Discrete Structures

    Solution 1

    Assume, U = {all students in MTK 3013}

    Solution 2

    Assume, U = {all people}

    14

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    15/27

    http://fskik.upsi.edu.my

    Example

    Some student in this class has visited

    Mexico

    Solution 1

    Assume, U = {all students in MTK 3013}

    Solution 2

    Assume, U = {all people}

    15

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    16/27

    http://fskik.upsi.edu.my

    More Example

    C(x):x is a COMPUTING student

    M(x):x is an MULTIMEDIA student

    S(x):x is a smart student

    U= {all students in MTK 3013}

    16

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    17/27

    http://fskik.upsi.edu.my

    More Example (Cont..)

    Everyone is a COMPUTING student.

    x C(x)

    Nobody is an MULTIMEDIA student.

    x ~M(x) or ~x M(x)

    All COMPUTING students are smart students.

    x [C(x)S(x)]

    Some COMPUTING students are smartstudents.

    x [C(x) S(x)]17

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    18/27

    http://fskik.upsi.edu.my

    Use implication or

    conjunction? Universal quantifiers usually take implications

    All COMPUTING students are smart students.

    x[C(x)S(x)] Correct

    x[C(x) S(x)] Incorrect

    18

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    19/27

    http://fskik.upsi.edu.my

    Use implication or

    conjunction? Existential quantifiers usually take

    conjunctions

    Some COMPUTING students are smart

    students.

    x [C(x) S(x)] Correctx [C(x) S(x)] Incorrect

    19

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    20/27

    http://fskik.upsi.edu.my

    More Example

    No COMPUTING student is an MULTIMEDIAstudent.

    Ifx is a COMPUTING student, then that student is notan MULTIMEDIA student.

    x [C(x) ~M(x)] There does not exist a COMPUTING student who is

    also an MULTIMEDIA student.

    ~x [C(x) M(x)] If any MULTIMEDIA student is a smart student

    then he is also a COMPUTING student.x [(M(x) S(x))C(x)]

    20

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    21/27

    http://fskik.upsi.edu.my

    (13b) Determine truth value. U={Z}

    n (2n = 3n)

    (16b) Determine truth value U={R

    }n (x2 = -1)

    Exercise 17 (Page 47)

    21

    h //f kik i d

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    22/27

    http://fskik.upsi.edu.my

    Nested Quantifiers

    Quantifiers that occur within the scope of

    other quantifiers

    Example:

    P(x,y): x + y = 0, U={R}

    xy P(x,y)

    22

    h //f kik i d

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    23/27

    http://fskik.upsi.edu.my

    Quantifications of Two

    Variables

    For all pair x,y P(x,y).

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

    For every x there is a y such that P(x,y).

    xy P(x,y)

    There is an x such that P(x,y) for all y.

    xy P(x,y) There is a pair x,y such that P(x,y).

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

    23

    htt //f kik i d

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    24/27

    http://fskik.upsi.edu.my

    Translating statements

    with nested quantifiers

    U= {all real numbers}x y (x + y = y + x)

    x y (x + y = 0)x y ( (x > 0) (y < 0) (xy < 0) )

    U= {all students in cs2813}

    C(x): x has a computerF(x,y): xandyare friends

    x ( C(x) y (C(y) F(x,y)) )

    24

    htt //f kik i d

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    25/27

    http://fskik.upsi.edu.my

    Translating Sentences

    U= {all people}

    If a person is female and is a parent, then this

    person is someones mother.

    U= {all integers}

    The sum of two positive integers is positive.

    25

    http //fskik upsi edu my

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    26/27

    http://fskik.upsi.edu.my

    Is the order of quantifiers

    important?

    If the quantifiers are of the same type, then

    order does not matter If the quantifiers are of different types,

    then order is important

    26

    http://fskik upsi edu my

  • 7/29/2019 20130905170921MTK3013-Chapter1.3 Predicates and Quantifiers

    27/27

    http://fskik.upsi.edu.my

    Example U={R}

    Q(x,y): x+y=0

    What are the truth values for

    y x Q(x,y) andx y Q(x,y)

    y x Q(x,y): There exist at least one y such that forevery real number x, Q(x,y) is true, i.e. x+y=0.

    FALSE (not for every, only when y is x).

    Butx y Q(x,y): For every real number x, there is a real

    number y such that Q(x,y) is true, i.e x+y =0.TRUE (for every x when y is x)

    27