Operations on Relations
Operations on Relations
A relation is a subset of the Cartesian product of two sets.
Suppose
Since relations are simply sets of ordered pairs, we can perform all standard set operations on them, such as union, intersection, difference, and complement. We can also define two special operations unique to relations: composition and inverse.
These operations are frequently tested in GATE CSE, especially in questions involving relation properties and graph-based representations.
1. Union of Relations
Definition
The union of two relations contains every ordered pair that belongs to either relation.
Mathematically,
The word or means:
- Present in R
- Present in S
- Present in both
Example
Let
and
Then
Notice that
appears only once because sets never contain duplicate elements.
Venn Diagram Interpretation
R S
●●●●●●●●
● R∩S ●
●●●●●●●●
Union = Everything inside both circles.
Important Properties
- Commutative
- Associative
- Identity
2. Intersection of Relations
Definition
The intersection contains only the ordered pairs that appear in both relations.
Mathematically,
Example
Let
and
Then
Only one ordered pair belongs to both relations.
Venn Diagram Interpretation
R S
●●●●●●●●
● X ●
●●●●●●●●
Intersection = Common region.
Properties
- Commutative
- Associative
- Identity
3. Difference of Relations
Definition
The difference of two relations consists of ordered pairs that belong to the first relation but not to the second.
Mathematically,
Example
Let
and
Then
The pair
is removed because it appears in both relations.
Important Note
Difference is not commutative.
Generally,
4. Complement of a Relation
Definition
The complement of a relation contains every ordered pair that does not belong to the relation.
Suppose
Then
Example
Let
Then
Suppose
Then
Important Observation
The complement depends on the universal relation (Cartesian product).
Without knowing
the complement cannot be determined.
Property
Applying complement twice gives the original relation.
5. Composition of Relations
Definition
Composition combines two relations into a new relation.
Suppose
and
Their composition is written as
and is defined by
The order is important:
- First apply R
- Then apply S
Intuition
Think of composition as following a path.
A ----R----> B ----S----> C
If you can travel from
to
through
then include
in the composition.
Example
Let
and
Using
and
we obtain
Using
and
we obtain
Therefore,
Graph Interpretation
1 → 2 → 4
becomes
1 → 4
Similarly,
2 → 3 → 5
becomes
2 → 5
Important Notes
Composition is generally
- Not commutative
Composition is
- Associative
6. Inverse of a Relation
Definition
The inverse of a relation is obtained by reversing every ordered pair.
If
then
More formally,
Example
Suppose
Then
Every ordered pair has simply been reversed.
Graph Interpretation
Original graph
1 → 2
2 → 3
3 → 1
Inverse graph
1 ← 2
2 ← 3
3 ← 1
Every arrow changes direction.
Important Properties
Inverse of inverse
Inverse distributes over union
Inverse distributes over intersection
Inverse of composition
Notice that the order is reversed.
Summary Table
| Operation | Definition |
|---|---|
| Union | Ordered pairs present in either relation |
| Intersection | Ordered pairs common to both relations |
| Difference | Ordered pairs present in the first relation but not the second |
| Complement | Ordered pairs not present in the relation |
| Composition | Connect two relations through an intermediate element |
| Inverse | Reverse every ordered pair |
Common GATE Questions
- Compute
- Compute
- Find
- Find the complement of a relation
- Compute
- Find the inverse of a relation
- Determine whether composition is commutative
- Use matrix multiplication to compute composition
- Verify identities involving inverse and composition
Memory Tricks
| Operation | Easy Way to Remember |
|---|---|
| Union | Everything from both relations |
| Intersection | Only common ordered pairs |
| Difference | Remove common pairs from the first relation |
| Complement | Everything outside the relation |
| Composition | Follow arrows through an intermediate vertex |
| Inverse | Reverse every arrow |