0% found this document useful (0 votes)
55 views36 pages

Relations

A binary relation R from set A to set B is a subset of the Cartesian product A × B, denoted as R ⊆ A × B. The document explains various properties of relations, including reflexive, irreflexive, symmetric, antisymmetric, transitive, and asymmetric relations, along with examples and methods for combining relations. It also discusses how to determine the number of relations on a set with n elements and provides examples of specific relations and their properties.

Uploaded by

sonasonsona2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views36 pages

Relations

A binary relation R from set A to set B is a subset of the Cartesian product A × B, denoted as R ⊆ A × B. The document explains various properties of relations, including reflexive, irreflexive, symmetric, antisymmetric, transitive, and asymmetric relations, along with examples and methods for combining relations. It also discusses how to determine the number of relations on a set with n elements and provides examples of specific relations and their properties.

Uploaded by

sonasonsona2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Relations

What is a relation?
Let A and B be sets. A binary relation R from A to B is a subset of A × B.
R ⊆A× B
Where, A × B = {(a, b) | a ∈ A ∧ b ∈ B}
We use the notation aRb to denote that (a, b) ∈ R and a̸Rb to denote that (a, b) ∉ R.
When (a, b) ∈ R, a is said to be related to b by R.
Example of a relation
Example :
Let, A = {0, 1, 2} and B = {1, 2, 3}
A × B = {(0, 1), (0, 2), (0, 3), (1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3)}
Let, R be a relation where (a, b) ∈ R if and only if a ≥ b
Then, R = {(1, 1), (2, 1), (2, 2)} and R ⊆ A × B

Graphical representation of relation where arrows are used to represent the ordered pairs of relation R
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.
Example :
Let A be the set {1, 2, 3, 4}.
1. Which ordered pairs are in the relation R = {(a, b) | a divides b}?
R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.

2. Which ordered pairs are in the relation R = {(a, b) | a equals b}?


R = {(1, 1), (2, 2), (3, 3), (4, 4)}
How many relations are there on a set with
n elements?
• A relation on a set A is a subset of A × A.
• Because A × A has 𝑛! elements when A has n elements, and a set with m elements
" # !
has 2 subsets, there are 2 subsets of A×A.
!
• Thus, there are 2# relations on a set with n elements.
Properties of Relations
1. Reflexive Relation :
A relation R on a set A is called reflexive if (a, a) ∈ R for every element a ∈ A.

Note : A relation R on the set A is reflexive if ∀a((a, a) ∈ R), where the universe of discourse is the set of
all elements in A.
Example 1:
Let, A = {1, 2, 3, 4}
R1 = {(1, 1), (1, 2),(1, 4),(2, 1),(2, 2),(3, 3),(4, 1),(4, 4)}
R1 is Reflexive because it contains all the ordered pairs of the form (a, a) ∈ R for every element a ∈ A
i.e., R1 contains (1, 1), (2, 2), (3, 3), (4, 4)
Example 2:
Let, A = {1, 2, 3, 4}
R2 = {(1, 1), (1, 2),(1, 4),(2, 1),(3, 3),(4, 1),(4, 4)}
R2 is not Reflexive because it does not contain all the ordered pairs of the form (a, a) ∈ R for every
element a ∈ A i.e., (2, 2) is not present in R2
Properties of Relations
2. Irreflexive Relation :
A relation R on a set A is called irreflexive if (a, a) ∉ R for every element a ∈ A.
Or
A relation R on a set A is called irreflexive if ∀a((a, a) ∉ R).

Example 1:
Let, A = {1, 2, 3, 4}
R1 = {(1, 1), (1, 2),(1, 4),(2, 1),(3, 3),(4, 1),(4, 4)}
R1 is not irreflexive because R1 contains (1, 1), (3, 3), (4, 4)

Example 2:
Let, A = {1, 2, 3, 4}
R2 = {(1, 2),(1, 4),(2, 1),(4, 1)}
R2 is irreflexive because R2 does not contain (1, 1), (2, 2), (3, 3), (4, 4)
Properties of Relations
3. Symmetric Relation :
A relation R on a set A is called symmetric if (b, a) ∈ R whenever (a, b) ∈ R, for all a, b ∈ A.
Or
A relation R on a set A is called symmetric if ∀a∀b((a, b) ∈ R ⟶ (b, a) ∈ R)

