Docsity

Lecture 9: Equivalence Relations and Transitive Closure, Study notes of Computer Science

Toggle sidebar
bg1
Lecture 9: 4/28/2009
Announcements: Ps5 out today: Review Problems, not to be turned in
Ps4 solutions out tomorrow;
Midterm Tues, May 5; Open Book and Notes; Coverage through relations (today)
Discussion this Friday: Review session (run by me). Bring questions
Relations Continued.
Reflexive: x R x for all x
Symmetric: x R y -> y R x for all x,y
Transitive: x R y and y R x -> x R z for all x, y, z
------------------------------------------
1. Equivalence classes, quotients
if R has all three properties, R is said to be an equivalence relation (2.8)
Important definition:
If R is an equivalence relation on A x A then [x] denotes the set
of all elements related to x:
[x] = { x': x R x'}
We call [x] the *equivalence class* (or *block*) of x.
The set of all equivalence classes of A with respect to a
relation R is denoted A/R "quotient set of A by R", or "A mod R".
Claim: every equivalence relation *partitions* the universe into its blocks?
What does this mean?
Recall we defined a partitioning of the set A:
Def: { Ai: i in I} is a partition of A if each Ai is nonempty,
their union is A, and they are pairwise disjoint.
pf3
pf4
pf5

Partial preview of the text

Download Lecture 9: Equivalence Relations and Transitive Closure and more Study notes Computer Science in PDF only on Docsity!

Lecture 9: 4/28/ Announcements: Ps5 out today: Review Problems, not to be turned in Ps4 solutions out tomorrow; Midterm Tues, May 5; Open Book and Notes; Coverage through relations (today) Discussion this Friday: Review session (run by me). Bring questions Relations Continued. Reflexive: x R x for all x Symmetric: x R y - > y R x for all x,y Transitive: x R y and y R x - > x R z for all x, y, z


  1. Equivalence classes, quotients if R has all three properties, R is said to be an equivalence relation (2.8) Important definition: If R is an equivalence relation on A x A then [x] denotes the set of all elements related to x: [x] = { x': x R x'} We call [x] the * equivalence class * (or * block *) of x. The set of all equivalence classes of A with respect to a relation R is denoted A/R "quotient set of A by R", or "A mod R". Claim: every equivalence relation partitions the universe into its blocks? What does this mean? Recall we defined a partitioning of the set A: Def: { Ai: i in I} is a partition of A if each Ai is nonempty, their union is A, and they are pairwise disjoint.

Note: you can talk about the blocks being related to one another by R, [x] R [y] iff x R y. Well-defined. Now go back to prior examples and identify the blocks in each case. Proposition: Let R be an equivalence relation on a set A. Then the blocks of R are a partition of A. (Thm 2.6 in book) ........................................................ Proof: - Every element x of A is in the claimed partition: x โˆˆ [x].

  • Suppose that [x] and [y] intersect. I need to argue that they are identical. So suppose there exists a s.t. a โˆˆ [x] and a โˆˆ [y]. I must show that [x] = [y]. So suppose b in [x]. Must show bโˆˆ [y]. b in [x] - > x R b is true - > b R x is true know: x R a is true - > b R a is true - > a R b is true know a R y is true - > y R a is true - > y R b is true - > b in [y] Suppose b in [y]. Must show b in [x]. Exactly analogous. ...................................................................... Proposition: Suppose you have a partition { Ai iโˆˆ I} of A. Then this determines a equivalence relation in the natural way; x R y iff x โˆˆ Ai and y โˆˆ Ai for some i. ...................................................................... Go back to prior examples and identify the blocks: Example 1. alpha E beta if alpha, beta regular expressions denoting the same language --> each block is the set of regular expressions denoting the same language. Can you think of a "canonical" name for each block?

Example 9: \Let \R be the set of real number, x~y if x - \lfloor x \rfloor = y - \lfloor y \rfloor What are the blocks? What would be a "canonical element" (name) for each block? Real values in the range (-1, 1).


  1. Closures of Relations (2.7)

Given a relation, we sometimes want to FORCE it to be reflexive ... or symmetric ... or transitive ...or any combination of these. We do this by adding just enough extra pairs to get the property. Draw a picture for the transitive closure of a directed graph. Draw a picture for reflexive-transitive closure. Def: The transitive closure of a relation R on A x A is the smallest relation R* that contains A and is transitive. claim: this is well defined: there is a unique smallest relation R that contains A x A and is transitive. In fact, it is the intersection of all relations R that are transitive and contain A. Procedure to find the transitive closure: "add in all shortcuts". In the graph-theoretic realization of the relation R, just add an arc (a,c) whenever you have an (a,b) and a (b,c) but lack an (a,c). Example 1: Do it with a graph Example 2: An infinite set example: Suppose i R i+1 for all i in Z. Transitive closure is what?

Another view of Transitive closure is to consider R^2 = R ยฐ R, which contains all pairs implied directly by transitivity, then R^3 = R^2 ยฐ R, which contains all pairs implied by transitivity used twice, and = R^4 and so on, If we consider all powers up to = Rn-^1 , and union them all together, we get the transitive closure of a finite set of size n. NOTE DONE in Class: Let |- be a relation on states of your computer, where the state captures all the contents of your machine: registers, disk contents, etc. Assume not hooked up to the web or a keyboard so that whatever happens next is determined by its present state | + |--- for the transitive closure of the above. What would this represent? | You will go from state C to state C'. Eventually. What would you say if C |- C? Your machine is looping. Reflexive closure R <- R union {(x,x): x in A} (easy) Transitive closure: if (x,y) in R and (y,z) in R add (x,z) to R.