Relations (continued)

Discrete Systems I
Lecture 06
Closures, Equivalence Relations, and
Orders
Profs. Koike and Yukita
1. Closure properties
Consider all the relations on a set A.
Let P be a property of such relations,
such as being symmetric or being transitiv e.
The P closure of a relation R on A,
written P( R), is a P - relation such that
R  P( R)  S for every P - relation S .
2
Example 1: Parent
• Let A be a set of persons. Let R be a relation
where aRb means that a is a parent of b. Let
S be a relation where aSb means that a is an
ancestor of b. Clearly, we see that R is not
transitive while S is transitive. S is called
the transitive closure of R.
Note that S  R  R  R    R
2
3
*
3
Def: Transitive closure

transitive ( R)  R   R
*
i
i 1
4
Example 2: Transitive Closure
A  {1,2,3}
R  {(1,2), (2,3), (3,3)}
R 2  {(1,3), (2,3), (3,3)}
R 3  {(1,3), (2,3), (3,3)}  R 2
...
R *  R  R 2  R 3  {(1,2), (2,3), (3,3), (1,3)}
5
Problem 1: Find the transitive
closure.
2
1
3
6
Example 3: Spouses
• Let A be a set of persons. Let R be a relation
where aRb means that a is a husband of b.
Let S be a relation where aSb means that a
is a spouse of b. Clearly, we see that R is
not symmetric while S is symmetric. S is
called the symmetric closure of R.
Note that R  S , S  R  R 1.
7
Def: Reflexive and symmetric
closure
  {( a, a ) | a  A}
(1) Reflexive closure of R.
reflexive( R)  R  
(2) Symmetric closure of R.
symmetric( R)  R  R
1
8
Example 4
A  {1,2,3,4}
R  {(1,1), (1,3), (2,4), (3,1), (3,3), (4,3)}
reflexive( R )  R  {( 2,2), (4,4)}
symmetric( R )  R  {( 4,2), (3,4)}
9
Problem 2
Draw a directed graph of the following relation
R. Draw also its reflexive closure and its
symmetric closure separately.
A  {1,2,3,4}
R  {(1,1), (1,3), (2,4), (3,1), (3,3), (4,3)}
10
Example 5
The relation  on the set N.
reflexive( )  "  "  " "
symmetric( )  "   "  " "
11
2. Equivalence relation
A relation R on a non empty set S is
an equivalence relation if it has the following
properties .
(1) For every a  S , aRa .
(reflexive )
(2) If aRb , then bRa .
(symmetric )
(3) If aRb and bRc , then aRc. (transitiv e)
12
Examples
(0) 
(1) Congruence on the set of triangles .
(2) Similarity on the set of triangles .
(3) " parallel or equal to" relation on the set of
all straight lines on a plane.
(4) congruent modulo m
a  b (mod m)
13
Partitions
The equivalence class of a in S is
[a ]  {x | (a, x)  R}.
The quotient set of S by R is
S / R  {[ a ] | a  S }.
Any b  [a ] is called a representa tive of
the equivalenc e class [a ].
We may write [b]  [a ].
14
Example: Partition
A  {1,2,3,4,5}
R  {(1,1), (1,2), (2,1), (2,2), (3,3), (4,4), (4,5), (5,4), (5,5)}
1
3
2
4
5
15
Example: Quotient
A  {1, 2,3, 4,5}
R  {(1,1),(1, 2),(2,1),(2, 2),(3,3),(4, 4),(4,5),
(5, 4),(5,5)}
The quotient of A by R is
A / R  {[1],[3],[4]}.
Since [1]  [2]  {1, 2}, [3]  {3},
and [4]  [5]  {4,5}, we can also write as
A / R  {{1, 2},{3},{4,5}}.
16
Problem 3:
Find the quotient A/R by a graph omitting the
loopbacks and neglecting the directions.
A  {1,2,3,4,5}
R  {(1,1), (1,2), (2,1), (2,2), (3,3), (4,4), (4,5),
(5,4), (5,5)}
17
Example: Residue classes(1)
Let R5 be the relation on Z defined by
x  y (mod 5)
which reads " x is congruent to y modulo 5"
and which means that the difference x  y is
divisible by 5. Examples :
8  3(mod 5),  1  4(mod 5), 5  0(mod 5).
18
Example: Residue classes(2)
Z / R5  {0, 1 , 2, 3, 4} where
0  { ,  10,  5, 0, 5, 10, }
1  { ,  9,  4, 1, 6, 11, }
2  { ,  8,  3, 2, 7, 12, }
3  { ,  7,  2, 3, 8, 13, }
4  { ,  6,  1, 4, 9, 14, }.
Observe that Z  0  1  2  3  4.
19
3. Partial order
R is a partial oder if
(1) R is reflexive, transitiv e,
(2) aRb and bRa implies a  b.(antisymmet ric)
Remark : An antisymmet ric relation is
a one - way relation in which self - loops are allowed.
There are relations that are neither symmetric nor
antisymmet ric.
20
Examples
(1) Set inclusion  .
(2) The relation  on the set R.
(3) The relation " a divides b" .
21
Problem 4
Given A  {1,2,3,4} and B  {x, y, z}. Let R be
the following relation from A to B.
R  {(1, y ), (1, z ), (3, y ), (4, x), (4, z )}
(1) Determine the matrix representa tion of R.
(2) Draw the arrow diagram of R.
(3) Determine the domain and the range of R.
22
Problem 5
Let A  {1,2,3,4,6}, and let R be the relation "|".
(a) Write R as a set of ordered pairs.
(b) Draw its directed graph. Omit the self loopbacks.
23
Problem 6
Let A  {1,2,3}, B  {a, b, c}, and C  {x, y, z}.
Consider t he following relations R and S
from A to B and from B to C , respective ly.
R  {(1, b), (2, a ), (2, c)}
S  {( a, y ), (b, x), (c, y ), (c, z )}
(1) Find the compositio n R  S .
(2) Find the matrices M R , M S , and M RS .
24
Problem 7
Consider t he following relations on the set A  {1,2,3}.
R  {(1,1), (1,2), (1,3), (3,3)}
S  {(1,1), (1,2), (2,1), (2,2), (3,3)}
T  {(1,1), (1,2), (2,2), (2,3)}
  empty relation, A  A  universal relation
Determine whether or not each of the above
relation is : (a) reflexive; (b) symmetric;
(c) transitiv e.
25
Problem 8
Let A be the set of nonzero integers and let  be
the relation on A  A defined by
(a, b)  (c, d ) if and only if ad  bc.
Prove that  is an equivalenc e relation.
26
Problem 9
Consider t he set of words W  {sheet, last, sky, wash,
wind, sit}. Find W / R where R is the equivalenc e
relation on W defined by either
(a) " has the same number of letters as" ;
(b) " begins with the same letter as".
27
Problem 10
Consider t he relation R on Z defined as
aRb if and only if b  a r for some positive
integer r. Show that R is a partial order on Z.
28