Example 1:
Let, A = {1, 2, 3, 4}
𝑅! ={(1, 1), (1, 2), (2, 1), (2, 2)}
Relation 𝑅! is symmetric because for (1, 2) there is (2, 1)
Example 2:
Let, A = {1, 2, 3, 4}
𝑅" ={(1, 1), (1, 2), (2, 1), (1, 3), (2, 3), (3, 3)}
Relation 𝑅" is not symmetric because for (1, 3) there is no (3, 1) and for (2, 3) there is no (3, 2)
Properties of Relations
4. Antisymmetric Relation :
A relation R on the set A is antisymmetric if ∀a∀b(((a, b) ∈ R ∧ (b, a) ∈ R) ⟶ (a = b)).
In case of asymmetric relation, when a ≠ b then (a, b) ∈ R does not imply that (b, a) ∈ R

Example :
Let, A = {1, 2, 3, 4} then
The relation R ={(2, 1), (3, 1),(3, 2),(4, 1),(4, 2),(4, 3)} is antisymmetric because
(2, 1) ∈ R but (1, 2) ∉ R
(3, 1) ∈ R but (1, 3) ∉ R
(3, 2) ∈ R but (2, 3) ∉ R
(4, 1) ∈ R but (1, 4) ∉ R
(4, 2) ∈ R but (2, 4) ∉ R
(4, 3) ∈ R but (3, 4) ∉ R
Properties of Relations
5. Transitive Relation :
A relation R on a set A is called transitive if whenever (a, b) ∈ R and (b, c) ∈ R, then (a, c) ∈ R,
for all a, b, c ∈ A.
Or
A relation R on a set A is called transitive if ∀a∀b∀c(((a, b) ∈ R ∧ (b, c) ∈ R) ⟶ (a, c) ∈ R)
Example :
Let, A = {1, 2, 3, 4} then R ={(1,1),(1,2),(2,1),(2,2)} is transitive because
(1, 1) ∈ R and (1, 2) ∈ R ⟶ (1, 2) ∈ R
(1, 2) ∈ R and (2, 1) ∈ R ⟶ (1, 1) ∈ R
(1, 2) ∈ R and (2, 2) ∈ R ⟶ (1, 2) ∈ R
(2, 1) ∈ R and (1, 1) ∈ R ⟶ (2, 1) ∈ R
(2, 1) ∈ R and (1, 2) ∈ R ⟶ (2, 2) ∈ R
(2, 1) ∈ R and (1, 1) ∈ R ⟶ (2, 1) ∈ R
(2, 2) ∈ R and (2, 1) ∈ R ⟶ (2, 1) ∈ R
Properties of Relations
6. Asymmetric Relation :
A relation R on a set A is called asymmetric if ∀a∀b((a, b) ∈ R ⟶ (b, a) ∉ R)
Example 1 :
Let, A = {1, 2, 3, 4} then the relation R = {(1, 1), (1, 2), (1, 3)} is not
asymmetric because of the presence of (1, 1)

