Unit 4
Unit 4
RELATIONS
Learning Objectives
Relations
Relations are fundamental in mathematics and computer science for describing
connections or associations between elements of sets. Understanding relations involves
exploring their definitions, properties, and specific types such as equivalence relations and
orderings.
A relation R from set A to set B is a subset of the Cartesian product A × B. The cartesian
product A x B is a set of all possible ordered pairs (a, b) where a is from set A and b is
Properties of Relations
a. Reflexive Relation: A relation R on set A is reflexive if (a, a) ∈ R for every a ∈ A.
Reflexive also means “arrow to itself” for all elements of the domain to
the codomain.
(1, 1) ∈ R1
(2, 2) ∈ R1
(3, 3) ∈ R1
(4, 4) ∈ R1
1
every element a ∈ A. R1 has (1, 1), (2, 2), (3, 3), and (4, 4).
Relation R1 is refelexive because it contains all ordered pairs of the form (a, a) for
(1, 1) ∈ R1
(2, 2) ∈ R1
(3, 3) ∉ R1
(4, 4) ∈ R1
Relation R2 is not refelexive because the ordered pair (3, 3) is not in R2.
(1, 1) → (1, 1) ∈ R3
(2, 2) → (2, 2) ∈ R3
(1, 2) → (2, 1) ∈ R3
(2, 1) → (1, 2) ∈ R3
2
Relation R3 is symmetric because for all pairs has its reverse in R3.
(1, 1) → (1, 1) ∈ R4
(1, 2) → (2, 1) ∉ R4
(1, 3) → (3, 1) ∉ R4
(1, 4) → (4, 1) ∉ R4
Relation R4 is not symmetric because for (1, 2), there is no (2, 1) in R4. Same is true
for (1, 3) and (1, 4).
c. Antisymmetric Relation: A relation R on set A is antisymmetric if and only if for all (a, b) ∈ R
where a ≠ b, we must have (b, a) ∉ R.
Examples:
Problem 1: Determine if R5 is symmetric or not.
Let A = {1, 2, 3, 4}
R5 = {(2, 1), (3, 1), (3, 2), (4, 4)}
3
Therefore, in all cases where (a, b) exists with a ≠ b in relation R5, the
reverse pair (b, a) does not also exist, it is an antisymmetric relation.
Therefore, in all cases where (a, b) exists with a ≠ b in relation R5, the
reverse pair (b, a) does not also exist, it is NOT an antisymmetric relation.
d. Transitive Relation: A relation R on set A is transitive ((a, b) ∈ R and (b, c) ∈ R) implies that
(a, c) ∈ R. Transitive means “shortcuts” for any element in the domain
to the codomain.
Examples:
Example: Let A = {1, 2, 3, 4}
R5 = {(2, 1), (3, 1), (3, 2), (4, 4)}
o For (2, 1), there is no pair where the first element is 1. Therefore, there is no
transivity check needed for (2, 1).
4
o For (3, 1), there is no pair where the first element is 1. Therefore, there is also no
transivity check needed for (3, 1).
o For (3, 2), there is a pair whose first element is 2 which is (2, 1). Therefore, there
is a need to check if (3, 1) is in R5.
o For (4, 4), there is a pair whose first element is 4 which is (4, 4). Therefore, there
is a need to check if (4, 4) is in R5.
o For (2, 1), there is a pair where the first element is 1 which is (1, 3). However (2, 3) is not
in R6.
No (2, 3) for ordered pairs (2, 1) and (1, 3)
Relation R6 is not transitive because for (2, 1) and (1, 3) are there in R6 but there is
no (2, 3).
5
o Solution:
(1, 1) ∈ S
Reflexive:
(2, 2) ∈ S
(3, 3) ∈ S
Relation S is reflexive since every element in S is related to itself as
depicted by the red arrows (arrow to itself).
Symmetric:
(1, 1) → (1, 1) ∈ S
(2, 2) → (2, 2) ∈ S
(3, 3) → (3, 3) ∈ S
(1, 2) → (2, 1) ∈ S
(2, 1) → (1, 2) ∈ S
Relation S is symmetric since as depicted by the green arrows (arrows
back), (1, 2) and (2, 1) are present in relation S together with (1, 1), (2, 2), and (3,
3).
6
Problem: Determine if relation R = {(1, 1), (1, 2), (2, 2), (3, 3)} on set A = {1, 2, 3} is an
equivalence relation or not.
o Solution:
(1, 1) ∈ R
Reflexive:
(2, 2) ∈ R
(3, 3) ∈ R
Symmetric:
(1, 1) → (1, 1) ∈R
(2, 2) → (2, 2) ∈R
(3, 3) → (3, 3) ∈R
(1, 2) → (2, 1) ∉R
7
Problem: Verify if relation R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4),
(4, 4)} on set A = {1, 2, 3, 4} is a partial order or not.
o Solution:
Check if reflexive:
o (1, 1) ∈ R (TRUE)
o (2, 2) ∈ R (TRUE)
o (3, 3) ∈ R (TRUE)
o (4, 4) ∈ R (TRUE)
Therefore, R is reflexive.
Check if antisymmetric:
o For (1, 2), (2, 1) ∉ R (TRUE)
o For (1, 3), (3, 1) ∉ R (TRUE)
o For (1, 4), (4, 1) ∉ R (TRUE)
o For (2, 3), (3, 2) ∉ R (TRUE)
o For (2, 4), (4, 2) ∉ R (TRUE)
o For (3, 4), (4, 3) ∉ R (TRUE)
o No need to check for (1, 1), (2, 2), (3, 3), and (4, 4) since a =b.
Therefore, R is antisymmetric.
Check if transitive:
o For (1, 2) ∈R and (2, 3) ∈R implies (1, 3) ∈R (TRUE)
o For (1, 2) ∈R and (2, 4) ∈R implies (1, 4) ∈R (TRUE)
o For (1, 3) ∈R and (3, 4) ∈R implies (1, 4) ∈R (TRUE)
o For (2, 3) ∈R and (3, 4) ∈R implies (2, 4) ∈R (TRUE)
o No need to check for (1, 1), (2, 2), (3, 3), and (4, 4) since all will result to true.
Therefore, R is transitive.
o Conclusion: Since R is reflexive, antisymmetric and transitive, relation R is a partial order of set
A.
Examples:
8
Subset inclusion ⊆ on sets: A ⊆ B.
Divisibility ∣ on integers: a ∣ b.
Problem Solving:
Problem: Determine if ⊆ is a partial ordering on the set of all sets.
Solution: Yes, ⊆ is reflexive, antisymmetric, and transitive.
b. Total Orderings:
R is a total ordering if R is a partial ordering and for any two elements a, b ∈ A, either
a R b or b R a.
Examples:
≤ on integers: a ≤ b.
Alphabetical order ≤ on words: "apple" ≤ "banana".
Problem Solving:
Problem: Is alphabetical order ≤ on words a total ordering?
Solution: Yes, because for any two words, one will precede the other alphabetically.
Real-Life Applications
a. Network Security:
Application: Verifying access permissions where users (elements in set A) have specific
rights (elements in set B) can be modeled using relations.
b. Social Networks:
Application: Friendship relations (symmetric) on social media platforms help in
suggesting new connections based on existing friendships.
c. Academic Grading:
Application: Partial ordering on grades (A > B > C) helps in ranking student performance
across different courses.
d. Task Scheduling:
Application: Total ordering on tasks by priority (e.g., urgent > important > normal)
ensures optimal task management in project scheduling.
9
Name: _____________________________________________
Date: ______________________________________________
SCORE
UNIT 4 Assessment
Direction: Carefully read and understand each problem. Write down your solution for each
problem on the corresponding space on the right.
1. Let A = {1, 2, 3} and B = {4, 5}. Define a
relation R from A to B and list all
possible pairs in R.
10