100% found this document useful (2 votes)
76 views

Relations Lecture Notes

The document discusses binary relations and their properties. A binary relation R from set A to set B is a subset of the Cartesian product A × B, consisting of ordered pairs where the first element comes from A and the second from B. The composition of two relations R and S, written S ◦ R, is the relation containing pairs (a,c) such that there exists a b where (a,b) is in R and (b,c) is in S. A relation R on a set A is reflexive if (a,a) is in R for all a in A, symmetric if (a,b) implies (b,a), and transitive if (a,b) and

Uploaded by

nyamuona tinashe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
76 views

Relations Lecture Notes

The document discusses binary relations and their properties. A binary relation R from set A to set B is a subset of the Cartesian product A × B, consisting of ordered pairs where the first element comes from A and the second from B. The composition of two relations R and S, written S ◦ R, is the relation containing pairs (a,c) such that there exists a b where (a,b) is in R and (b,c) is in S. A relation R on a set A is reflexive if (a,a) is in R for all a in A, symmetric if (a,b) implies (b,a), and transitive if (a,b) and

Uploaded by

nyamuona tinashe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

RELATIONS

Recall from Sets

Let A and B be sets. The Cartesian product of A and B, denoted A × B, is the


set A × B = * (a, b) | a ∈ A and b ∈ B+

 A × B is the set of all ordered pairs whose first element is in A and whose second
element is in B. For example, if we take the sets A = * 1, 2, 3 + B = * 𝑥, y +
 Then A × B is the set A × B = *(1, x), (1, y), (2, x), (2, y), (3, x), (3, y)+.
 The number of elements in set A × B = number of elements in A multiplied by
number of elements in B.
 Notice that the ordering of the sets in the Cartesian product matters. For example,
given the sets A and B above, then B × A is the set
B × A = * (x, 1), (x, 2), (x, 3), (y, 1), (y, 2), (y, 3) +
 Consequently, A × B ≠ B × A.
RELATIONS
Introduction
 You are familiar with many relations such as “x less than y,” “is parallel to,” “A is a
subset of B,” and so on. In a certain sense, these relations consider the existence or
nonexistence of a certain connection between pairs of objects taken in a definite
order.
 The most direct way to express a relationship between elements of two sets is to
use ordered pairs made up of two related elements. For this reason, sets of ordered
pairs are called binary relations.
Relations

Let A and B be sets. A binary relation from A to B is a subset of A × B. In


other words, a binary relation from A to B is a set R of ordered pairs where
the first element of each ordered pair comes from A and the second element
comes from B.
RELATIONS

We use the notation aRb to denote that (a, b) ∈ R and aRb to denote that
a, b ∉ R. Moreover, when (a, b) belongs to R, a is said to be related to b by
R

 The domain of a relation R is the set of all first elements of the ordered pairs which
belong to R, and the range is the set of second elements.
 For example, if a is less than or equal to b we write a, b ∈ ≤ since a relation is a
set of ordered tuples. In the case of a binary relation we write a ≤ b.
 Throughout the rest of the course, we'll adopt the convention of replacing a relation
like =, <, ≤, |, ↔ etc with R.
Example
A = (1, 2, 3) and B = *x, y, z+, and let R = *(1, y), (1, z), (3, y)+. Then R is a relation
from A to B since R is a subset of A × B. With respect to this relation,
1Ry, 1Rz, 3Ry, but 1Rx, 2Rx, 2Ry, 2Rz, 3Rx, 3Rz
The domain of R is {1, 3} and the range is {y, z}.
RELATIONS
Functions as Relations
Recall that a function f from a set A to a set B assigns exactly one element of
B to each element of A.

The graph of f is the set of ordered pairs (a, b) such that b = f (a).

 Because the graph of f is a subset of A × B, it is a relation from A to B. Moreover,


the graph of a function has the property that every element of A is the first element
of exactly one ordered pair of the graph.
 A function 𝑓: A → B is a relation from A to B (i.e., a subset of A × B) such that
each a ∈ A belongs to a unique ordered pair (a, b) in f.
 A relation can be used to express a one-to-many relationship between the
elements of the sets A and B, where an element of A may be related to more than
one element of B.
 A function represents a relation where exactly one element of B is related to each
element of A.
RELATIONS
Relations on a Set

A relation on a set A is a relation from A to A.

 In other words, a relation on a set A is a subset of A × A.


 As an example of this, consider the relation < over the set {1, 2, 3}. The relation <
