1 / 23

Today’s topics: Associative and distributive properties of composition Powers of a relation

Homework #3 is posted (due on June 26). Today’s topics: Associative and distributive properties of composition Powers of a relation Inverse relation. S  T. C. R. S. T. A. D. B. R  S. Properties of composition.

kiley
Download Presentation

Today’s topics: Associative and distributive properties of composition Powers of a relation

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. Homework #3 is posted (due on June 26) • Today’s topics: • Associative and distributive properties of composition • Powers of a relation • Inverse relation

  2. ST C R S T A D B RS Properties of composition Theorem. Let R  AB, S  BCand T  CD denote three binary relations. Then relation compositions satisfy the following associative law: (RS)T = R(ST)

  3. Theorem. Let R  AB, S  BCand T  CD denote three binary relations. Then relation compositions satisfy the following associative law: (RS)T = R(ST) Proof. First note that both sides define a relation from A to D. We also note the following: (RS)T = {(a, d) | aA and dD and cC [(a, c)RS  cTd ]} (by the definition of composition T) = {(a, d) |… (cC, bB)[(aRb  bSc ) cTd ]} (by definition of RS) = {(a, d) |… (cC, bB)[aRb  (bSc  cTd )]} (by associative property of ) = {(a, d) |… (bB)[aRb  (b, d ) ST ]} (by definition of ST ) = R(ST)(by the definition of composition R)

  4. 2 • A 1 • 3 • a0 5 • 7 • a1 4 • a2 6 • a3 Associative property of composition means, that no ambiguity arises if we simply write RST . We can also define powers of a relation RAA recursively as R1=R and Rn+1=RnR (n1) Definition. A path in a relation R is a sequence a0, … , ak with k 0 such that (ai, ai+1) R for every i<k . We call k the length of the path. 1, 5, 7, 6 – a path of length 3

  5. a1 a1 a3 a3    a1  a3   a1 a3      a0  a0 a2 a2   a0 a2 RR= R2 (grandparent-of) R (parent-of)   a0 a2 RRR= R3 R4= Powers of a relation

  6. b b b c c c a d a d a d R R2 R3 Theorem. (a, b)  Rn iff there is a path of length n in R. (will be proved later by induction)

  7. Theorem. 1) If a relation R AA is reflexive, then R2 is also reflexive 2) If a relation R AA is symmetric, then R2 is also symmetric 3) If a relation R AA is transitive, then R2 is also transitive. Proof 1) If RAA is reflexive, then for any aA, (a, a)  R. To prove that R2 is reflexive, we need to show that for any aA, (a, a)  R2, i. e. you can ‘return back to a in two steps’. This is obviously true, because you can simply repeat two loops. Note, thatwe can prove in general, that if (a, a)  R, then (a, a)  Rn for any n > 0 (repeat loop n times)

  8. c R2 R  a b a b     ? c R  a b   b a   Proof. 2) R AA is symmetric  R2 is symmetric cA,(a, c) R and (c, b) R assume(a, b)  R2 (b, a)  R2 (b, c) R and (c, a) R

  9. x (a, b) R x A a b R2 a b a b c y y A c c (b, c) R x a b (a, c) R2 c y Proof 3) Assume R is transitive. To prove that R2 is transitive, assume that there exist (a, b) R2 and (b, c) R2 (otherwise R2 is ‘vacuously’ transitive) to show that (a, c) R2 . Sketch of the proof

  10. It is interesting also to see how the composition distributes over union and intersection. Theorem. Let R  AB, S  BCand T  BC denote three binary relations. Then 1) R(ST) = (RS)(RT) 2) R(ST)  (RS)(RT)

  11. R b1 S c1  a1   b2  a2 c2  b3   c3  a3   b4  c4 A T B C 1) R(ST) = (RS)(RT) R = {(a1, b1), (a1, b2), (a2, b4)} S = {(b1, c2), (b4, c1)} T ={(b4, c4)} ST = {(b1, c2), (b4, c1), (b4, c4)} R(ST) = {(a1, c2), (a2, c1), (a2, c4)} RS = {(a1, c2), (a2, c1)}, RT = {(a2, c4)}, (RS)(RT) ={(a1, c2), (a2, c1), (a2, c4)}

  12. Proof (1)R(ST)={(a, c)|aA and cC and bB [aRb (b, c) ST]}… …..dfn of R = {(a, c)|… bB [aRb ( bSc  bT c)]}……………dfn of  = {(a, c)|… bB [(aRb  bSc) (aRb  bT c)]}……distributive law = {(a, c)|… [bB (aRb  bSc)] [bB (aRb  bT c)]} by x[p(x)  q(x)] [xp(x)]  [xq(x)] = {(a, c)|… [(a, c)RS ] [(a, c)RT ]} by dfn of composition = {(a, c)|… (a, c)RS  RT } by dfn of  = RS  RT

  13. Proof (2)R(ST)  (RS)(RT) Take an element (pair) (a, c)  R(ST)  aA, cC and bB[aRb  (b, c)(ST)] dfn of composition  … bB[aRb  (bSc bTc)] dfn of ST  … bB[(aRb  bSc)(aRbbTc)] associative and idempotent laws … [bB(aRb  bSc)][bB(aRbbTc)] by x[p(x)  q(x)] [x p(x)] [x q(x)]  … [(a, c)  RS] [(a, c)  RT] by dfn of composition  (a, c)  (RS)(RT) by dfn of 

  14. R S b S = {(b, d )} a d R T T = {(c, d )} c The converse subset relation (RS)(RT)  R(ST) can be disproved by the following counterexample: R = {(a, b), (a, c)} RS = {(a, d )} RT = {(a, d )} (RS)(RT)= {(a, d )} (RS)(RT)  R(ST) / R(ST)=  ST = 

  15. Definition. Inverse of relation R is defined as: R-1 = {(a, b) | (b, a)R}. • It is just relation “turned backward”. • If R  AB , then R-1  BA • Inverse of “parent-of” is “child of”.

  16. RR-1 AA R  AB a1 b1   a1   R-1  BA a2  b2  a2 A B A Prove or disprove that RR-1 is reflexive.

  17. Theorem. Let R be a binary relation from A to B and S be a binary relation from B to C, so that RS is a composite relation from A to C. Then the inverse of this relation (RS)-1 = S-1 R-1 Proof. (RS)-1 is a binary relation from C to A. (RS)-1 = {(c, a) | (a, c)  RS }……..by the definition of inverse = {(c, a) | b B, aRb and bSc}…. by dfn of composition = {(c, a) | b B, (b, a)  R-1and (c, b) S-1} by dfn of inverse = {(c, a) | b B, (c, b) S-1and (b, a)R-1} by commutative property of and = {(c, a) | b B, (c, a) S-1R-1} by dfn of composition = S-1 R-1

  18. Closures of relations A closure “extends” a relation to satisfy some property. But extends it as little as possible. Definition. The closure of relation R with respect to property P is the relation S that i) contains R ii) satisfies property P iii) is contained in any relation satisfying i) and ii). That is S is the “smallest” relation satisfying i) and ii).

  19. Just a reminder: • reflexive: aRa for any a A • symmetric: aRb  bRa • transitive: aRbbRc  aRc • anti-symmetric: aRbbRa  a = b, • i. e. a b, aRb   bRa

  20. Lemma 1. The reflexive closure of R is S = R  {(a, a) | aA } =r(R). • Proof. In accordance to the definition of a closure, we need • to prove three things to show that S is reflexive closure: • i) S contains R • ii) S is reflexive • iii) S is the smallest relation satisfying i) and ii). S contains R and is reflexive by design.Furthermore, any relation satisfying i) must contain R, any satisfying ii) must contain the pairs (a, a), so any relation satisfying both i) and ii) must contain S

  21. S = r (R) R Example: R={(a, b), (a, c), (b, d), (d, e)} a b c d e a 0 1 1 0 0 b 0 0 0 1 0 c 0 0 0 0 0 d 0 0 0 0 1 e 0 0 0 0 0 a b c d e a 1 1 1 0 0 b 0 1 0 1 0 c 0 0 1 0 0 d 0 0 0 1 1 e 0 0 0 0 1 b • a • • c • b a • c • R r (R) d e e d • • • •

  22. Sometimes the relation on A that consists of all loops is called identity relation on A, i. e. IA={(a, a)|aA} Then reflexive closure of a relation RAA is r(R)=RIA Example of a reflexive closure. Let A be any set and consider the relation on Power(A) R = {(x, y)Power(A) Power(A) | xy} The reflexive closure of R would be the relation: RIPower(A)={(x, y)Power(A)Power(A)|(x, y)R or (x, y) IPower(A)} ={(x, y)Power(A)Power(A)| xy or x=y} ={(x, y)Power(A)Power(A)| x  y} Thus, the reflexive closure of the ‘proper subset’ relation is the ‘subset’relation.

  23. 1 2   R  3 5   4   1 2 r(R) 3   5 4  Consider the relation ‘less then’ on A={1, 2, 3, 4, 5} R = {(1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)} What is the reflexive closure of R?

More Related