Professional Documents
Culture Documents
Relations
Topics to be covered :
• Definition
• Types of Relations
• Representation of Relations
• Closure of Relations
• Warshall’s Algorithm
• Equivalence Relation
• Equivalence Classes
Weightage : 15 %
Range of a Relation :
If R is a relation from A to B , then the range of R is a subset of B such that
the collection of second element of all ordered pairs of R i.e. Range of R = {b |
(a,b) belongs to R}
Inverse Relation :
Let R be a relation from A to B , then the inverse relation of R is the collection
of all (b,a) such that (a,b) belongs to R . It is denoted by 𝑅−1 , defined as 𝑅−1
=
{(b,a) | (a,b) belongs to R}
Example 1 : Let R be a relation on A = {1,2,3,4} defined by “x less than y ”
i. Write ‘R’ the set of ordered pair
ii. Find 𝑅−1 of the relation R
iii. Can 𝑅−1be described in words ?
Answer :
iii. 𝑅−1 can be described as , “ x 𝑅−1 y iff x>y” i.e. “x is greater than y ”
In-degrees : Let R be a relation on A & a belong to A then the in-degree of a
belongs to A is the number of b such that b R a i.e. number of b | (b,a) belongs
to R
1 2 3 4 5
1 1 1 1 1 1
2 0 1 0 1 0
a
3 0 0 1 0 0
4 0 0 0 1 0
5 0 0 0 0 1
Composition Relations :
Let A , B and C be sets , R is a relation from A to B and
S is a relation from B to C .
RoS = {(2,3) , (2,5) , (2,4) , (2,2) , (3,3) , (3,5) , (3,2) , (4,2) , (4,5) , (5,5)}
(ii) First, multiply the matrix MR by itself, as shown in fig
R = {(2, 2), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5), (5, 3)}
RoR = { (2,2) , (2,3) , (2,4) , (2,5) , (3,5) , (3,3) , (4,3) , (5,4) , (5,5)}
R o R = { (2,2) , (2,3) , (2,4) , (2,5) , (3,5) , (3,3) , (4,3) , (5,4) ,
(5,5)}
Multiply the matrix MS with MR to obtain the matrix MS x MR as shown in fig:
R = {(2, 2), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5), (5, 3)}
S = {(2, 3), (2, 5), (3, 4), (3, 5), (4, 2), (4, 3), (4, 5), (5, 2), (5, 5)}
SoR = {(2,4) , (2,5) , (2,3) , (3,5) , (3,3) , (4,2) , (4,3) , (4,4) , (4,5) , (5,2) ,
(5,3) , (5,4) , (5,5)}
Note :
A smallest symmetric relation R1 for a not symmetric
relation R can be determined by formula R1 = R U 𝑅−1.
If R is a symmetric relation then symmetric closure of
R is itself
Let R be relation on set A = {1,2,3} defined by R = {(1,1) ,
(1,2) , (2,3)} . Find the reflexive closure and symmetric
closure of R.
Transitive Closure
Let R be relation on set A and R is not transitive .
Then the smallest transitive relation is said to be
transitive closure if it contains R
Note :
a. If R is transitive then the transitive closure of R
itself
b. Transitive closure of R =𝑅∞
c. Transitive closure of a non transitive relation can
be
found using Warshall’s Algorithm
Let A = {1,2,3,4} and R = {(1,2) , (2,1) , (2,2) , (4,3) , (3,1) }
Find the transitive closure of the Relation R.
Let A = {1,2,3,4} and R = {(1,2) , (2,1) , (2,2) , (4,3) , (3,1) }
Find the transitive closure of the Relation R.
Let A = {1,2,3,4} and R = {(1,2) , (2,1) , (2,2) , (4,3) , (3,1) }
Find the transitive closure of the Relation R.
Equivalence Relation Examples