would then be defined by the ordered pairs < = { (1, 2), (1, 3), (2, 3) }
Example
 Let A be the set *1, 2, 3, 4+. Which ordered pairs are in the relation
R = {(a, b) | a divides b}?
 Because (a, b) is in R if and only if a and b are positive integers not exceeding 4 such
that a divides b, we see that
R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.
RELATIONS
Inverse Relations

Let R be any relation from a set A to a set B. The inverse of R, denoted by


R−1 , is the relation from B to A which consists of those ordered pairs which,
when reversed, belong to R; that is,
R−1 = *(b, a) | (a, b) ∈ R+

 To obtain R−1 you reverse the ordered pairs of R


 For example, let A = *1, 2, 3+ and B = *x, y, z+. Then the inverse of
R = *(1, y), (1, z), (3, y)+ is R−1 = *(y, 1), (z, 1), (y, 3)+
 Also, the domain and range of R−1 are equal, respectively, to the range and domain
of R. Moreover, if R is a relation on A, then R−1 is also a relation on A.
RELATIONS
Representing Relations
 There are many ways to visualizing a relation between finite sets. As we have seen
one way is to list its ordered pairs. One method uses zero–one matrices. The other
method uses pictorial representations called directed graphs.
Representing Relations Using Matrices
 Suppose A and B are finite sets. One way of picturing a relation R from A to B is to
form a rectangular array (matrix) whose rows are labelled by the elements of A and
whose columns are labelled by the elements of B.
 The entry in the matrix corresponding to a ∈ A and b ∈ B is 1 if a is related to b
and 0 otherwise.. This array is called the matrix of the relation.
Example
Suppose that A = *1, 2, 3,4+ and B = *x, y, z+. Let R be the relation from A to B
R = *(1, y), (1, z), (3, y), (4, x), (4, z)+. Determine the matrix of the relation.
RELATIONS
Representing Relations Using Digraphs
A directed graph, or digraph, consists of a set V of vertices (or nodes) together
with a set E of ordered pairs of elements of V called edges (or arcs). The vertex
a is called the initial vertex of the edge (a, b), and the vertex b is called the
terminal vertex of this edge.

 First we write down the elements of the set, and then we draw an arrow (edges/
arc) from each element a ( vertex) to each element b ( vertex) whenever a is related
to b. An edge of the form (a, a) is represented using an arc from the vertex a back to
itself. Such an edge is called a loop.
 The directed graph of the relation R = {(1, 1), (1, 3), (2, 1), (2, 3), (2, 4), (3, 1), (3, 2),
(4, 1)} on the set {1, 2, 3, 4} is shown below.
RELATIONS
Composition Of Relations

Let A, B and C be sets, and let R be a relation from A to B and let S be a


relation from B to C. That is, R is a subset of A × B and S is a subset of B × C.
Then R and S give rise to a relation from A to C denoted by S ◦ R and defined
by:
a(S ◦ R)c if for some b ∈ B we have aRb and bSc.
That is ,
S ◦ R = *(a, c) | there exists b ∈ B for which (a, b) ∈ R and (b, c) ∈ S+

 The relation S ◦ R is called the composition of R and S


 We are going to denote the composition of R and S by S ◦ R . This is done in order to
conform with the usual use of g ◦ f to denote the composition of f and g where f
and g are functions.
 Suppose R is a relation on a set A, that is, R is a relation from a set A to itself. Then
R ◦ R, the composition of R with itself, is always defined. Also, R ◦ R is sometimes
denoted by R2 . Similarly, R3 = R2 ◦R = R ◦ R ◦ R, and so on. Thus Rn is defined for all
positive n.
RELATIONS
Example
Let A = *1, 2, 3, 4+, B = *a, b, c, d+, C = *x, y, z+ and let
R = *(1, a), (2, d), (3, a), (3, b), (3, d)+ and S = *(b, x), (b, z), (c, y), (d, z)+

Consider the arrow diagrams of R and S as in Figure. Observe that there is an arrow
from 2 to d which is followed by an arrow from d to z. We can view these two arrows
as a “path” which “connects” the element 2 ∈ A to the element z ∈ C.
Thus: 2(S ◦ R)z since 2Rd and dSz
Similarly there is a path from 3 to x and a path from 3 to z.
Hence 3(S ◦ R)x and 3(S ◦ R)z
Accordingly, S ◦ R = *(2, z), (3, x), (3, z)+
RELATIONS
Composition of Relations and Matrices
 There is another way of finding S ◦ R. Let MR and MS denote respectively the matrix
representations of the relations R and S. Then

 Multiplying MR and MS we obtain the matrix

The nonzero entries in this matrix tell us which elements are related by S ◦ R.
RELATIONS
Reflexive Relations
A relation R on a set A is reflexive if aRa for every a ∈ A, that is,
if (a, a) ∈ R for every a ∈ A. Thus R is not reflexive if there exists a ∈ A such
that (a, a) ∉ R.
 Every element is related to itself.
 For example, equality relation is reflexive.
Symmetric and Anti-symmetric Relations

A relation R on a set A is symmetric if whenever aRb then bRa, that is, if


whenever (a, b) ∈ R then (b, a) ∈ R. Thus R is not symmetric if there exists
a, b ∈ A such that (a, b) ∈ R but (b, a) ∉ R.

 In other words if a is related to b, then b is related to a.


RELATIONS
Transitive Relations
A relation R on a set A is transitive if whenever aRb and bRc then aRc, that is,
if whenever (a, b), (b, c) ∈ R then (a, c) ∈ R. Thus R is not transitive if there
exist a, b, c ∈ R such that (a, b), (b, c) ∈ R but (a, c) ∉ R.

 Whenever a is related to b and b is related to c, we know a is related to c.For


examples, if x = y and y = z, then x = z.
RELATIONS
Example
Consider the following relations on A = *1, 2, 3, 4+:
R1 = *(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)+,
R2 = *(1, 1), (1, 2), (2, 1)+,
R3 = *(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)+,
R4 = *(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)+,
R5 = *(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)+

Which of these relations are reflexive?


 The relations R3 and R5 are reflexive because they both contain all pairs of the form
(a, a), namely, (1, 1), (2, 2), (3, 3), and (4, 4). The other relations are not reflexive
because they do not contain all of these ordered pairs. In particular, R1, R2, R4, and
R6 are not reflexive because (3, 3) is not in any of these relations.
Determine which of the relations are symmetric.
 R1 is not symmetric since (1, 2) ∈ R1 but (2, 1) ∉ R1. R4 is not symmetric since (2, 1)
∈ R3 but (1, 2) ∉ R3. R5 is not symmetric since (1, 2) ∈ R3 but (2, 1) ∉ R3.
RELATIONS
 The relations R2 and R3 are symmetric, because in each case (b, a) belongs
to the relation whenever (a, b) does. For R2, the only thing to check is that
both (2, 1) and (1, 2) are in the relation. For R3, it is necessary to check that
both (1, 2) and (2, 1) belong to the relation, and (1, 4) and (4, 1) belong to
the relation.
Determine which of the relations are transitive.
 R4 and R5. For each of these relations, we can show that it is transitive by
verifying that if (a, b) and (b, c) belong to this relation, then (a, c) also does.
For instance, R4 is transitive, because (3, 2) and (2, 1), (4, 2) and (2, 1), (4, 3)
and (3, 1), and (4, 3) and (3, 2) are the only such sets of pairs, and (3, 1), (4,
1), and (4, 2) belong to R4. R5 is transitive because (1, 3) and (3, 4) belong to
R5 but also does (1, 4).
RELATIONS
Determining relation properties from directed graphs
 The directed graph representing a relation can be used to determine whether the
relation has various properties.
 For instance, a relation is reflexive if and only if there is a loop at every vertex of the
directed graph, so that every ordered pair of the form (x, x) occurs in the relation.
 A relation is symmetric if and only if for every edge between distinct vertices in its
digraph there is an edge in the opposite direction, so that (y, x) is in the relation
whenever (x, y) is in the relation.
 Similarly, a relation is anti-symmetric if and only if there are never two edges in
opposite directions between distinct vertices.
 Finally, a relation is transitive if and only if whenever there is an edge from a vertex
x to a vertex y and an edge from a vertex y to a vertex z, there is an edge from x to z
(completing a triangle where each side is a directed edge with the correct
direction).
RELATIONS
Closure Properties
Consider a given set A and let R be a relation on a set A. Let P be a property
of such relations, such as being reflexivity, symmetric or being transitive. A
relation with property P will be called a P-relation. The P-closure of an
arbitrary relation R on A, written P(R), is a P-relation such that
R ⊆ P(R) ⊆ S
for every P-relation S containing R.
 We will write reflexive(R), symmetric(R), and transitive(R) for the reflexive,
symmetric, and transitive closures of R.

Reflexive and Symmetric Closures

Let R be a relation on a set A. Then:


 R ∪ ∆A is the reflexive closure of R.
 R ∪ R−1 is the symmetric closure of R.
∆A = *(a, a) | a ∈ A+ is the diagonal or equality relation on A.
RELATIONS
 In other words, reflexive(R) is obtained by simply adding to R those diagonal pairs
of A × A to R which are not currently in R.
 Symmetric(R) is obtained by adding to R all pairs (b, a) whenever (a, b) belongs to
R. In other words the symmetric closure on R is obtained by adding all the pairs in
R−1 to R which are not currently in R.
Example
Consider the relation R = *(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3)+ on the set
A = *1, 2, 3, 4+.
Then reflexive(R) = R ∪ *(2, 2), (4, 4)+ and symmetric(R) = R ∪ *(4, 2), (3, 4)+

Transitive Closure

Let R be a relation on a set A with n elements.


Then transitive(R) = R ∪ R2 ∪ . . .∪ Rn
RELATIONS
Example
Consider the relation R = *(1, 2), (2, 3), (3, 3)+ on the set A = *1, 2, 3+.
Transitive(R) = R ∪ R2 ∪ R3
R2 = R ∘ R = * 1, 3 , 2, 3 , (3, 3)+
R2 is the composition of 2 R relations.
R3 = R ∘ R = * 1, 3 , 2, 3 , (3, 3)+ – composition of R2 and R
Transitive(R) = R ∪ R2 ∪ R3 = *(1, 2), 1, 3 , (2, 3), (3, 3)+

Equivalence Relations
Consider a nonempty set S. A relation R on S is an equivalence relation if R is
reflexive, symmetric, and transitive. That is, R is an equivalence relation on S
if it has the following three properties:
 For every a ∈ S, aRa.
 If aRb, then bRa.
 If aRb and bRc, then aRc.
RELATIONS
Example
Let R be the relation on the set of real numbers such that aRb if and only if
a − b is an integer. Is R an equivalence relation?
 Because a −a = 0 is an integer for all real numbers a, aRa for all real
numbers a. Hence, R is reflexive. Now suppose that aRb. Then a −b is an integer,
so b−a is also an integer. Hence, bRa. It follows that R is symmetric. If aRb and
bRc, then a −b and b−care integers.
Therefore, a −c = (a −b) + (b−c) is also an integer. Hence, aRc. Thus, R is
transitive. Consequently, R is an equivalence relation.

Equivalence Relations and Partitions

Recall
A partition P of S is a collection {Ai } of nonempty subsets of S with the
following two properties:
 Each a ∈ S belongs to some Ai .
 If Ai = Aj then Ai ∩ Aj = ∅.
RELATIONS
 Suppose R is an equivalence relation on a set S. For each a ∈ S, let [a] denote the set
of elements of S to which a is related under R; that is:
,𝑎- = *𝑥 | (𝑎, 𝑥) ∈ R+
 [a] the equivalence class of a in S; any b ∈ [a] is called a representative of the
equivalence class.
 The collection of all equivalence classes of elements of S under an equivalence
relation R is denoted by S/R, that is, S/R = *,a- | a ∈ S+. It is called the quotient
set of S by R.

Let R be an equivalence relation on a set S. Then S/R is a partition of S.


Specifically:
 For each a in S, we have a ∈ [a].
 [a] = [b] if and only if (a, b) ∈ R.
 If [a] = [b], then [a] and [b] are disjoint.
RELATIONS
Example
Consider the relation R = *(1, 1), (1, 2), (2, 1), (2, 2), (3, 3)+ on S = {1, 2, 3}. Find the
partition of S induced by R or the equivalent classes of R .
One can show that R is reflexive, symmetric, and transitive, that is, that R is an
equivalence relation.
The elements related t 1 are 1 and 2 hence [1] = {1, 2}
Pick an element that des not belong to [1] say 3. The elements related t 3 is 3
hence [3] = {3}.
S/R = {[1], [3]} is a partition of S. One can choose either {1, 3} or {2, 3} as a set of
representatives of the equivalence classes.

You might also like