Example 2 :
Let, A = {1, 2, 3, 4} then the relation R = {(1, 2), (1, 3), (1, 4)} is asymmetric
because of the absence of (2, 1), (3, 1) and (4, 1)
• Example 1:
• Determine whether the relation R={(x, y) | xy = 0 } defined on the set of all real numbers is
reflexive, symmetric, antisymmetric or transitive?
• Solution:
• R={(x, y) | xy = 0 } is not reflexive because for any (a, a) ∈ R, a*a is not always zero
except (0, 0) ∈ R
• R={(x, y) | xy = 0 } is symmetric because for any (a, b) ∈ R, (ab = 0 ⟶ ba = 0)
• R={(x, y) | xy = 0 } is not antisymmetric because for (0, 1) ∈ R, 0*1 = 0 and for (1, 0)
∈ R, 1*0 = 0 But 0 ≠ 1
• R={(x, y) | xy = 0 } is not transitive because (1, 0) ∈ R, 1*0 = 0 and (0, 2) ∈ R, 0*2 =
0 but for (1, 2) ∈ R, 1*2 ≠ 0
• Example 2 :
Amongst the properties (reflexivity, symmetry, transitivity and antisymmetric) the relation
R = {(x, y) ∈ N"| x ≠ y} satisfies?
• Reflexive
∀a((a, a) ∈ R)
But a ≠ a
Hence, R is not reflexive
• Symmetric
∀a∀b((a, b) ∈ R ⟶ (b, a) ∈ R)
If a ≠ b then b ≠ a
Hence, R is symmetric
• Antisymmetric
∀a∀b(((a, b) ∈ R ∧ (b, a) ∈ R) ⟶ (a = b))
(a ≠ b and b ≠ a) ⟶ (a = b) is false
Hence, R is not antisymmetric
• Transitive
∀a∀b∀c(((a, b) ∈ R ∧ (b, c) ∈ R) ⟶ (a, c) ∈ R)
a ≠ b and b ≠ c not always implies that a ≠ c
Let, a =1, b = 2, c = 1
Then, a ≠ b and b ≠ c but a = c
Hence, R is not transitive
Combining Relations
Two relations 𝑅! and 𝑅" from A to B can be combined in any way two sets can be combined i.e.,
𝑅! ∪ 𝑅" , 𝑅! ∩ 𝑅" , 𝑅! − 𝑅" , 𝑅" − 𝑅! and 𝑅! ⊕ 𝑅" .
Example 1:
Let A = {1,2,3} and B = {1,2,3,4}. The relations 𝑅! = {(1,1), (2,2), (3,3)} and 𝑅" = {(1, 1), (1, 2),
(1, 3), (1, 4)} are from set A to B, then
• 𝑅! ∪ 𝑅" ={(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)}
• 𝑅! ∩ 𝑅" = {(1, 1)}
• 𝑅! − 𝑅" = {(2, 2), (3, 3)}
• 𝑅" − 𝑅! = {(1, 2), (1, 3), (1, 4)}
• 𝑅! ⊕ 𝑅" = {(2, 2), (3, 3), (1, 2), (1, 3), (1, 4)}
Combining Relations
Example 2:
Let, 𝑅! and 𝑅" be two relations on the set A and both 𝑅! and 𝑅" are reflexive relations. Show that
1. 𝑅! ∪ 𝑅" is reflexive
2. 𝑅! ∩ 𝑅" is reflexive
3. 𝑅! − 𝑅" is irreflexive
4. 𝑅! ⊕ 𝑅" is irreflexive
1. 𝑅! ∪ 𝑅" is reflexive
So, ∀a ∈ A ((a, a) ∈ 𝑅! ) and ∀a ∈ A ((a, a) ∈ 𝑅" )
𝑅! ∪ 𝑅" = {(a, a) |(a, a) ∈ 𝑅! ∨ (a, a) ∈ 𝑅" }
∀a ∈ A ((a, a) ∈( 𝑅! ∪ 𝑅" ))
So, 𝑹𝟏 ∪ 𝑹𝟐 is reflexive
2. 𝑅! ∩ 𝑅" is reflexive
So, ∀a ∈ A ((a, a) ∈ 𝑅! ) and ∀a ∈ A ((a, a) ∈ 𝑅" )
𝑅! ∩ 𝑅" = {(a, a) |(a, a) ∈ 𝑅! ∧ (a, a) ∈ 𝑅" }
∀a ∈ A ((a, a) ∈( 𝑅! ∩ 𝑅" ))
So, 𝑹𝟏 ∩ 𝑹𝟐 is reflexive

3. 𝑅! − 𝑅" is irreflexive
So, ∀a ∈ A ((a, a) ∈ 𝑅! ) and ∀a ∈ A ((a, a) ∈ 𝑅" )
𝑅! − 𝑅" = {(a, a) |(a, a) ∈ 𝑅! ∧ (a, a) ∉ 𝑅" }
∀a ∈ A ((a, a) ∉ 𝑅! − 𝑅" )
So, 𝑹𝟏 − 𝑹𝟐 is irreflexive

4. 𝑅! ⊕ 𝑅" is irreflexive
So, ∀a ∈ A ((a, a) ∈ 𝑅! ) and ∀a ∈ A ((a, a) ∈ 𝑅" )
𝑅! ⊕ 𝑅" = {(a, a) |(a, a) ∉ 𝑅! ∩ 𝑅" }
As 𝑅! ∩ 𝑅" is reflexive
So, 𝑹𝟏 ⊕ 𝑹𝟐 is irreflexive
Composition of Relations
Let R be a relation from a set A to a set B and S a relation from B to a set C. The composition of R
and S is the relation consisting of ordered pairs (a, c), where a ∈ A, c ∈ C, and for which there exists
an element b ∈ B such that (a, b) ∈ R and (b, c) ∈ S. We denote the composition of R and S by S◦R.
Example :
What is the composition of the relations R and S, where R is the relation from A = {1, 2, 3} to
B = {1, 2, 3, 4} with R = {(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)} and S is the relation from B = {1,
2, 3, 4} to C = {0, 1, 2} with S = {(1, 0), (2, 0), (3, 1), (3, 2), (4, 1)}?

S ◦R = {(1, 0), (1, 1), (2, 1), (2, 2), (3, 0), (3, 1)}
Algorithm for Composition of relation
Input : Relations R and S from sets A and B and B and C respectively
Output : Composition of R and S i.e., S◦R
BEGIN
For (a, b) ∈ R do
For (c, d) ∈ S do
If (b == c), then
Set (a, d) ∈ S◦R
End if
End for
End For
END
Composition of Relation with itself
The composition of a relation R with itself consisting of ordered pairs (a, c), where (a, b) ∈ R and (b, c) ∈ R.
We denote the composition of R with itself by R◦R.
Example :
Let R = {(1, 1), (2, 1), (3, 2), (4, 3)} then
R = {(1, 1), (2, 1), (3, 2), (4, 3)}
R◦R = {(1, 1), (2, 1), (3, 1), (4, 2)}
Powers of R
Let R be a relation on the set A. The powers R! ,n = 1,2,3,..., are defined recursively by R" = R and R!#" =R! ◦R.
Hence, R" = R
R$ = R" ◦R = R◦R
R% = R$ ◦R = (R◦R)◦R
R& = R% ◦R = ((R◦R)◦R)◦R
.
.
R!#" = ((((R◦R)◦R)◦R) ◦…….◦R)◦R

Example :
Let R = {(1, 1), (2, 1), (3, 2), (4, 3)}. Find the powers R! , n = 2, 3, 4…..
R$ = R" ◦R = R◦R = {(1, 1), (2, 1), (3, 1), (4, 2)}
R% = R$ ◦R = {(1, 1), (2, 1), (3, 1), (4, 1)}
R& = R% ◦R = {(1, 1), (2, 1), (3, 1), (4, 1)}
Representing Relations
Suppose that A = {1, 2, 3} and B = {1, 2}. Let R be the relation from A to B containing (a, b) if a ∈ A, b ∈ B,
and a > b.
1. Listing Method :
• R = {(2, 1), (3, 1), (3, 2)}
2. Set Builder Method :
• R = {(a, b) | a ∈ A ∧ b ∈ B ∧ a > b }
3. Statement Representation :
• ∀a ∈ A ∀b ∈ B, aRb iff a > b
4. Matrix Representation :
• A relation between finite sets can be represented using a zero–one matrix. Suppose that R is a
relation from 𝐴 = 𝑎! , 𝑎" , … , 𝑎% to 𝐵 = 𝑏! , 𝑏" , … , 𝑏& . The relation R can be represented by the
matrix 𝑀' , where
1 𝑖𝑓 (𝑎( , 𝑏) ) ∈ 𝑅
𝑀' [𝑖, 𝑗] = E
0 𝑖𝑓 (𝑎( , 𝑏) ) ∉ 𝑅

0 0
𝑀' = 1 0
1 1
Representing Relations
5. Directed Graph Representation :
Each element of set A is represented by a point or node, and each ordered pair (a, b) is
represented using an edge directed from a to b.
Example :
R = {(1, 1), (1, 3), (2, 1), (2, 3), (2, 4), (3, 1), (3, 2), (4, 1)} on the set A = {1, 2, 3, 4}
Matrix Representation
The matrix of a relation on a set, which is a square matrix, can be used to determine whether the
relation has certain properties like reflexivity, symmetry, antisymmetric.
i. R is reflexive if and only if 𝑀% [𝑖, 𝑖] = 1, for 𝑖 = 1, 2, … , 𝑛. In other words, R is reflexive if
all the elements on the main diagonal of 𝑀% are equal to 1
Example :
Let, R be a relation on the set A = {1, 2, 3, 4} and
R ={(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)}

1 1 0 1
1 1 0 0
𝑀% =
0 0 1 0
1 0 0 1
As all the diagonal elements of 𝑀% are equal to 1, hence, R is reflexive.
Matrix Representation
ii. R is symmetric if and only if 𝑀' [𝑖, 𝑗] = 𝑀' [𝑗, 𝑖], for all pairs of integers 𝑖 and 𝑗 with 𝑖 = 1, 2, … , 𝑛 and 𝑗 =
1, 2, … , 𝑛. In other words, R is symmetric if and only if 𝑀' = [𝑀' ]* .
Example :
Let, R be a relation on the set A = {1, 2, 3, 4} and
R ={(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)}

1 1 0 1
1 1 0 0
𝑀' =
0 0 1 0
1 0 0 1
R is symmetric because 𝑀' = [𝑀' ]*
iii. R is antisymmetric if either 𝑀' [𝑖, 𝑗] = 0 or 𝑀' [𝑗, 𝑖] = 0 when 𝑖 ≠ 𝑗.
Example :
Let, R be a relation on the set A = {1, 2, 3, 4} and
R = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)}

0 0 0 0
1 0 0 0
𝑀' =
1 1 0 0
1 1 1 0
R is antisymmetric
Combining Relations Using Matrix Form of
Relations
Suppose that 𝑅! and 𝑅" are relations on a set A represented by the matrices 𝑀%! and 𝑀%"
respectively. The union and the intersection of the relations 𝑅! and 𝑅" are relations in the
form of matrices. Let the union and intersection of the relations 𝑅! and 𝑅" are represented by
a matrix 𝑀%! ∪%" and 𝑀%! ∩%" .

1 𝑖𝑓 𝑀%! 𝑖, 𝑗 = 1 ⋁ 𝑀%" 𝑖, 𝑗 = 1
• 𝑀%! ∪%" [𝑖, 𝑗] = ;
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

1 𝑖𝑓 𝑀%! 𝑖, 𝑗 = 1 ∧ 𝑀%" 𝑖, 𝑗 = 1
• 𝑀%! ∩ %" [𝑖, 𝑗] = ;
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Combining Relations Using Matrix Form
of Relations
Example :
Let the relations 𝑅! =={(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)} and
𝑅" ={(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)} are relations on a set A = {1, 2, 3, 4}
represented by the matrices
1 1 0 1 0 0 0 0
1 1 0 0 1 0 0 0
𝑀%! = and 𝑀%! =
0 0 1 0 1 1 0 0
1 0 0 1 1 1 1 0

1 1 0 1
1 1 0 0
𝑀%!∪%" =
1 1 1 0
1 1 1 1

0 0 0 0
1 0 0 0
𝑀%!∩ %" =
0 0 0 0
1 0 0 0
Determination of matrix of composition of
relation
R : relation from set A to set B
S : relation from set B to C
|A| = m, |B| = n, |C| = p
𝑀' : matrix representation of R and it has a dimension of m x n
𝑀+ : matrix representation of S and it has a dimension of n x p
𝑀, ∘. : matrix representation of S ∘ R and it has a dimension of m x p
Now, 𝑀, ∘. 𝑖, 𝑗 = 1 if and only if 𝑀' 𝑖, 𝑘 = 1 and 𝑀+ 𝑘, 𝑗 = 1 for 𝑘 = 1, 2, … , 𝑛
Example :
1 0 0
1 0 0 1
1 0 0
𝑀' = 0 0 1 0 and 𝑀+ =
0 1 1
1 0 0 1
1 0 0

1 0 0
𝑀, ∘. = 0 1 1
1 0 0
Closures of Relations
If there is a relation R on a set A, then closure of the relation R with property P is a relation S on the
set A with the property P such that S is the smallest possible relation which contains R.
Reflexive Closure :
Reflexive closure of a binary relation R on a set A is the smallest reflexive relation of the set A
that contains R.
Reflexive closure of R is denoted by 𝑅() .
𝑅() = R ∪ {(a, a) | a ∈ A}

Example 1:
Let, there is a relation R = {(1, 1), (1, 2), (2, 1), (3, 2)} defined on the set A = {1, 2, 3}.
R is not reflexive as (2, 2) ∉ R and (3, 3) ∉ R.

How can we produce a reflexive relation containing R that is as small as possible?


To make R as reflexive relation (2, 2) and (3, 3) must be added to R.
The reflexive closure of R is denoted by 𝑅/0
𝑅/0 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 2), (3, 3)}
Example 2 :
What is the reflexive closure of the relation R = {(a, b) | a < b} on the set of integers?
Here R = {(a, b) | a < b}
𝑅() = R ∪ {(a, a) | a ∈ A}
𝑅() = {(a, b) | a < b} ∪ {(a, a) | a ∈ A}
𝑅() = {(a, b) | a < b} ∪ {(a, b) | a = b}
𝑅() = {(a, b) | a ≤ b}

