Relations - Chapter 1 - Unit 3
Relations - Chapter 1 - Unit 3
CHAPTER 1 – Unit 3
RELATIONS
CONTENT
❖ Definition
❖ Binary relation
❖ Representation
❖ Domain
❖ Range
❖ Universal relation
❖ Void relation
❖ Union, Intersection and Complement operations on relations
❖ Properties of Binary relations in a set: Reflexive, Symmetric, Transitive, Anti-
symmetric relations
❖ Relation matrix
❖ Graph of a relation
❖ Partition and covering of a set
❖ Equivalence relation
❖ Equivalence classes
❖ Compatibility Relation
❖ Maximum compatibility block
❖ Composite relation
❖ Converse of a relation
❖ Transitive closure of a relation 𝑅 in set 𝑋
Try Yourself
Let 𝑅 be the relation on set 𝐴 = {2, 3} defined as 𝑥𝑅𝑦 if 𝑥 ≥ 𝑦. Then, write all possible
elements (ordered pairs) of 𝑅.
Try Yourself
Let 𝑅 be the relation on set 𝐴 = {1, 2} defined as 𝑎𝑅𝑏 if 𝑎 < 𝑏. Then, write all possible
elements (ordered pairs) of 𝑅.
Question (DEC 2021 – 04 Marks)
Let 𝐿 denotes the relation “less than or equal to” and 𝐷 denotes the relation “divides”. Where
𝑥𝐷𝑦 means “𝑥 divides 𝑦”. Both 𝐿 and 𝐷 are defined on the set {1, 2, 3, 6}. Write 𝐿 and 𝐷 as
sets, find 𝐿 ∩ 𝐷.
Answer
Let 𝐿 be the relation “less than or equal to” defined on the set {1, 2, 3, 6}. Write 𝐿 as a set.
1 = 1. So, (1,1) ∈ 𝐿. 1 < 2. So, (1,2) ∈ 𝐿.
1 < 3. So, (1,3) ∈ 𝐿. 1 < 6. So, (1,6) ∈ 𝐿.
2 = 2. So, (2,2) ∈ 𝐿. 2 < 3. So, (2,3) ∈ 𝐿.
2 < 6. So, (2,6) ∈ 𝐿. 3 = 3. So, (3,3) ∈ 𝐿.
3 < 6. So, (3,6) ∈ 𝐿. 6 = 6. So, (6,6) ∈ 𝐿.
Hence, 𝐿 = {(1,1), (1,2), (1,3), (1,6), (2,2), (2,3), (2,6), (3,3), (3,6), (6,6)}
Let 𝐷 be the relation “divides” defined on the set {1, 2, 3, 6}. Write 𝐷 as a set.
Since 1 divides every number, we have (1,1) ∈ 𝐷 , (1,2) ∈ 𝐷 , (1,3) ∈ 𝐷 and (1,6) ∈ 𝐷.
Since 2 divides 2, we have (2,2) ∈ 𝐷.
Since 2 divides 6, we have (2,6) ∈ 𝐷.
Since 3 divides 3, we have (3,3) ∈ 𝐷.
Since 3 divides 6, we have (3,6) ∈ 𝐷.
Since 6 divides 6, we have (6,6) ∈ 𝐷.
Hence, 𝐷 = {(1,1), (1,2), (1,3), (1,6), (2,2), (2,6), (3,3), (3,6), (6,6)}
Now find the intersection of sets 𝐿 and 𝐷. That is, find the ordered pairs which are common
to both sets.
𝐿 ∩ 𝐷 = {(1,1), (1,2), (1,3), (1,6), (2,2), (2,6), (3,3), (3,6), (6,6)} = 𝐷
Important note
𝑥 divides 𝑦 if 𝑦/𝑥 is an integer. For example, 2 divides 3 is NOT true because 3/2 = 1.5
and note that 1.5 is not an integer. For example, 2 divides 6 is true because 6/2 = 3 and
note that 3 is an integer.
Domain of a relation
The domain of a relation 𝑅 is the set of all the first element of the ordered pairs which are
present in 𝑅. It is denoted by 𝐷(𝑅) or 𝐷𝑜𝑚(𝑅).
𝐷(𝑅) = { 𝑥 ∶ (𝑥, 𝑦) ∈ 𝑅}
Range of a relation
The range of a relation 𝑅 is the set of all the second element of the ordered pairs which are
present in 𝑅. It is denoted by 𝑅(𝑅) or 𝑟𝑎𝑛𝑔𝑒(𝑅).
𝑟𝑎𝑛𝑔𝑒(𝑅) = { 𝑦 ∶ (𝑥, 𝑦) ∈ 𝑅}
For example,
1) Let 𝑅 = {(1,1), (1,3), (2,1), (2,3), (4,3), (4,4)} be the relation on 𝐴 = {1, 2, 3, 4}.
Observe the first element of each ordered pair. We have 1, 2, 4 as first element.
Hence, the domain of 𝑅 is given by 𝐷(𝑅) = {1, 2, 4}.
Observe the second element of each ordered pair. We have 1, 3, 4 as second element.
Hence, the range of 𝑅 is given by 𝑟𝑎𝑛𝑔𝑒(𝑅) = {1, 3, 4}.
Universal relation
• The union of two relations 𝑅 and 𝑆 can be defined as the set containing all ordered
pairs (𝑥, 𝑦) that are either present in relation 𝑅 or in relation 𝑆, or in both. It is denoted
by 𝑅 ∪ 𝑆.
For example,
• The intersection of two relations 𝑅 and 𝑆 can be defined as the set containing all
ordered pairs (𝑥, 𝑦) that are common to both relations. It is denoted by 𝑅 ∩ 𝑆.
For example,
• The complement of a relation 𝑅 is the set of all ordered pairs that are present in universal
relation but not in relation 𝑅. It is denoted by 𝑅 ′ or 𝑅 𝑐 .
For example,
Let 𝑅 be the relation from 𝐴 to 𝐵 where 𝑅 = {(1,5), (2,4), (2,6), (3,5), (3,6)}.
Then, the complement of 𝑅 is given by 𝑅 ′ = {(1,4), (1,6), (2,5), (3,4)}.
• Symmetric
The relation 𝑅 defined on set 𝐴 is called symmetric relation if ordered pair (𝑦, 𝑥) in 𝑅
for every ordered pair (𝑥, 𝑦) in 𝑅. In other words, the relation is symmetric if 𝑦 is related
to 𝑥 for every 𝑥 related to 𝑦. In other words, the relation is symmetric if 𝑦𝑅𝑥 for every
𝑥𝑅𝑦.
For example,
Let 𝑅 be the relation defined on set 𝐴 = {1, 2, 3} where
𝑅 = {(1,2), (1,3), (2,1), (2,2), (3,1), (3,3)}.
For (1,2) in 𝑅, the ordered pair (2,1) is also present in 𝑅.
For (1,3) in 𝑅, the ordered pair (3,1) is also present in 𝑅.
Since for every pair (𝑥, 𝑦) in 𝑅, the ordered pair (𝑦, 𝑥) is also present in 𝑅, the relation
𝑅 is symmetric.
For example,
Let 𝑅 be the relation defined on set 𝐴 = {𝑥, 𝑦, 𝑧} where
𝑅 = {(𝑥, 𝑥), (𝑥, 𝑦), (𝑦, 𝑥), (𝑦, 𝑦), (𝑧, 𝑦), (𝑧, 𝑧)}.
For (𝑧, 𝑦) in 𝑅, the ordered pair (𝑦, 𝑧) is NOT present in 𝑅.
Hence, the relation 𝑅 is NOT symmetric.
• Transitive
The relation 𝑅 defined on set 𝐴 is called transitive relation if ordered pair (𝒙, 𝑦) in 𝑅
and (𝑦, 𝒛) in 𝑅 then the ordered pair (𝒙, 𝒛) is also present in 𝑅. In other words, the
relation is transitive if 𝒙 is related to 𝑦 and 𝑦 is related to 𝒛 then 𝒙 must be related to 𝒛.
In other words, the relation is transitive if 𝑥𝑅𝑧 for every 𝑥𝑅𝑦 and 𝑦𝑅𝑧.
For example,
Let 𝑅 be the relation defined on set 𝐴 = {1, 2, 3} where
𝑅 = {(1,2), (1,3), (2,2), (2,3), (3,2), (3,3)}.
Let (𝒙, 𝑦) = (𝟏, 2) ∈ 𝑅 and (𝑦, 𝒛) = (2, 𝟑) ∈ 𝑅. Then, (𝑥, 𝑧) = (𝟏, 𝟑) is also in 𝑅.
Let (𝟏, 3) ∈ 𝑅 and (3, 𝟐) ∈ 𝑅. Then, new ordered pair (𝟏, 𝟐) is also in 𝑅.
Let (𝟐, 3) ∈ 𝑅 and (3, 𝟐) ∈ 𝑅. Then, new ordered pair (𝟐, 𝟐) is also in 𝑅.
Let (𝟑, 2) ∈ 𝑅 and (2, 𝟑) ∈ 𝑅. Then, new ordered pair (𝟑, 𝟑) is also in 𝑅.
Since all new ordered pairs belong to 𝑅, the relation 𝑅 is transitive.
For example,
Let 𝑅 be the relation defined on set 𝐴 = {𝑑, 𝑒, 𝑓} where
𝑅 = {(𝑑, 𝑑), (𝑑, 𝑒), (𝑒, 𝑒), (𝑒, 𝑓), (𝑓, 𝑓)}.
Let (𝒅, 𝑒) ∈ 𝑅 and (𝑒, 𝒇) ∈ 𝑅. But, new ordered pair (𝒅, 𝒇) is NOT in 𝑅.
Since new ordered pair is NOT present in 𝑅, the relation 𝑅 is NOT transitive.
• Anti-symmetric
The relation 𝑅 defined on set 𝐴 is called anti-symmetric relation if ordered pair (𝑥, 𝑦)
in 𝑅 and ordered pair (𝑦, 𝑥) in 𝑅 then 𝑥 = 𝑦. In other words, the relation 𝑅 is
anti-symmetric if ordered pair (𝑦, 𝑥) is NOT present in 𝑅 for every (𝑥, 𝑦) present in 𝑅.
For example,
Let 𝑅 be the relation defined on set 𝐴 = {2, 4, 6} where
𝑅 = {(2,2), (2,6), (4,2), (4,4), (6,4)}.
Let (2,6) ∈ 𝑅. But, (6,2) ∉ 𝑅.
Let (4,2) ∈ 𝑅. But, (2,4) ∉ 𝑅.
Let (6,4) ∈ 𝑅. But, (4,6) ∉ 𝑅.
Since (𝑦, 𝑥) ∉ 𝑅 for every (𝑥, 𝑦) ∈ 𝑅, the relation 𝑅 is anti-symmetric.
For example,
Let 𝑅 be the relation defined on set 𝐴 = {1, 3, 5} where
𝑅 = {(1,1), (1,3), (3,1), (3,5), (5,5)}.
Let (1,3) ∈ 𝑅. Then, (3,1) is also present in 𝑅.
Hence, the relation 𝑅 is NOT anti-symmetric.
Let (3,5) ∈ 𝑅. But, (5,3) ∉ 𝑅.
Hence, the relation 𝑅 is NOT symmetric.
• Irreflexive
The relation 𝑅 defined on set 𝐴 is called irreflexive relation if for every element 𝑥 in 𝐴,
the ordered pair (𝑥, 𝑥) is not present in 𝑅. In other words, the relation is irreflexive if
every element 𝑥 of set is NOT related to itself.
For example,
Let 𝑅 be the relation defined on set 𝐴 = {1, 2, 3} where
𝑅 = {(1,2), (1,3), (2,1), (2, 3), (3,1), (3,2)}.
Note that (1,1) ∉ 𝑅 where 1 ∈ 𝐴.
Also, (2,2) ∉ 𝑅 where 2 ∈ 𝐴.
Also, (3,3) ∉ 𝑅 where 3 ∈ 𝐴.
Since (1,1) ∉ 𝑅 , (2,2) ∉ 𝑅 and (3,3) ∉ 𝑅, the relation 𝑅 is irreflexive.
For example,
Let 𝑅 be the relation defined on set 𝐴 = {1, 2, 3} where
𝑅 = {(1,1), (1,3), (2,1), (2,3), (3,1), (3,3)}.
Note that (1, 1) ∈ 𝑅 where 1 ∈ 𝐴. Hence, the relation 𝑅 is NOT irreflexive.
Note that (2, 2) ∉ 𝑅 where 2 ∈ 𝐴. Hence, the relation 𝑅 is NOT reflexive.
Important points
1) The relation is symmetric if (𝑦, 𝑥) ∈ 𝑅 for every (𝑥, 𝑦) ∈ 𝑅.
2) The relation is anti-symmetric if (𝑦, 𝑥) ∉ 𝑅 for every (𝑥, 𝑦) ∈ 𝑅.
Equivalence relation
Here (2, 1) ∈ 𝑅 but (1, 2) ∉ 𝑅. Hence, the given relation is NOT symmetric. Therefore, the
given relation is NOT equivalence relation.
Important note
In above example, 𝑥 is divisible by 𝑦 if 𝑥/𝑦 is an integer. For example, 3 is divisible by 6 is
NOT true because 3/6 = 0.5 and note that 0.5 is not an integer. For example, 6 is divisible by
3 is true because 6/3 = 2 and note that 2 is an integer.
Since the given relation is reflexive, symmetric and transitive, it is an equivalence relation on
the given set 𝐼.
Let 𝐴 be the set with 𝑚 elements and 𝐵 be the set with 𝑛 elements. Let 𝑅 be the relation from
𝐴 to 𝐵. Then, the relation matrix is denoted by 𝑀𝑅 and the order of matrix is 𝑚 × 𝑛.
For example,
1) Let us consider 𝐴 = {1, 2, 3} and 𝐵 = {𝑎, 𝑏, 𝑐}. Let 𝑅 be the relation from 𝐴 to 𝐵
where
Answer
From the given matrix 𝑀𝑅2 , we have 𝑅2 = {(𝑎, 𝑎), (𝑎, 𝑐), (𝑏, 𝑏), (𝑏, 𝑐), (𝑐, 𝑎)}.
The union of two relations 𝑅1 and 𝑅2 can be defined as the set containing all ordered pairs
(𝑥, 𝑦) that are either present in relation 𝑅1 or in relation 𝑅2 , or in both. Hence,
𝑅1 ∪ 𝑅2 = {(𝑎, 𝑎), (𝑎, 𝑐), (𝑏, 𝑎), (𝑏, 𝑏), (𝑏, 𝑐), (𝑐, 𝑎), (𝑐, 𝑏)}
1) Let 𝐴 = {2, 4, 6} and 𝐵 = {4, 6, 8} be two given sets. Let 𝑅 be the relation from 𝐴 to
𝐵 where 𝑅 = {(2,4), (2,6), (2,8), (4,4), (4,8), (6,6)}. Then, the digraph of a relation
𝑅 is given by
Explanation
Since (2,4) ∈ 𝑅, there is directed edge from a vertex 2 to a vertex 4.
Since (2,6) ∈ 𝑅, there is directed edge from 2 to 6.
Since (2,8) ∈ 𝑅, there is directed edge from 2 to 8.
Since (4,4) ∈ 𝑅, there is a loop (or self-loop) at vertex 4.
Since (4,8) ∈ 𝑅, there is directed edge from 4 to 8.
Since (6,6) ∈ 𝑅, there is a loop (or self-loop) at vertex 6.
2) Let 𝐴 = {𝑎, 𝑏, 𝑐} be the given set. Let 𝑅 be the relation from 𝐴 to 𝐴 where
𝑅 = {(𝑎, 𝑎), (𝑎, 𝑏), (𝑏, 𝑎), (𝑏, 𝑏), (𝑏, 𝑐), (𝑐, 𝑎), (𝑐, 𝑐)}. Then, the digraph of a relation
𝑅 is given by
Answer
Given that 𝑥𝑅𝑦 if 𝑥 > 𝑦. That is, 𝑥 is related to 𝑦 if 𝑥 is strictly greater than 𝑦 where 𝑥 is first
element and 𝑦 is second element of ordered pair.
0 0 0 0
𝟏 0 0 0
𝑴𝑹 = [ ]
𝟏 𝟏 0 0
𝟏 𝟏 𝟏 0
The graph of 𝑅 is given by
Since the given relation is reflexive, symmetric and transitive, it is an equivalence relation on
the given set 𝑋.
Answer
Method 1
1) Since there is a loop (or self-loop) at every vertex, the relation is reflexive.
2) Note that there is directed edge from 𝑎 to 𝑏. Also, there is directed edge from 𝑏 to 𝑎.
Note that there is directed edge from 𝑏 to 𝑐. Also, there is directed edge from 𝑐 to 𝑏.
Note that there is directed edge from 𝑐 to 𝑑. Also, there is directed edge from 𝑑 to 𝑐.
Note that there is directed edge from 𝑑 to 𝑎. Also, there is directed edge from 𝑎 to 𝑑.
Hence, the relation is symmetric.
3) Note that there is directed edge from 𝑎 to 𝑏 and from 𝑏 to 𝑐 but there is no directed
edge from 𝑎 to 𝑐. Hence, the relation is NOT transitive.
Since the relation is NOT transitive, it is NOT an equivalence relation.
Method 2
Here the relation is defined on the set {𝑎, 𝑏, 𝑐, 𝑑}. Write all ordered pairs of relation 𝑅 from
the given directed graph.
𝑅 = {(𝑎, 𝑎), (𝑎, 𝑏), (𝑎, 𝑑), (𝑏, 𝑎), (𝑏, 𝑏), (𝑏, 𝑐), (𝑐, 𝑏), (𝑐, 𝑐), (𝑐, 𝑑), (𝑑, 𝑎), (𝑑, 𝑐), (𝑑, 𝑑)}
2) Symmetric closure
The symmetric closure of a relation (or binary relation) 𝑅 on set 𝐴 is defined as the
smallest symmetric relation on 𝐴 that contains 𝑅. It is denoted by 𝑅 𝑠 or 𝑅𝑠 or 𝑠(𝑅) or
𝑠𝑦𝑚𝑐(𝑅).
In other words, the symmetric closure is obtained by adding the ordered pairs (𝑦, 𝑥) to
the original relation 𝑅 for each (𝑥, 𝑦) in 𝑅.
For example,
Consider the relation 𝑅 = {(1,2), (1,3), (2,2), (2,4), (4,3)} on the set 𝐴 = {1,2,3,4}.
Here 𝑅 is not symmetric. To make it symmetric, we add all missing elements
(𝟐, 𝟏), (𝟑, 𝟏), (𝟒, 𝟐), (𝟑, 𝟒). Hence, the symmetric closure is
𝑠(𝑅) = {(1,2), (1,3), (𝟐, 𝟏), (2,2), (2,4), (𝟑, 𝟏), (𝟑, 𝟒), (𝟒, 𝟐), (4,3)}.
3) Transitive closure
The transitive closure of a relation (or binary relation) 𝑅 on set 𝐴 is defined as the
smallest transitive relation on 𝐴 that contains 𝑅. It is denoted by 𝑅 𝑡 or 𝑅𝑡 or 𝑡(𝑅) or
𝑡𝑟(𝑅) or 𝑅 ∗ .
For example,
1) Consider the relation 𝑅 = {(1,2), (2,2), (2,3), (3,3)} on the set 𝐴 = {1,2,3}.
(𝟏, 2) ∈ 𝑅 and (2, 𝟑) ∈ 𝑅. But, (𝟏, 𝟑) ∉ 𝑅.
Here 𝑅 is not transitive. To make it transitive, we add missing element (𝟏, 𝟑).
Hence, the transitive closure is
𝑡(𝑅) = {(1,2), (𝟏, 𝟑), (2,2), (2,3), (3,3)}.
2) Consider the relation 𝑅 = {(1,2), (2,3), (3,2), (4,1)} on the set 𝐴 = {1,2,3,4}.
(𝟏, 2) ∈ 𝑅 and (2, 𝟑) ∈ 𝑅. But, (𝟏, 𝟑) ∉ 𝑅.
(𝟐, 3) ∈ 𝑅 and (3, 𝟐) ∈ 𝑅. But, (𝟐, 𝟐) ∉ 𝑅.
(𝟑, 2) ∈ 𝑅 and (2, 𝟑) ∈ 𝑅. But, (𝟑, 𝟑) ∉ 𝑅.
(𝟒, 1) ∈ 𝑅 and (1, 𝟐) ∈ 𝑅. But, (𝟒, 𝟐) ∉ 𝑅.
Here 𝑅 is not transitive. To make it transitive, we add all missing elements (𝟏, 𝟑),
(𝟐, 𝟐), (𝟑, 𝟑), (𝟒, 𝟐).
Hence, the transitive closure would be
𝑡(𝑅) = {(1,2), (𝟏, 𝟑), (𝟐, 𝟐), (2,3), (3,2), (𝟑, 𝟑), (4,1), (𝟒, 𝟐)}.
Note that the obtained relation is NOT transitive because (𝟒, 2) ∈ 𝑅 and (2, 𝟑) ∈
𝑅. But, (𝟒, 𝟑) ∉ 𝑅. Hence, this is NOT correct answer of transitive closure. So,
again we add missing element (𝟒, 𝟑). Hence, the transitive closure is
𝑡(𝑅) = {(1,2), (𝟏, 𝟑), (𝟐, 𝟐), (2,3), (3,2), (𝟑, 𝟑), (4,1), (𝟒, 𝟐), (𝟒, 𝟑)}. This is
correct answer of transitive closure.
Question (SEP 2021 – 04 Marks)
Find the transitive closure of 𝑅 = {(1,2), (3,4), (4,5), (4,1), (1,1)} where 𝐴 = {1, 2, 3, 4, 5}.
Answer
(𝟑, 4) ∈ 𝑅 and (4, 𝟓) ∈ 𝑅. But, (𝟑, 𝟓) ∉ 𝑅.
Here the given relation is NOT transitive. To make it transitive, we add all missing elements
(𝟑, 𝟓), (𝟑, 𝟏) and (𝟒, 𝟐). Hence, the transitive closure of 𝑅 would be
𝑅 ∗ = {(1,2), (𝟑, 𝟏), (3,4), (𝟑, 𝟓), (𝟒, 𝟐), (4,5), (4,1), (1,1)}.
Note that the obtained relation is NOT transitive because (𝟑, 1) ∈ 𝑅 and (1, 𝟐) ∈ 𝑅. But,
(𝟑, 𝟐) ∉ 𝑅. Hence, this is NOT correct answer of transitive closure. So, again we add
missing element (𝟑, 𝟐). Hence, the transitive closure of 𝑅 is
𝑅 ∗ = {(1,1), (1,2), (𝟑, 𝟏), (𝟑, 𝟐), (3,4), (𝟑, 𝟓), (4,1), (𝟒, 𝟐), (4,5), }. This is correct answer
of transitive closure.
Let 𝑋 be the set with 𝑛 elements and 𝑅 be the relation defined on 𝑋. First, we will represent
the relation 𝑅 in matrix form.
Step 1
Write all positions where 1 is present in first column 𝐶1 . Also, write all positions where 1 is
present in first row 𝑅1 .
Every ordered pair (𝑥, 𝑦) of 𝐶1 × 𝑅1 can be represented by “ 𝟏 ” as the entry of the matrix.
That is, there are new additions in the matrix if there is any ordered pair (𝑥, 𝑦) in 𝐶1 × 𝑅1 .
Write all positions where 1 is present in second column 𝐶2 . Also, write all positions where 1
is present in second row 𝑅2 .
Step 3
Continue the same process with third column 𝐶3 and third row 𝑅3 of new matrix.
If there are 𝒏 elements in set 𝑋 then 𝒏 steps are required in order to find the transitive
closure of relation 𝑅.
Question
Find transitive closure by Warshall’s Algorithm if 𝐴 = {1, 2, 3} and 𝑅 = {(1, 2), (2, 3), (3, 1)}.
Answer
Let 𝑅 = {(1, 2), (2, 3), (3, 1)} be the relation on 𝐴 = {1, 2, 3}. First, represent the relation 𝑅 in
the matrix form.
Step 1
Write all positions where 1 is present in first column 𝐶1 . We can see that in the first column,
1 is present at position “ 3 ”. Therefore, we have
Write all positions where 1 is present in first row 𝑅1 . We can see that in the first row, 1 is
present at position “ 2 ”. Therefore, we have
Write all positions where 1 is present in second row 𝑅2 . We can see that in the second row, 1
is present at position “ 3 ”. Therefore, we have
Step 3
Write all positions where 1 is present in third column 𝐶3 . We can see that in the third column,
1 is present at positions “ 1 ” , “ 2 ” and “ 3 ”. Therefore, we have
Write all positions where 1 is present in third row 𝑅3 . We can see that in the third row, 1 is
present at position “ 1 ” , “ 2 ” and “ 3 ”. Therefore, we have
Since there are 𝟑 elements in set 𝐴, 𝟑 steps are required in order to find the transitive closure
of relation 𝑅. Hence, the transitive closure is
𝑅 ∗ = {(1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1), (3,2), (3,3)}
Question
Find transitive closure by Warshall’s Algorithm if 𝐴 = {1, 2, 3} and 𝑅 = {(1, 2), (2, 3), (3, 3)}.
Answer
Let 𝑅 = {(1, 2), (2, 3), (3, 3)} be the relation on 𝐴 = {1, 2, 3}. First, represent the relation 𝑅 in
the matrix form.
Step 1
Write all positions where 1 is present in first column 𝐶1 . We can see that in the first column,
1 is NOT present anywhere. Therefore, 𝐶1 is an empty set. That is,
Write all positions where 1 is present in first row 𝑅1 . We can see that in the first row, 1 is
present at position “ 2 ”. Therefore, we have
The cross product of 𝐶1 and 𝑅1 is 𝐶1 × 𝑅1 = ∅. That is, 𝐶1 × 𝑅1 is an empty set. Hence, there
is NO new addition.
Step 2
Write all positions where 1 is present in second column 𝐶2 . We can see that in the second
column, 1 is present at position “ 1 ”. Therefore, we have
Write all positions where 1 is present in second row 𝑅2 . We can see that in the second row, 1
is present at position “ 3 ”. Therefore, we have
Step 3
Write all positions where 1 is present in third column 𝐶3 . We can see that in the third column,
1 is present at positions “ 1 ” , “ 2 ” and “ 3 ”. Therefore, we have
Write all positions where 1 is present in third row 𝑅3 . We can see that in the third row, 1 is
present at position “ 3 ”. Therefore, we have
The cross product of 𝐶3 and 𝑅3 is 𝐶3 × 𝑅3 = {(1, 3), (2, 3), (3, 3)}.
The new ordered pairs (1, 3), (2, 3) and (3, 3) are already represented by 1 in the previous
matrix, so there is NO new addition.
Since there are 𝟑 elements in set 𝐴, 𝟑 steps are required in order to find the transitive closure
of relation 𝑅. Hence, the transitive closure is
𝑅 ∗ = {(1,2), (1,3), (2,3), (3,3)}
Question (JULY 2022 – 04 Marks)
Use Warshall’s Algorithm to find the transitive closure of the relation
𝑅 = {(1,4) , (2,1) , (2,3) , (3,1) , (3,4), (4,3)} on {1, 2, 3, 4}.
Answer
Let 𝑅 = {(1,4) , (2,1) , (2,3) , (3,1) , (3,4), (4,3)} be the relation on 𝐴 = {1, 2, 3, 4}. First,
represent the relation 𝑅 in the matrix form.
Step 1
Write all positions where 1 is present in first column 𝐶1 . We can see that in the first column,
1 is present at positions “ 2 ” and “ 3 ”. Therefore, we have
Write all positions where 1 is present in first row 𝑅1 . We can see that in the first row, 1 is
present at position “ 4 ”. Therefore, we have
Step 2
Write all positions where 1 is present in second column 𝐶2 . We can see that in the second
column, 1 is NOT present anywhere. Therefore, 𝐶2 is an empty set. That is,
Write all positions where 1 is present in third row 𝑅3 . We can see that in the third row, 1 is
present at positions “ 1 ” and “ 4 ”. Therefore, we have
The cross product of 𝐶3 and 𝑅3 is 𝐶3 × 𝑅3 = {(2, 1), (2, 4), (4, 1), (4, 4)}.
The new ordered pairs (4, 1) and (4, 4) can be represented by 1 and these are new additions
(maroon 1) in the previous matrix. Note that the ordered pairs (2, 1) and (2, 4) are already
represented by 1 in the previous matrix.
Step 4
Write all positions where 1 is present in fourth column 𝐶4 . We can see that in the fourth
column, 1 is present at positions “ 1 ” , “ 2 ” , “ 3 ” and “ 4 ”. Therefore, we have
Write all positions where 1 is present in fourth row 𝑅4 . We can see that in the fourth row, 1 is
present at positions “ 1 ” , “ 3 ” and “ 4 ”. Therefore, we have
Since there are 𝟒 elements in set 𝐴, 𝟒 steps are required in order to find the transitive closure
of relation 𝑅. Hence, the transitive closure is
𝑅 ∗ = {(1,1), (1,3), (1,4), (2,1), (2,3), (2,4), (3,1), (3,3), (3,4), (4,1), (4,3), (4,4)}.
Answer
Let 𝑀𝑅 be the given matrix for the relation 𝑅 on 𝐴 = {1, 2, 3, 4}.
Step 1
Write all positions where 1 is present in first column 𝐶1 . We can see that in the first column,
1 is present at positions “ 1 ” and “ 2 ”. Therefore, we have
Write all positions where 1 is present in first row 𝑅1 . We can see that in the first row, 1 is
present at positions “ 1 ” and “ 4 ”. Therefore, we have
The cross product of 𝐶1 and 𝑅1 is 𝐶1 × 𝑅1 = {(1, 1), (1, 4), (2, 1), (2, 4)}.
The new ordered pair (2, 4) can be represented by 1 and this is new addition (orange 1) in the
previous matrix. Note that the other ordered pairs are already represented by 1 in the previous
matrix.
Step 2
Write all positions where 1 is present in second column 𝐶2 . We can see that in the second
column, 1 is present at position “ 2 ”. Therefore, we have
Write all positions where 1 is present in second row 𝑅2 . We can see that in the second row, 1
is present at positions “ 1 ” , “ 2 ” and “ 4 ”. Therefore, we have
The cross product of 𝐶2 and 𝑅2 is 𝐶2 × 𝑅2 = {(2, 1), (2, 2), (2, 4)}.
Note that the all ordered pairs of 𝐶2 × 𝑅2 are already represented by 1 in the previous matrix.
Hence, there is NO new addition. Hence, the new matrix is same as the previous matrix.
That is, 𝑀𝑅2 = 𝑀𝑅1 .
Step 3
Write all positions where 1 is present in third column 𝐶3 . We can see that in the third column,
1 is present at position “ 3 ”. Therefore, we have
Write all positions where 1 is present in third row 𝑅3 . We can see that in the third row, 1 is
present at position “ 3 ”. Therefore, we have
The cross product of 𝐶3 and 𝑅3 is 𝐶3 × 𝑅3 = {(3, 3)}.
Note that the ordered pair (3, 3) is already represented by 1 in the previous matrix. Hence,
there is NO new addition. Hence, the new matrix is same as the previous matrix. That is,
𝑀𝑅3 = 𝑀𝑅2 .
Step 4
Write all positions where 1 is present in fourth column 𝐶4 . We can see that in the fourth
column, 1 is present at positions “ 1 ” , “ 2 ” and “ 4 ”. Therefore, we have
Write all positions where 1 is present in fourth row 𝑅4 . We can see that in the fourth row, 1 is
present at position “ 4 ”. Therefore, we have
Since there are 𝟒 elements in set 𝐴, 𝟒 steps are required in order to find the matrix of the
transitive closure of relation 𝑅. Hence, the matrix of the transitive closure is
Question (JULY 2023 – 04 Marks)
Find transitive closure by Warshall’s Algorithm if 𝐴 = {1, 2, 3, 4, 5} and
𝑅 = {(1,2) , (3,4) , (4,5) , (4,1) , (1,1)}.
Answer
Let 𝑅 = {(1,1), (1,2), (3,4) , (4,1) , (4,5)} be the relation on 𝐴 = {1, 2, 3, 4, 5}. First,
represent the relation 𝑅 in the matrix form.
Step 1
Write all positions where 1 is present in first column 𝐶1 . We can see that in the first column,
1 is present at positions “ 1 ” and “ 4 ”. Therefore, we have
Write all positions where 1 is present in first row 𝑅1 . We can see that in the first row, 1 is
present at positions “ 1 ” and “ 2 ”. Therefore, we have
The cross product of 𝐶1 and 𝑅1 is 𝐶1 × 𝑅1 = {(1, 1), (1, 2), (4, 1), (4, 2)}.
The new ordered pair (4, 2) can be represented by 1 and this is new addition (orange 1) in the
previous matrix. Note that the other ordered pairs are already represented by 1 in the previous
matrix.
Step 2
Write all positions where 1 is present in second column 𝐶2 . We can see that in the second
column, 1 is present at positions “ 1 ” and “ 4 ”. Therefore, we have
Write all positions where 1 is present in second row 𝑅2 . We can see that in the second row, 1
is NOT present anywhere. Therefore, 𝑅2 is an empty set. That is,
Step 3
Write all positions where 1 is present in third column 𝐶3 . We can see that in the third column,
1 is NOT present anywhere. Therefore, 𝐶3 is an empty set. That is,
Write all positions where 1 is present in fourth column 𝐶4 . We can see that in the fourth
column, 1 is present at position “ 3 ”. Therefore, we have
Write all positions where 1 is present in fourth row 𝑅4 . We can see that in the fourth row, 1 is
present at positions “ 1 ” , “ 2 ” and “ 5 ”. Therefore, we have
The cross product of 𝐶4 and 𝑅4 is 𝐶4 × 𝑅4 = {(3, 1), (3, 2), (3, 5)}.
The new ordered pairs (3, 1), (3, 2) and (3, 5) can be represented by 1 and these are new
additions (maroon 1) in the previous matrix.
Step 5
Write all positions where 1 is present in fifth column 𝐶5 . We can see that in the fifth column,
1 is present at positions “ 3 ” and “ 4 ”. Therefore, we have
Write all positions where 1 is present in fifth row 𝑅5 . We can see that in the fifth row, 1 is
NOT present anywhere. Therefore, 𝑅5 is an empty set. That is,
Since 𝑅5 = ∅, the cross product of 𝐶5 and 𝑅5 is 𝐶5 × 𝑅5 = ∅. That is, 𝐶5 × 𝑅5 is an empty
set. Hence, there is NO new addition. Hence, the new matrix is same as the previous matrix.
That is, 𝑀𝑅5 = 𝑀𝑅4 .
Since there are 𝟓 elements in set 𝐴, 𝟓 steps are required in order to find the transitive closure
of relation 𝑅. Hence, the transitive closure is
Composite relation
Let 𝑅 be the relation from set 𝐴 to set 𝐵 and let 𝑆 be the relation from set 𝐵 to set 𝐶. The
composite relation of 𝑅 and 𝑆 is denoted by 𝑅 𝑜 𝑆 or 𝑅𝑆 and it is defined as the set of all
ordered pairs (𝒙, 𝒛) where (𝒙, 𝑦) ∈ 𝑅 and (𝑦, 𝒛) ∈ 𝑆. That is,
Let 𝑅 be the relation from 𝐴 to 𝐵 and 𝑆 be the relation from 𝐵 to 𝐶 where 𝐴 = {4, 5, 6} , 𝐵 =
{𝑎, 𝑏, 𝑐} , 𝐶 = {𝑙, 𝑚, 𝑛}. Given that 𝑅 = {(4, 𝑎), (4, 𝑏), (5, 𝑐), (6, 𝑎), (6, 𝑐)} and
𝑆 = {(𝑎, 𝑙), (𝑎, 𝑛), (𝑏, 𝑙), (𝑏, 𝑚), (𝑐, 𝑙), (𝑐, 𝑚), (𝑐, 𝑛)}. Find the composite relation 𝑅 𝑜 𝑆.
Answer
Since 𝑅 is the relation from 𝐴 to 𝐵 and 𝑆 is the relation from 𝐵 to 𝐶, the composite relation
𝑅 𝑜 𝑆 is the relation from 𝐴 to 𝐶.
(𝟒, 𝑎) ∈ 𝑅 and (𝑎, 𝒍) ∈ 𝑆. Therefore, (𝟒, 𝒍) ∈ 𝑅 𝑜 𝑆.
Hence, 𝑅 𝑜 𝑆 = {(4, 𝑙), (4, 𝑚), (4, 𝑛), (5, 𝑙), (5, 𝑚), (5, 𝑛), (6, 𝑙), (6, 𝑚), (6, 𝑛)}.
Now, we need to write all possible ordered pairs (𝑎, 𝑏) such that 𝑎 − 𝑏 is even where 𝑎 ∈ 𝐴
and 𝑏 ∈ 𝐴.
(II)
Hence, 𝑅𝑆 = {(1, 2), (1, 4), (2, 1), (2, 3), (3, 2), (3, 4), (4, 1), (4, 3)}.
Note
Do not repeat any ordered pair if this is already present in 𝑅𝑆. In above example, do not
consider (2,1), (2,3), (3,2), (3,4) again because they are already present in 𝑅𝑆.
Types of a Relation
Question (SEP 2021 – 03 Marks)
Explain types of a Relation with a suitable example.
Answer
Converse of a relation / Inverse relation
Let 𝑅 be the relation from set 𝑋 to set 𝑌. Then, the converse of 𝑅 is denoted by 𝑅 −1 and it is
defined as the set of all ordered pairs (𝑦, 𝑥) where (𝑥, 𝑦) ∈ 𝑅. That is,
𝑅 −1 = {(𝑦, 𝑥) ∶ (𝑥, 𝑦) ∈ 𝑅}
For example,
1) Let 𝑅 be the relation from set 𝑋 to set 𝑌 where 𝑋 = {1, 2, 3} , 𝑌 = {7, 8} and
𝑅 = {(1, 7), (2, 7), (1, 8), (3, 8)}. Then, the converse / inverse of relation 𝑅 is given
by 𝑅 −1 = {(7, 1), (7, 2), (8, 1), (8, 3)}.
Identity relation
Let 𝑅 be the relation defined on set 𝐴. Then, 𝑅 is said to be identity relation if (𝑥, 𝑥) ∈ 𝑅 for
every element 𝑥 ∈ 𝐴. Generally, it is denoted by 𝐼𝐴 . That is, 𝐼𝐴 = {(𝑥, 𝑥) ∶ 𝑥 ∈ 𝐴}.
For example,
1) Let 𝐴 = {𝑎, 𝑏, 𝑐}. Then, 𝑅 = 𝐼𝐴 = {(𝑎, 𝑎), (𝑏, 𝑏), (𝑐, 𝑐)} is an identity relation on 𝐴.
Let 𝑀𝑅 be the given matrix where 𝑅 is the relation defined on 𝐴 = {1, 2, 3}.
Answer
Let 𝑋 = {1, 2, 3, 4, 5, 6}.
Let 𝐴 = {𝟏, 𝟐, 𝟑, 𝟒}. Then, 𝑋 − 𝐴 = {5, 6}.
Here 𝐴 = {1, 2, 3, 4} is maximal compatibility block because any element of 𝐴 is
compatible (related) to every other element of 𝐴 and no element of 𝑋 − 𝐴 is compatible
(related) to all elements of 𝐴.
Let 𝐴 = {𝟐, 𝟓}. Then, 𝑋 − 𝐴 = {1, 3, 4, 6}.
Here 𝐴 = {2, 5} is maximal compatibility block because any element of 𝐴 is compatible to
every other element of 𝐴 and no element of 𝑋 − 𝐴 is compatible to all elements of 𝐴.
Let 𝐴 = {𝟑, 𝟔}. Then, 𝑋 − 𝐴 = {1, 2, 4, 5}.
Here 𝐴 = {3, 6} is maximal compatibility block because any element of 𝐴 is compatible to
every other element of 𝐴 and no element of 𝑋 − 𝐴 is compatible to all elements of 𝐴.
Let 𝐴 = {𝟓, 𝟔}. Then, 𝑋 − 𝐴 = {1, 2, 3, 4}.
Here 𝐴 = {5, 6} is maximal compatibility block because any element of 𝐴 is compatible to
every other element of 𝐴 and no element of 𝑋 − 𝐴 is compatible to all elements of 𝐴.
Therefore, the maximal compatibility blocks are {1, 2, 3, 4} , {2, 5} , {3, 6} and {5, 6}.
The relation matrix is given by
Partition of a Set
Given that 𝑅 = {(1,2), (1,1), (2,1), (2,2), (3,3), (4,4), (5,5)}. Then, we have,
𝑅 −1 = {(2,1), (1,1), (1,2), (2,2), (3,3), (4,4), (5,5)}.
From the relation 𝑅 −1, we can define partition of 𝐴 so that every two elements in a same
block are related and any two elements of different blocks are not related.
The required partition for 𝑅 −1 is 𝑃 = {{𝟏, 𝟐}, {𝟑}, {𝟒}, {𝟓}}.
Equivalence class
Let 𝑅 be the equivalence relation defined on a set 𝐴 and let 𝑥 be the element of set 𝐴. Then,
the set of all those elements of 𝐴 that are related to 𝑥 is called the equivalence class of 𝑥 under
the relation 𝑅 and it is denoted by [𝑥]. That is,
[𝑥] = {𝑦 ∶ 𝑦 is an element of 𝐴 and 𝑦 is related to 𝑥}
For example,
Let 𝑅 = {(1, 2), (2, 1), (1, 1), (2, 2), (3, 3), (4, 4)} be the equivalence relation defined on a set
𝐴 = {1, 2, 3, 4}. Then, we have,
The equivalence class of 1 is given by [1] = {1, 2} because (1, 1) ∈ 𝑅 and (1, 2) ∈ 𝑅.
The equivalence class of 2 is given by [2] = {1, 2} because (2, 1) ∈ 𝑅 and (2, 2) ∈ 𝑅.
The equivalence class of 3 is given by [3] = {3} because (3, 3) ∈ 𝑅.
The equivalence class of 4 is given by [4] = {4} because (4, 4) ∈ 𝑅.
Question (OCT 2020 – 03 Marks)
Define equivalence class. Let 𝑅 be the relation on the set of integers 𝐼 defined by 𝑥 − 𝑦 is an
even integer, find the disjoint equivalence classes.
Answer
Definition:
Let 𝑅 be the equivalence relation defined on a set 𝐴 and let 𝑥 be the element of set 𝐴. Then,
the set of all those elements of 𝐴 that are related to 𝑥 is called the equivalence class of 𝑥 under
the relation 𝑅 and it is denoted by [𝑥]. That is,
[𝑥] = {𝑦 ∶ 𝑦 is an element of 𝐴 and 𝑦 is related to 𝑥}