1 / 18

Discrete Structure

Discrete Structure. Li Tak Sing( 李德成 ). Chapter 4 Properties of Binary Relations. Three special properties For a binary relation R on a set A, we have the following definitions. R is reflexive if xRx for all x A. R is symmetric if xRy implies yRx for all x,y A

kimi
Télécharger la présentation

Discrete Structure

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Discrete Structure Li Tak Sing(李德成)

  2. Chapter 4Properties of Binary Relations • Three special properties • For a binary relation R on a set A, we have the following definitions. • R is reflexive if xRx for all xA. • R is symmetric if xRy implies yRx for all x,y A • R is transitive if xRy and yRz implies xRz for all x,y,z A

  3. Two opposite properties • For a binary relation R on a set A, we have the following definitions. • R is irreflexive if (x,x)R for all xA. • R is antisymmetric if xRy and yRx implies x=y for all x,yA.

  4. Example • R is a binary relation on N • aRb if (a+b) mod 2 = 0 • R is reflexive because (a+a) mod 2 =0 for all a N • R is symmetric because if aRb, then (a+b) mod 2 = 0, then (b+a) mod 2 =0, then bRa • R is transitive, because if aRb and bRc, then (a+b) mod 2 =0 and (b+c) mod 2 =0, then (a+2b+c) mod 2 =0, then (a+c) mod 2 =0, then aRc

  5. Example • Give examples of binary relations over the set {a,b,c,d} with the stated properties: • Reflexive and not symmetric and not transitive • Symmetric and not reflexive and not transitive • transitive and not reflexive and not symmetric

  6. Composition of relations • If R and S are binary relations, then the composition of R and S, which we denote by RS, is the following relation:RS={(a,c)|(a,b)R and (b,c) S for some element b}

  7. More examples • For each of the following binary relations state which of the three properties, reflexive, symmetric and transitive are satisfied. • xRy iff |x-y| is odd, over the integers. • xRy iff x is a parent of y, over the set of people.

  8. Grandparents • Given the isParentOf relation. So a isParentOf b represents the fact that a is the parent of b. • isGrandparentOf can then be defined in terms of isParentOf.isGrandparentOf=isParentOfisParentOf • So a isGrandparentOf b if there is c so that a isParentOf c and c isPrentOf b.

  9. More examples • Given the following binary relations over {a,b,c,d}.R={(a,a),(a,c),(b,a),(b,d),(c,b)}S={(a,b),(a,c),(c,b),(d,c)} • Find RS • Find SR

  10. Representations • If R is a binary relation on A, then we'll denote the composition of R with itself n times by writing Rn. • For example, • isGrandparentOf=isParentOf2 • isGreatGrandParentOf=isParentOf3

  11. Inheritance properties • If R is reflexive, then Rn is reflexive. • If R is symmetric, then Rn is symmetric. • If R is transitive, then Rn is transitive.

  12. Example • Let R={(x,y)ZZ|x+y is odd}. We want to find out R2 and R3.

  13. Closures • If R is a binary relation and p is some property, then the p closure of R is the smallest binary relation containing R that satisfies property p.

  14. Reflexive closure • A reflexive closure of R is the smallest reflexive relation that contains R. • A reflexive closure of R is denoted as r(R) • R is a relation over {a,b,c} and R={(a,b),(b,c)}Then, r(R)={(a,a),(b,b),(c,c),(a,b),(b,c)}

  15. Symmetric closure • A symmetric closure of R is the smallest symmetric relation that contains R. • A symmetric closure of R is denoted as s(R) • R={(a,b),(b,c)}, s(R)={(a,b),(b,a),(b,c),(c,b)}

  16. Transitive closure • A transitive closure of R is the smallest transitive relation that contains R. It is denoted as t(R). • R= ={(a,b),(b,c)}, then t(R)= {(a,b),(b,c),(a,c)}

  17. Constructing Closures • If R is a binary relation over a set A, then: • r(R)=RRo (Ro is the equality relation) • s(R)=R Rc (Rc is the converse relation) • t(R)=R R2 R3 R4.... • If A is finite with n elements, then t(R)= R R2 R3 R4.... Rn

  18. Example • Given the set A={a,b,c,d}. Draw a directed graph to represent the indicated closure for each of the following binary relations over A. • r(R), where R={(a,d)} • s(R) where R={(a,b), (c,d)} • t(R) where R={(a,b),(d,a),(d,c),(c,b)}

More Related