Example 2
What is the reflexive closure of the relation R = {(a, b) | a ≠ b} on the set of integers?
Here R = {(a, b) | a ≠ b}
𝑅() = R ∪ {(a, a) | a ∈ A}
𝑅() = {(a, b) | a ≠ b} ∪ {(a, a) | a ∈ A}
𝑅() = {(a, b) | a ≠ b } ∪ {(a, b) | a = b}
This means that 𝑅() contains all the ordered pairs (a, b) such that a ∈ Z and b ∈ Z
𝑅() = {(a, b) | a, b ∈ Z} = Z x Z
Closures of Relations
Symmetric Closure :
Symmetric closure of a binary relation R on a set A is the smallest symmetric relation of the
set A that contains R.
Symmetric closure of R is denoted by 𝑅*) .
𝑅*) = R ∪ {(b, a) | (a, b) ∈ R}
Example :
Let, there is a relation R = {(1, 1), (1, 2), (2, 1), (3, 1), (3, 2)} defined on the set A =
{1, 2, 3}.
R is not symmetric as (1, 3) ∉ R for (3, 1) ∈ R and (2, 3) ∉ R for (3, 2) ∈ R.
𝑅*) = {(1, 1), (1, 2), (2, 1), (3, 1), (3, 2), (1, 3), (2, 3)}
Closures of Relations
Transitive Closure :
Transitive closure of a binary relation R on a set A is the smallest transitive relation of the set A
that contains R.
Transitive closure of R is denoted by 𝑅+) .
𝑅+) = R ∪ {(a, c) | (a, b) ∈ R ∧ (b, c) ∈ R }

