ds lecture 6

Upload: noname1

Post on 01-Jun-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Ds Lecture 6

    1/30

    (CSC 102)

    Lecture 6

    Discrete Structures

  • 8/9/2019 Ds Lecture 6

    2/30

    Previous Lectures Summary

    •Different forms of arguments

    •Modus Ponens and Modus Toens

    • !dditiona "aid !rguments

    •"aid !rgument #it$ %ase Concusion

    •&nvaid argument #it$ a true Concusion

    •Converse and &nverse error 

    •Contradictions and vaid arguments

     

  • 8/9/2019 Ds Lecture 6

    3/30

    Predicates and 'uantified statements &

  • 8/9/2019 Ds Lecture 6

    4/30

    Todays LectureTodays Lecture

    • Predicates

    • Set otation

    • *niversa and +,istentia Statement

    • Transating -et#een forma and informa anguage

    • *niversa conditiona Statements

    • +.uivaent %orm of *niversa and +,istentia

    statements

    • &m/icit 'uaification

    • egations of *niversa and +,istentia statements

  • 8/9/2019 Ds Lecture 6

    5/30

    PredicatesPredicates

     ! /redicate  is a sentence #$ic$ contains finite num-er ofvaria-es and -ecomes a statement #$en s/ecific vaues

    are su-stituted for t$e varia-es

    T$e domain of a /redicate varia-e is t$e set of a vaues t$atmay -e su-stituted in /ace of t$e varia-e

    Truth Set

    &f P(,) is a /redicate and , $as domain D t$e trut$ set of

    P(,) is t$e set of a eements of D t$at mae P(,) true#$en su-stituted for , T$e trut$ set of P(,) is denoted -y

    read as 3t$e set of a , in D suc$ t$at P(,)4

    { | ( )} x D P x∈

  • 8/9/2019 Ds Lecture 6

    6/30

    %or any t#o /redicates P(,) and '(,) t$e notation

      means t$at every eement in t$e trut$ set of

    P(,) is in t$e trut$ set of '(,) T$e notation

    means t$at P and ' $ave identica trut$ sets

    Consider t$e /redicate5

    T$e trut$ set of t$e a-ove /redicate is

    ( ) ( ) P x Q x⇒

    otation

    ( ) ( ) P x Q x⇔

     R x x   ∈>   ,0

    { }0>∈   +  x R x

  • 8/9/2019 Ds Lecture 6

    7/30

    Example

    Let P(,) , is a factor of 7 '(,) , is a factor of 8

    and 9(,)  x : ; and T$e domain of , is

    assumed to -e *se sym-os to indicate

    true reations$i/s among P(,) '(,) and 9(,)

    a T$e trut$ set of P(,) is

  • 8/9/2019 Ds Lecture 6

    8/30

    Cont?

    Let Q(x, y) be the statement  x + y = x − y 

    #$ere t$e domain for , and y is t$e set of a rea num-ers

    Determine t$e trut$ vaue of5

    (a) '(;@2)(-) '(8A 0)

    (c) Determine t$e set of a /airs of num-ers , and y suc$ t$at

    '(, y) is true

    Solution:

    (a) '(;@2) says t$at ; B (@2) ; @ (@2) or A #$ic$ is fase

    (-) '(8A 0) says t$at 8AB 0 8A @ 0 #$ic$ is true

    (c) , B y , @ y if and ony if , B 2y , #$ic$ is true if and ony if

    y 0 T$erefore , can -e any rea num-er and y must -e ero

  • 8/9/2019 Ds Lecture 6

    9/30

    *niversa and +,istentia Statements

    Let '(,) -e a /redicate and D t$e domain of , !

    universa statement is of t$e form 3 4 &t is

    true if and ony if '(,) is true for a , in D and it is

    fase if and ony if '(,) is fase for at east one , in D !

    vaue for , for #$ic$ '(,) is fase is caed acountere,am/e to t$e universa statement

    +,am/e5 Let D

  • 8/9/2019 Ds Lecture 6

    10/30

    Cont?Cont?

    >ence is true

    T$e tec$ni.ue used in first statement #$ie s$o#ing t$e

    trut$ness of t$e universa statement is caed met$od of

    e,$austion

    Consider t$e statement %ind t$e counter

    e,am/e to s$o# t$at t$is statement is not true

    Counter e,am/e Tae ,1E2 t$en , is in 9 and

    >ence is fase

    2, . x D x x∀ ∈ ≥

    2, . x R x x∀ ∈ ≥

    21 1

    2 2

     ≤ ÷ ÷  

    2

    , . x R x x∀ ∈ ≥

  • 8/9/2019 Ds Lecture 6

    11/30

    +,istentia 'uantifier 

    Let Q(x) -e a /redicate and D t$e domain of

    , !n e,istentia statement is of t$e form

      suc$ t$at

    &t is true if and ony if '(,) is true for at east

    one , in D &t is fase if and ony if '(,) is

    fase for a , in D

    T$e sym-o denotes 3t$ere e,ist4 and iscaed t$e e,istentia .uantifier ∃

     D x ∈∃   )( xQ

  • 8/9/2019 Ds Lecture 6

    12/30

    Trut$ and fasity of +,istentia statements

    Su//ose P(x) is the predicate “x < |x|.”   Determine thetruth value ! x s.t. P(x) "here the dmain !r x is#∃

    (a) t$e t$ree num-ers 1$ %$ &.

    (-) t$e si, num-ers −%$−'$ $ '$ %$ &.

    Solution

    (a) P(')$ P(%)$ and P(&) are all !alse ecause in each

    case x = |x|. *here!re$  x such that P(x) is !alse∃   !r

    this domain

    (-) &f #e -egin c$ecing t$e si, vaues of  x$ "e !ind

    P(−%) is true. t states that −% < |−%|. ,e need to c$ec

    no furt$erF $aving one case t$at maes t$e /redicate

    true is enoug$ to guarantee t$at  x s.t. P(x) is true.∃

  • 8/9/2019 Ds Lecture 6

    13/30

    Trut$ and fasity of +,istentia statements

    Consider t$e statement S$o#t$at t$is statement is true

    So5 o-serve t$at T$us is true for at

    east one integer m >ence is

    true

    Let +

  • 8/9/2019 Ds Lecture 6

    14/30

    Transating from forma to informa anguage

    9e#rite t$e foo#ing statements in a variety ofe.uivaent -ut more informa #ays Do not use t$e

    sym-o

    a)

    -)

    c)

    Soution5 a) #e can #rite t$e statement in many #aysie 3 ! rea num-ers $ave non negative s.uares4 

    3o rea num-er $as a negative s.uare4

    3 , $as a non negative s.uare for eac$ vaue of ,4

    ,∀ ∃

    2, 0. x R x

    ∀ ∈ ≥2, 1. x R x∀ ∈ ≠ −

    mmt  s Z m   =∈∃   2..

  • 8/9/2019 Ds Lecture 6

    15/30

    Cont….

     -) Simiary #e can transate t$e second statement int$ese #ays

    3 ! rea num-ers $ave s.uares not e.ua to H14

    3o rea num-er $ave s.uare e.ua to H14

    c) 3T$ere is an integer #$ose s.uare is e.ua to itsef 4

    3#e can find at east one integer e.ua to its o#ns.uare4

     

  • 8/9/2019 Ds Lecture 6

    16/30

    Cont?

     Write the following statement in English, using the

    predicates

    -(x)# “x is a -reshman” 

    * (x$ y)# “x is tain/ y” 

    #$ere x represents students and y represents curses#

    ∃ x ( -(x) * (x$ Discrete 0ath)∧  )

    Solution

    T$e statement  x (-(x) * (x$ Discrete)) says that there∃ ∧

    is a student x "ith t" prperties# x is a !reshman and x

    is tain/ Discrete. n 1n/lish$ “2me -reshman is tain/

    Discrete 0ath.” 

  • 8/9/2019 Ds Lecture 6

    17/30

    Transating from informa Language to %orma anguage

    3+very fres$man at t$e Coege is taing CSC 1024Solution: T$ere are various #ays to ans#er t$is .uestionde/ending on t$e domain

    •  &f #e tae as our domain a fres$men at t$e Coege

    and use t$e /redicate * (x) # “x is tain/ 323  1024t$en t$e statement can -e #ritten as  x$ *(x)∀ .

    •  Ie are maing a conditiona statement5

    3&f t$e student is a fres$man t$en t$e student is taing

    CSC 101F4

     ∀ x$ (-(x) 4 * (x)).

    ote t$at #e cannot say  x (-(x) * (x))$ ecause this∀ ∧

    says that every student is a !reshman$ "hich is nt somet$in #e can assume $ere

  • 8/9/2019 Ds Lecture 6

    18/30

    Cont?Cont?

    3+very fres$man at t$e Coege is taing some Com/uterScience course4

    So5 &f #e tae as our domain for /eo/e a fres$men at

    t$e Coege and our domain for courses a Com/uterScience courses

    T$en #e can use t$e /redicate

    * (x$ y)# “x is tain/ y” 

    T$e statement can -e #ritten as

    ∀ x y *(x$ y).∃

  • 8/9/2019 Ds Lecture 6

    19/30

    *niversa Conditiona Statements*niversa Conditiona Statements

     ! reasona-e argument can -e made t$at t$e most

    im/ortant form of statement in mat$ematics is t$e

    universa conditiona statement5

     ∀ x$ i! P(x) then Q(x)

    1xample# 3+veryone #$o visited %rance stayed in

    Paris4

    So5 >o#ever if #e tae a /eo/e as t$e universe

    t$en #e need to introduce t$e /redicate -(x) !r “x

    visited %rance4 and P(x) is the predicate “x stayed in

    Paris.” &n t$is case t$e /ro/osition can -e #ritten as

    ∀ x$ ( -(x) 4 P(x) ).

  • 8/9/2019 Ds Lecture 6

    20/30

    • Ie can #rite t$e foo#ing statements in avariety of informa #ays

    if t$en

    So5• if a rea num-er is greater t$en 2 t$en t$e

    s.uare is greater t$an 8

    • I$enever a rea num-er is greater t$en 2

    its s.uare is greater t$an 8

    • T$e s.uares of rea num-er greater t$an 2

    are greater t$an 8

    , x R∀ ∈   2 x >   2 4 x   >

  • 8/9/2019 Ds Lecture 6

    21/30

    +,ercise+,ercise

    9e#rite t$e foo#ing statements in t$e form ∀   $i! then .

    a) &f a rea num-er is an integer t$en it is a rationa

    num-era) ! -ytes $ave eig$t -its

    -) o fire trucs are green

    So5 a)

    -)  x$ i! x is a yte$ then x has ei/ht its.∀

    c).  x$ i! x is a !ire truc$ then x is nt /reen.∀

    , , . x R ifx Z thenx Q∀ ∈ ∈ ∈

  • 8/9/2019 Ds Lecture 6

    22/30

    +.uivaent %orms of *niversa and +,istentia statements

    J-serve t$at t$e t#o statements 3   real∀numers x$ i! x is an inte/er then x is

    ratinal ” and “    inte/ers x$ x is ratinal”∀

    mean the same thin/.

    &n fact a statement of t$e form

      if P(,) t$en '(,)

    Can a#ays -e re#ritten in t$e form

    Can -e re#ritten as

    ∀, if , is in D t$en '(,)

    , ( ) x D Q x∀ ∈

    ,U  x ∈∀

  • 8/9/2019 Ds Lecture 6

    23/30

    Contd

    T$e foo#ing statements are e.uivaent

     ∀ /oygons P if P is s.uare t$en P is a rectange !nd

    ∀ s.uares P P is a rectange

    T$e e,istentia statements

     ∃ , -eongs to * suc$ t$at P(,) and '(,)

     !nd

    ∃ , -eongs to D suc$ t$at '(,)

     !re aso e.uivaent /rovided D is taen to consist of a eements in

    * t$at mae P(,) true

  • 8/9/2019 Ds Lecture 6

    24/30

    +.uivaence form for e,istentia statement

    T$e foo#ing statements are e.uivaent5

     ∃ a numer n such that n is prime and n is even

     5nd

    ∃ a prime numer n such that n is even.

  • 8/9/2019 Ds Lecture 6

    25/30

    &m/icit 'uantifications&m/icit 'uantifications

    • Consider 3 &f a num-er is an integer t$en it is arationa num-er 4

      T$e cue to indicate its universa .uantifications comesfrom t$e /resence of t$e indefinite artice 3a4

    +,istentia .uantification can aso -e im/icit

    for instance 3 t$e num-er 28 can -e #ritten as a sum of

    sum of t#o integers4“∃ even inte/ers m and n such that %6=m + n.” 

  • 8/9/2019 Ds Lecture 6

    26/30

    T$e negation of t$e statement of t$e form ∀ , in D '(,)

    is ogicay e.uivaent to a statement of t$e

    form

     ∃ x in D such that 7Q(x)

    2ymlically#

    8te# the ne/atin ! universal statement is

    l/ically e9uivalent t existential statement.

    egations of 'uantified Statement

    ~ ( , ( )) ~ ( ). x D Q x x D Q x∀ ∈ ≡ ∃ ∈ ∋

  • 8/9/2019 Ds Lecture 6

    27/30

    T$e negation of t$e statement of t$e form ∃ x in D such that '(,)

    is ogicay e.uivaent to a statement of t$e

    form

     ∀ , in D 7Q(x)

    2ymlically#

    8te# the ne/atin ! existential statement is

    l/ically e9uivalent t universal statement.

    Cont?

    ~ ( ( )) , ~ ( ). x D Q x x D Q x∃ ∈ ∋ ≡ ∀ ∈

  • 8/9/2019 Ds Lecture 6

    28/30

    +,am/es

     Negate Some integer x is positive and all integersy are negative.” 

    Solution: *sing a integers as t$e universe for x and y$

    the statement is  x s.t. (x : ) y$ (y < ).∃ ∧ ∀ *he

    ne/atin is7; x (x : ) y (y < ) 7 x s.t. (x : ) 7 y$ (y s la" 

    ∀ x$ 7(x : ) y s.t. 7(y < )∨ ∃  prperties ! ne/atin

    ∀ x$ (x ? ) y s.t. (y @ ).∨ ∃

    T$erefore t$e negation is 3+very integer x is nn

     psitive r there is an inte/er y that is nnne/ative.” 

  • 8/9/2019 Ds Lecture 6

    29/30

    Cont?

    Negate There is a student who came late to classand there is a student who is a!sent from class."

    Solution: &n sym-os if A(x) # “x came late t class” and

     5(x) # “x is asent !rm class$” this statement can -e

    #ritten as  x st A(x) y st 5(y).∃ ∧ ∃ote t$at #e must use a second varia-e y. By ne !

    De 0r/an>s la"s the ne/atin can e "ritten as

    7( x st A(x)) 7( y st 5(x)) x$ 7A(x) y$ 75(x).∃ ∨ ∃ ∀ ∨ ∀

    &n +ngis$ t$is is 3o student came ate to cass or no

    student is a-sent from cass4

  • 8/9/2019 Ds Lecture 6

    30/30

    Lecture SummaryLecture Summary

    • Predicates

    • Set otation

    • *niversa and +,istentia Statement

    • Transating -et#een forma and informa anguage

    • *niversa conditiona Statements

    • +.uivaent %orm

    • &m/icit 'uaification

    • egations