any transitive relation that contains R
must also contain R. Therefore, R is
the transitive closure of R. Now that we
know that the transitive closure equals
the connectivity relation, we turn our
attention to the problem of computing
this relation. We do
the relation on the set of ordered pairs
of positive integers such that (a, b), (c,
d) R if and only if a + d = b + c. Show
that R is an equivalence relation. 16.
Let R be the relation on the set of
ordered pairs of positive integers such
that (a, b), (c,
rest of this section develops algorithms
for constructing transitive closures. As
will be shown later in this section, the
transitive closure of a relation can be
found by adding new ordered pairs
that must be present and then
repeating this process until
integers in this class are those divisible
by 4. Hence, the equivalence class of 0
for this relation is [0]=cfw_., 8, 4, 0, 4,
8,.. P1: 1 CH09-7T Rosen-2311T
MHIA017-Rosen-v5.cls May 13, 2011
15:29 9.5 Equivalence Relations 611
The equivalence class of 1
contains all ordered pairs of positive
integers where the first element is
greater than the second element and
R1 contains all ordered pairs of
positive integers where the first
element is less than the second.
Suppose that a relation R is not
transitive
classes of R? 59. Let R be the relation
on the set of all colorings of the 2 2
checkerboard where each of the four
squares is colored either red or blue so
that (C1, C2), where C1 and C2 are 2 2
checkerboards with each of their four
squares colored blue o
closure of the reflexive closure of the
transitive closure of a relation? 65.
Suppose we use Theorem 2 to form a
partition P from an equivalence
relation R. What is the equivalence
relation R that results if we use
Theorem 2 again to form an
equivalence r
Moreover, an edge in a directed graph
can occur more than once in a path.
EXAMPLE 3 Which of the following are
paths in the directed graph shown in
Figure 1: a, b, e, d; a, e, c, d, b; b, a, c, b,
a, a, b; d,c; c, b, a; e, b, a, b, a, b, e? What
are the l
length 16 formed by equivalence
classes of bit strings that agree on the
last eight bits is a refinement of the
partition formed from the equivalence
classes of bit strings that agree on the
last four bits. In Exercises 52 and 53,
Rn refers to the family
that two identifiers are considered the
same when they are related by the
relation R31 in Example 5. Using
Example 5, we know that R31, on the
set of all identifiers in Standard C, is an
equivalence relation. What are the
equivalence classes of each of th
this in mind, we define a new relation.
DEFINITION 2 Let R be a relation on a
set A. The connectivity relation R
consists of the pairs (a, b) such that
there is a path of length at least one
from a to b in R. Because Rn consists of
the pairs (a, b) such t
relation. DEFINITION 3 Let R be an
equivalence relation on a set A. The set
of all elements that are related to an
element a of A is called the equivalence
class of a. The equivalence class of a
with respect to R is denoted by [a]R.
When only one relation
removed from a graph, without
removing endpoints of any remaining
edges, a smaller graph is obtained.
Such a graph is called a subgraph of the
original graph. DEFINITION 7 A
subgraph of a graph G = (V , E) is a
graph H = (W, F ), where W V and F
E. A sub
Exercise 11? a) 010 b) 1011 c) 11111
d) 01010101 31. What are the
equivalence classes of the bit strings in
Exercise 30 for the equivalence
relation from Exercise 12? 32. What
are the equivalence classes of the bit
strings in Exercise 30 for the
equivalen
relation R = cfw_(1, 1), (1, 2), (2, 1), (3, 2)
on the set A = cfw_1, 2, 3 is not reflexive.
How can we produce a reflexive
relation containing R that is as small as
possible? This can be done by adding
(2, 2) and (3, 3) to R, because these are
the only p
R1 and R2 are equivalence relations on
a set A. Let P1 and P2 be the partitions
that correspond to R1 and R2,
respectively. Show that R1 R2 if and
only if P1 is a refinement of P2. 55.
Find the smallest equivalence relation
on the set cfw_a, b, c, d, e co
strings with respect to the equivalence
relation in Exercise 14? a) No b) Yes c)
Help 39. a) What is the equivalence
class of (1, 2) with respect to the
equivalence relation in Exercise 15? b)
Give an interpretation of the
equivalence classes for the equi
same three bits.) Solution: The bit
strings equivalent to 0111 are the bit
strings with at least three bits that
begin with 011. These are the bit
strings 011, 0110, 0111, 01100, 01101,
01110, 01111, and so on.
Consequently, [011]R3 = cfw_011, 0110,
0111,
Number_of_named_tropical_storms. An
identifier is equivalent to the
Number_of_named_tropical_storms_in_
the_Atlantic_in_ 2005 if and only if it
begins with its first 31 characters.
Because these characters are
Number_of_named_tropical_storms, we
see that
and the president of Mongolia as the
second element? We will use graphs to
model this application in Chapter 10.)
P1: 1 CH09-7T Rosen-2311T
MHIA017-Rosen-v5.cls May 13, 2011
15:29 9.4 Closures of Relations 601
EXAMPLE 5 Let R be the relation on the
set o
transitivity, because aRc and cRb, we
have aRb. Because (i) implies (ii), (ii)
implies (iii), and (iii) implies (i), the
three statements, (i), (ii), and (iii), are
equivalent. We are now in a position to
show how an equivalence relation
partitions a set.
numbers, cfw_0, the positive real
numbers b) the set of irrational
numbers, the set of rational numbers
c) the set of intervals [k, k + 1], k = .,
2, 1, 0, 1, 2,. d) the set of intervals
(k, k + 1), k = ., 2, 1, 0, 1, 2,. e) the
set of intervals (k, k + 1
00, the set of bit strings that contain
the string 01, the set of bit strings that
contain the string 10, and the set of bit
strings that contain the string 11 c) the
set of bit strings that end with 00, the
set of bit strings that end with 01, the
set of
one or more telephone lines from one
center to another? Because not all
links are direct, such as the link from
Boston to Denver that goes through
Detroit, R cannot be used directly to
answer this. In the language of
relations, R is not transitive, so it
b and that m>n, so that m n + 1. By
the pigeonhole principle, because
there are n vertices in A, among the m
vertices x0, x1,.,xm1, at least two are
equal (see Figure 2). Suppose that xi =
xj with 0 i 1. Show that the relation R
= cfw_(a, b) | a b (mod m)
x1, x2,.,xn1, b with (a, x1) R, (x1,
x2) R,. , and (xn1, b) R. Theorem
1 can be obtained from the definition
of a path in a relation. THEOREM 1 Let
R be a relation on a set A. There is a
path of length n, where n is a positive
integer, from a to b if and
We now provide an example of a
partition of the set of all strings arising
from an equivalence relation on this
set. EXAMPLE 15 Let R3 be the relation
from Example 5. What are the sets in
the partition of the set of all bit strings
arising from the relati
we know that this relation is not
symmetric (for instance, 2 | 4 but 4| 2).
We conclude that the divides relation
on the set of positive integers is not an
equivalence relation. EXAMPLE 7 Let
R be the relation on the set of real
numbers such that xRy if a
representing R, how many nonzero
entries are there in MR, the matrix
representing R, the complement of R?
18. Draw the directed graphs
representing each of the relations from
Exercise 1. 19. Draw the directed
graphs representing each of the
relations from
(0) = g(0) or f (1) = g(1) c) cfw_(f, g) | f (x)
g(x) = 1 for all x Z d) cfw_(f, g) | for
some C Z, for all x Z, f (x) g(x) =
C e) cfw_(f, g) | f (0) = g(1) and f (1) =
g(0) 4. Define three equivalence
relations on the set of students in your
discrete ma