announcements ics 6b
play

Announcements ICS 6B Regrades for Quiz #3 and Homeworks #4 & 5 - PDF document

Announcements ICS 6B Regrades for Quiz #3 and Homeworks #4 & 5 are due Thursday Boolean Algebra & Logic Lecture Notes for Summer Quarter, 2008 Michele Rousseau Set 7 Ch. 8.4, 8.5, 8.6 2 Lecture Set 7 - Chpts 8.4, 8.5, 8.6


  1. Announcements ICS 6B � Regrades for Quiz #3 and Homeworks #4 & 5 are due Thursday Boolean Algebra & Logic Lecture Notes for Summer Quarter, 2008 Michele Rousseau Set 7 – Ch. 8.4, 8.5, 8.6 2 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 Grades Overall Grades & Quiz #3… Quiz #3 � Max: 100% 90-100 � Min: 42% 80-89 � Median: 83% 70 79 70-79 60-69 Overall less � Max: 99% than 50 � Min 45% 0 1 2 3 4 5 6 7 � 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

  2. Reflexive Closure Closure of Relations Example Let R be a relation on set A. A��1,2,3� Let P be a property (reflexive, symmetric, etc.) The closure of R with respect to the property P R���1,1�,�1,2�,�1,3�� is the smallest relation containing R which has P�“being reflexive” this property. R is not reflexive, b/c its missing �2,2�, �3,3� � In other words, add the minimum number of pairs to obtain property P. property P. The smallest reflexive relation containing R is The smallest reflexive relation containing R is � Note: This may not be possible. S���1,1�,�1,2�,�1,3�,�2,2�,�3,3�� Example: This is the reflexive closure of R & it’s the intersection A��1,2,3,4�, R���1,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 �1,1�,�1,2�,�1,3� and �1,1�, �2,2�, �3,3� relations R which satisfy property p. R The diagonal pairs in AxA 7 8 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 Symmetric Closure Reflexive Closure (2) Example A��1,2,3� � Let R be a relation on set A. R���1,1�,�1,2�,�1,3�� � Then the reflexive closure of R always P�“being symmetric” exists: we just need to add all the R is not symmetric , b/c it’s missing �2,1�, �3,1� elements of the form �a,a� with a � A. The smallest symmetric relation containing R is The smallest symmetric relation containing R is � In other words the “diagonal � in AxA” S���1,1�,�1,2�,�1,3�,�2,1�,�3,1�� Note: we are adding R -1 This is the symmetric closure of R. Theorem: If R is a relation on A, denote by � ={(a,a): a � A} 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 S reflexive = R � � S sym = R � R -1 y Lecture Set 7 - Chpts 8.4, 8.5, 8.6 9 10 Irreflexive, AntiSymmetric & Symmetric Closure (2) Asymetric Closures Example Assume P � “being irreflexive” A � �1,2,3,4� A��1,2,3,4�, R���1,1�,�1,3�,�14�� R � ��1,3�,�2,2�, �2,4�, �3,3�, �3,4�, �4,3�� � Shows that if R is not irreflexive we can’t make it R ‐1 ���3,1�, �2,2�, �4,2�, �3,3�, �4,3�, �3,4�� irreflexive. Then 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 � the irreflexive closure of R exists – it is R itself. This is the symmetric closure of R � 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 � Antisymmetric & Asymetric closures. Lecture Set 7 - Chpts 8.4, 8.5, 8.6 11 12 2

  3. 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 ● Take the transpose M T of the connection ● add arcs in the opposite direction. matrix M R � To find the transitive closure ‐ if there is a path from a to b Note: This relation is denoted R T or R c 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 13 14 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 Transitive Closure t(R) Paths � This is a little more difficult � A path of length n in a diagram G is the c •Because (a,b) and (b,c) the sequence of edges: b transitive closure must contain (a,c) ● �x 0 , x 1 � �x 1 , x 2 �…�x n‐1 , x n � •Similarly it must contain (b,d) ● The terminal vertex of the previous arc a d matches the initial vertex of the following arc t h th i iti l t f th f ll i � The edges �a,c� and �b,d� seem to be the least amount of � If x 0 � x n the path is called a cycle or a circuit . edges that need to be added in order to make R transitive This is similarly true for relations c •This is not Transitive – b because of (a,c), (b,d) – we need to add (a,d) Now it is transitive – it may take a d several iterations so t(R)=R ���a,c�,�b,d�,�a,d�� Lecture Set 7 - Chpts 8.4, 8.5, 8.6 15 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 16 Theorem: Let R be a relation on set A. From the induction Hypothesis There is a path of length n from a to b iff �a,b� � R n �a,x�� R Proof: �by induction� � Basis: And since �x,b� is a path of length n An arc from a to b is a path of length 1 which is in R 1 �R. �x,b�� R n Hence the assertion is true for n�1 c x if �a,x�� R � Induction Hypothesis: yp and �x,b�� R n , Assume the assertion is true for n. then �a,b�� R n �R� R n � 1 Show it is true for n�1 a b � There is a path of length n�1 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 a to x and 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

  4. Proof Transitivity Closure (2) Theorem: R * is the transitive closure of R. Proof: Theorem: Let R be a relation on set A. We must show that R * is transitive The connectivity relation or the star closure Suppose �a,b�� R * and �b,c� � R * ∞ is the relation R * = � R n n�1 Show �a,c� � R * � R * is the union of all powers of R ● By definition of R * , �a,b� � R m for some m and �b,c� � R n for some n � Notice that R * contains the ordered set �a,b� if ● Then �a,c� � R n R m � R m�n which is contained there is a path from a to b in R * . � t�R� is the smallest transitive relation containing R Hence R * must be transitive � R is transitive iff R n is contained in R for all n � Notice that R * contains R ● Because R�R 1 � R n �R * 19 20 Lecture Set 7 - Chpts 8.4, 8.5, 8.6 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, t�R�, is the Theorem: If |A|� n , then any path of length � n must smallest transitive relation containing R. contain a cycle Proof: To prove this lets suppose S is any transitive relation If we write down a list of more than n vertices that contains R representing a path in R, some vertex must appear at We must show S contains R * to show R * is the R * t R * i th least twice in the list �by the Pigeon Hole Principle�. least twice in the list �by the Pigeon Hole Principle� W t h S t i h smallest such relation. Thus R k for k � n doesn’t contain any arcs that don’t R � S, so R * � S 2 � S since S is transitive already appear in the first n powers of R. There fore R n � S n � 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 3 Methods to construct Corollaries R* = R � R 2 � . . . � R n Corollary: If | A | � n, then 1. Digraphs t�R� � R* � R �R 2 � . . . � R n 2. Binary Matrices 3. Warshall’s Algorithm �detailed in book� g � � Corollary: We can find the connection matrix of t�R� 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

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend