Relations Lecture Notes
Relations Lecture Notes
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
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).
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
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
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
Transitive Closure
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.
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.