Example :
Finding transitive closure is not that simple.
Let, A = {1, 2, 3, 4}
R = {(1, 3), (1, 4), (2, 1), (3, 2)}
𝑅+) = {(1, 3), (1, 4), (2, 1), (3, 2)} ∪ {(1, 2), (2, 3), (2, 4), (3, 1)}
𝑅+) = {(1, 3), (1, 4), (2, 1), (3, 2), (1, 2), (2, 3), (2, 4), (3, 1)}
But, 𝑅+) is not transitive because (2, 3) ∈ R and (3, 2) ∈ R, but (2, 2)
𝑅+)) ={(1, 3), (1, 4), (2, 1), (3, 2), (1, 2), (2, 3), (2, 4), (3, 1)} ∪ {(1, 1), (3, 3), (2, 2), (3, 4)}
𝑅+)) ={(1, 3), (1, 4), (2, 1), (3, 2), (1, 2), (2, 3), (2, 4), (3, 1), (1, 1), (3, 3), (2, 2), (3, 4)}
Now, 𝑅+)) is transitive.
Finding Transitive Closure of a Relation
Theorem : (𝑎, , 𝑎- ) ∈ R. , iff there exists some path of length n from 𝑎, to 𝑎- in the directed
graph of R

Connectivity Relationship:
Let, R be a relation over the set A = {𝑎! , 𝑎" , … , 𝑎/ }
R∗ = R ∪ R! ∪ R" ∪…∪ R.
Where R∗ is called Connectivity Relationship.
• (𝑎, , 𝑎- ) ∈ R∗ , if there exists some path from 𝑎, to 𝑎- in the directed graph of R
• The maximum path length can be n (path has distinct edges).
Theorem : Transitive closure of R = R∗
Significance of Connectivity Relationship :
(𝑎, , 𝑎- ) ∈ R∗ ⟹ 𝑎- is reachable from 𝑎, by some path.
Example :
Let, A : set of all computers in a university
(𝑎, , 𝑎- ) ∈ 𝑅 : a direct link between computer 𝑎, and computer 𝑎-
R∗ : all pairs of inter-connected computers
(𝑎, , 𝑎- ) ∈ R∗ : computer 𝑎, is connected to computer 𝑎- by some intermediate
computers i.e., there exists a path between 𝑎, and 𝑎-

Example of friend suggestions in Facebook :


A : Set of all Facebook users.
(𝑎, , 𝑎- ) ∈ 𝑅 : 𝑎, and 𝑎- are mutual friend
To compute new friend suggestions, compute R∗
(𝑎, , 𝑎- ) ∈ R∗ : there exist an indirect connection between 𝑎, and 𝑎-
Algorithm for finding 𝐑∗
Naïve Algorithm for computing 𝑴𝐑∗ form 𝑴𝑹 :
Input : 𝑀'
Output : 𝑀.∗
BEGIN
For 𝑖 = 2, 3, … , 𝑛 do
𝑀'( = 𝑀' ⨀𝑀'()* // Boolean matrix multiplication
End For
For 𝑖, 𝑗 = 1, 2, 3, … , 𝑛:
𝑀'∗ [𝑖, 𝑗] = 𝑀' 𝑖, 𝑗 ⋁ 𝑀'+ [𝑖, 𝑗] ⋁… ⋁ 𝑀', [𝑖, 𝑗]
End For
Return 𝑀.∗
END

Example :
Let, A = {1, 2, 3, 4}
R = {(1, 3), (1, 4), (2, 1), (3, 2)}
0 0 1 1
1 0 0 0
𝑀- =
0 1 0 0
0 0 0 0
0 0 1 1 0 0 1 1 0 1 0 0
1 0 0 0 1 0 0 0 0 0 1 1
𝑀- ! = 𝑀- ⨀𝑀- = ⨀ =
0 1 0 0 0 1 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 0 1 0 0 1 0 0 0
1 0 0 0 0 0 1 1 0 1 0 0
𝑀- " = 𝑀- ⨀𝑀- ! = ⨀ =
0 1 0 0 1 0 0 0 0 0 1 1
0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 1 0 0 0 0 0 1 0
1 0 0 0 0 1 0 0 1 0 0 0
𝑀- # = 𝑀- ⨀𝑀- " = ⨀ =
0 1 0 0 0 0 1 1 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 0 1 0 0 1 0 0 0 0 0 1 0
1 0 0 0 0 0 1 1 0 1 0 0 1 0 0 0
𝑀- ∗ = ⋁ ⋁ ⋁
0 1 0 0 1 0 0 0 0 0 1 1 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1
1 1 1 1
𝑀- ∗ =
1 1 1 1
0 0 0 0
Equivalence Relations
A relation R on a set A is called an equivalence relation if it is reflexive, symmetric, and
transitive.
Example 1:
Let, R be a relation defined on the set A = {1, 2, 3, 4} and R = {(1, 1), (2, 2), (3, 3), (4, 4)}.
Determine whether R is equivalence relation or not ?
Sol:
As R is reflexive, symmetric and transitive, hence R is an equivalence relation.
Example 2:
Let, R be a relation defined on the set A = {0, 1, 2, 3} and R = {(0, 0), (0, 2), (2, 0), (2, 2), (2,
3), (3, 2), (3, 3)}. Determine whether R is equivalence relation or not ?
Sol:
As (1, 1) ∉ R, hence R is not reflexive. So, R is not equivalence relation.

Example 3 :
Let, R be a relation defined on the set A = {0, 1, 2, 3} and R = {(0, 0), (1, 1), (1, 2), (2, 1), (2,
2), (3, 3)}. Determine whether R is equivalence relation or not ?
Sol:
As R is reflexive, symmetric and transitive, hence R is an equivalence relation.
Example 4 :
Let us assume that R is a relation on the set of integers defined by aRb if and only if a – b is an integer. Show that R is an
equivalence relation.
To show R is an equivalence relation we have to show that R is reflexive, symmetric and transitive.
Reflexivity : ∀a∈ A ((a, a) ∈ R)
(a, a) ∈ R means a – a = 0 which is an integer.
Hence, R is reflexive.
Symmetry : ∀a∀b∈ A ((a, b) ∈ R ⟶ (b, a) ∈ R)
(a, b) ∈ R means that a – b is an integer.
We know that a – b is an integer.
b – a = – ( a – b) is also an integer.
Hence, (b, a) ∈ R
Hence, R is symmetric.
Transitivity : ∀a∀b∀c∈ A (((a, b) ∈ R ∧ (b, c) ∈ R) ⟶ (a, c) ∈ R)
(a, b) ∈ R means that a – b is an integer.
(b, c) ∈ R means that b – c is an integer.
(a – b) + (b – c) is an integer as sum of two integers is integer.
(a – b) + (b – c) = a – c
Therefore, a – c is an integer.
Hence, (a, c) ∈ R
Therefore, R is transitive.
Hence, R is an equivalence relation.

You might also like