
Announcements ICS 6B } Regrades for Quiz #3 and Homeworks #4 & Boolean Algebra & Logic 5 are due Thursday Lecture Notes for Summer Quarter, 2008 Michele Rousseau Set 7 – Ch. 8.4, 8.5, 8.6 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 2 Grades Overall Grades & Quiz #3… Quiz #3 90-100 } Max: 100% } Min: 42% 80-89 } Median: 83% 70-79 Overall 60-69 less } Max: 99% than 50 } Min 45% 01234567 } Median: 84% Overall Quiz #3 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 3 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 4 Today’s Lecture } Chapter 8 8.4, 8.5, 8.6 ● Closures of Relations 8.4 Chapter 8: Section 8.4 ● Equivalence Relations 8.5 ● Partial Orderings 8.6 Closures of Relations Lecture Set 7 - Chpts 8.4, 8.5, 8.6 5 1 Closure of Relations Reflexive Closure Let R be a relation on set A. Example Let P be a property (reflexive, symmetric, etc.) A1,2,3 The closure of R with respect to the property P R1,1,1,2,1,3 is the smallest relation containing R which has this property. P“being reflexive” } In other words, add the minimum number of pairs to obtain R is not reflexive, b/c its missing 2,2, 3,3 property P. The smallest reflexive relation containing R is } Note: This may not be possible. S1,1,1,2,1,3,2,2,3,3 Example: This is the reflexive closure of R & it’s the intersection A1,2,3,4, R1,1,1,3,14 of all of the reflexive relations that contain R P is being “irreflexive” Any relation on A which is reflexive and contains R } If the closure S of R w.r.t. P exists, must include: ● Then the relations S is the intersection of all the relations R which satisfy property p. 1,1,1,2,1,3 and 1,1, 2,2, 3,3 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 7 R The diagonal pairs in AxA 8 Symmetric Closure Reflexive Closure (2) Example } Let R be a relation on set A. A1,2,3 R1,1,1,2,1,3 } Then the reflexive closure of R always exists: we just need to add all the P“being symmetric” elements of the form a,a with a A. R is not symmetric , b/c it’s missing 2,1, 3,1 The smallest symmetric relation containing R is } In other words the “diagonal in AxA” S1,1,1,2,1,3,2,1,3,1 Note: we are adding R-1 Theorem: This is the symmetric closure of R. If R is a relation on A, denote by ={(a,a): aA} Generalized: the diagonal in AxA. Then the reflexive closure of R If R is a relation on A. Then the symmetric closure of R exists and is equal to exists and is equal to Sreflexive = R -1 Ssymy = R R Lecture Set 7 - Chpts 8.4, 8.5, 8.6 9 10 Irreflexive, AntiSymmetric & Symmetric Closure (2) Example Asymetric Closures Assume P “being irreflexive” A 1,2,3,4 R 1,3,2,2, 2,4, 3,3, 3,4, 4,3 A1,2,3,4, R1,1,1,3,14 R‐13,1, 2,2, 4,2, 3,3, 4,3, 3,4 } Shows that if R is not irreflexive we can’t make it irreflexive. Then ÆThus the irreflexive closure of R does not exist R R‐1 1,3,3,1,2,2,2,4,4,2,3,3,3,4,4,3 } When R is irreflexive This is the symmetric closure of R Æ the irreflexive closure of R exists – it is R itself. } The relation R then is the smallest irreflexive R R‐1 is the smallest symm‐relation containing R, relation containing R basically we are adding 3,1 & 4,2 which is } This also applies to: what R needed to become symmetric Lecture Set 7 - Chpts 8.4, 8.5, 8.6 11 ÆAntisymmetric & Asymetric closures. 12 2 In terms of a Digraph In terms of a Matrix } To find the reflexive closure } To find the reflexive closure ● add loops. ● Put 1’s on the diagonal. } To find the symmetric closure } To find the symmetric closure ● add arcs in the opposite direction. ● Take the transpose MT of the connection matrix M } To find the transitive closure ‐ if there is a R path from a to b Note: This relation is denoted RT or Rc and ● add a direct arc from a to b. and called the converse of R Note: Reflexive and Symmetric closures are easy Transitive can be complicated Lecture Set 7 - Chpts 8.4, 8.5, 8.6 13 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 14 Transitive Closure t(R) Paths } This is a little more difficult } A path of length n in a diagram G is the c b •Because (a,b) and (b,c) the sequence of edges: transitive closure must contain (a,c) ● x0, x1 x1, x2…xn‐1, xn •Similarly it must contain (b,d) ● The terminal vertex of the previous arc a d matc hes the in itia l ver tex o f the fo llow ing arc } The edges a,c and b,d seem to be the least amount of edges that need to be added in order to make R } If x0 xn the path is called a cycle or a circuit. transitive This is similarly true for relations c b •This is not Transitive – because of (a,c), (b,d) – we need to add (a,d) Now it is transitive – it may take a d several iterations Lecture Set 7 - Chpts 8.4, 8.5, 8.6 so t(R)=Ra,c,b,d,a,d 15 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 16 Theorem: Let R be a relation on set A. There is a path of length n from a to b iff a,b Rn From the induction Hypothesis Proof: by induction a,x R } Basis: And since x,b is a path of length n 1 An arc from a to b is a path of length 1 which is in R R. x,b Rn Hence the assertion is true for n1 c x if a,x R } Induction Hypothesis: n Assume the assertion is true for n. and x,b R , Show it is true for n1 a b then a,b Rn R Rn1 } There is a path of length n1 from a to b iff Q.E.D Æ quod erat demonstrandum there is an x A such that “that which was to have been demonstrated” there is a path of length 1 from ato xand a path of length n from x to b. Lecture Set 7 - Chpts 8.4, 8.5, 8.6 17 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 18 3 Proof Transitivity Closure (2) Theorem: R* is the transitive closure of R. Theorem: Proof: Let R be a relation on set A. * The connectivity relation or the star closure We must show that R is transitive ∞ * * is the relation R* =Rn Suppose a,b R and b,c R n1 Show a,c R* } R* is the union of all powers of R ● By definition of R* , a,b Rm for some m n } Notice that R* contains the ordered set a,b if and b,c R for some n there is a path from a to b ● Then a,c RnRm Rmn which is contained * } tR is the smallest transitive relation containing R in R . * } R is transitive iff Rn is contained in R for all n Hence R must be transitive } Notice that R * contains R 1 n * Lecture Set 7 - Chpts 8.4, 8.5, 8.6 19 ● Because RR R R 20 So R* is a transitive relation containing R In fact we only have to consider paths of n or less By definition the transitive closure of R, tR, is the Theorem: If |A| n, then any path of length n must smallest transitive relation containing R. contain a cycle To prove this lets suppose S is any transitive relation Proof: that contains R If we write down a list of more than n vertices representing a path in R, some vertex must appear at WthWe must show S contitains R* thto show R* ithis the least twice in the list by the Pigeon Hole Principle. smallest such relation. Thus Rk for k n doesn’t contain any arcs that don’t * 2 R S, so R S S since S is transitive already appear in the first n powers of R. There fore Rn Sn S for all n. Hence S must contain R* since it must also contain the union of all powers of R. Q.E.D Lecture Set 7 - Chpts 8.4, 8.5, 8.6 21 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 22 Corollaries 3 Methods to construct R* = R R2 . Rn Corollary: If | A | n, then 1. Digraphs tR R* R R2 . Rn 2. Binary Matrices 3. Warshall’s Alggorithm detailed in book Corollary: We can find the connection matrix of tR by computing the join of the first n powers of the connection matrix of R. Lecture Set 7 - Chpts 8.4, 8.5, 8.6 23 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 24 4 Method 1: Diagraphs Example: Digraphs Constructing R* R R2 .
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages9 Page
-
File Size-