Title: Discussion
1Discussion 27Closures Equivalence Relations
2Topics
- Reflexive closure
- Symmetric closure
- Transitive closure
- Equivalence relations
- Partitions
3Closure
- Closure means adding something until done.
- Normally adding as little as possible until some
condition is satisfied - Least fixed point similarities
4Reflexive Closure
- Reflexive closure of a relation R(r)
- smallest reflexive relation that contains R (i.e.
fewest pairs added) - R(r) R ? IA (R is a relation on a set A,
and IA is the identity relation ? 1s on
the diagonal and 0s elsewhere.)
R
R(r)
?x (xRx)
5Symmetric Closure
- Symmetric closure of a relation R(s)
- smallest symmetric relation that contains R (i.e.
fewest pairs added) - R(s) R ? R (R is R inverse)
R
R
R ? R
?x?y(xRy ? yRx)
6Transitive Closure
- Transitive closure of a relation R(t) R
- smallest transitive relation that contains R
(i.e. fewest pairs added) - for each path of length i, there must be a direct
path. (This follows from x?y, y?z ? x?z since,
if we also have v?x, we must have v?z, a path of
length 3.) - R(t) R ? R2 ? R3 ? ? RA. (No path can be
longer than A, the number of elements in A.)
7Transitive Closure Example 1
1
All paths of length 1
R
2
3
1
All paths of length 2
R2
2
3
1
All paths of length 3
RR2 R3
2
3
R?R2?R3
8Transitive Closure Example 2
1
R
All paths of length 1
2
3
1
R2
All paths of length 2
2
3
1
RR2 R3
All paths of length 3
2
3
1
R?R2?R3
Paths of any length
2
3
9Reflexive Transitive Closure
- Reflexive transitive closure of a relation R
- smallest reflexive and transitive relation that
contains R - R IA ? R R0 ? R R0 ? R1 ? R2 ? RA
- Example
IA R0
R1 ? R2 ? R3
1
R0 ? R1 ? R2 ? R3
2
3
10Equivalence Relations
- A relation R on a set A is an equivalence
relation if R is reflexive, symmetric, and
transitive. - Equivalence relations are about equivalence
- Examples
- for integers x x reflexive
- x y ? y x symmetric
- xy ? yz ? xz transitive
- for sets A A reflexive
- A B ? B A symmetric
- AB ? BC ? AC transitive
- Let R be has same major as for college students
- xRx ? reflexive same major as self
- xRy ? yRx ? symmetric same major as each
other - xRy ? yRz ? xRz ? transitive same as, same as
? same as
11Partitions
- A partition of a set S is
- a set of subsets Si1,2,n of S
- such that ?ni1 Si S, Sj ? Sk ? for j ? k.
- Each Si is called a block (also called an
equivalence class) - Example
- Suppose we form teams (e.g. for a doubles tennis
tournament) from the set - Abe, Kay, Jim, Nan, Pat, Zed
- then teams could be
- Abe, Nan, Kay, Jim, Pat, Zed
- Note on same team as is reflexive, symmetric,
transitive ? an equivalence relation.
Equivalence relations and partitions are the same
thing (two sides of the same coin).
12Partitions (continued)
- Since individual elements can only appear in one
block (Sj ? Sk ? for j ? k), blocks can be
represented by any element within the block. - e.g. Nans Team
- John Stockons 1995 NBA finals team
- Formally, x set of all elements related to x
and y ? x iff xRy - e.g. Nan represents Abe, Nan, Nans team
- Abe represents Abe, Nan, Abes team
- John Stockton represents the set of players
who played in the playoffs for the Jazz in 1995
13Partitions Equivalence Relations
Example
- The mod function partitions the natural numbers
into equivalence classes. - 0 mod 3 0 so 0 forms a class 0
- 1 mod 3 1 so 1 forms new class 1
- 2 mod 3 2 so 2 forms new class 2
- 3 mod 3 0 so 3 belongs to 0
- 4 mod 3 1 so 4 belongs to 1
- 5 mod 3 2 so 5 belongs to 2
- 6 mod 3 0 so 6 belongs to 0
-
- Thus, the mod function partitions the natural
numbers into equivalence classes. - 0 0, 3, 6,
- 1 1, 4, 7,
- 2 2, 5, 8,
14Partitions ? Equivalence Relations
Theorem If S1, , Sn is a partition of S, then
RS?S is an equivalence relation, where R is in
same block as. Note to prove that R is an
equivalence relation, we must prove that R is
reflexive, symmetric, and transitive. Proof
Reflexive since every element is in the same
block as itself. Symmetric since if x is in the
same block as y, y is in the same block as x.
Transitive since if x and y are in the same
block and y and z are in the same block, x and z
are in the same block.
15Equivalence Relations ? Partitions
Theorem If RS?S is an equivalence relation and
x y xRy , then x x ? S is a
partition P of S. Note to prove that we have a
partition, we must prove (1) that every element
of S is in a block of P, and (2) that for every
pair of distinct blocks Sj and Sk (j?k) of P, Sj
? Sk ?. Proof (1) Since R is reflexive, xRx,
every element of S is at least in its own block
and thus in some block of P. (2) Suppose Sj ? Sk
? ? for distinct blocks Sj and Sk of P. Then, at
least one element y is in both Sj and Sk. Let Sj
y, x1, xn and Sk y, z1, zm, then
yRxi, i1, 2, , n, and yRzp, p1, 2, , m.
Since R is symmetric, xiRy, and since R is
transitive xiRzp. But now, since the elements of
Sj are R-related to the elements of Sk, x1, ,
xn, y, z1, , zm are together in a block of P and
thus Si and Sk are not distinct blocks of P.