Lec 15
Lec 15
Relation
Relation
• Every day we deal with relationships such as
those between
– a business and its telephone number,
– an employee and his or her salary,
– a person and a relative, and so on.
• In mathematics we study relationships such
as those between a positive integer
– that divides other.
– that is larger than it
Relation
• Let A and B be sets. A relation from set A to B
is a subset of A × B.
• We use the notation a R b to denote that (a, b)
∈ R and a ̸R b to denote that (a, b) R.
Moreover, when (a, b) belongs to R, a is said
to be related to b by R.
• Ex. Let A = {0, 1, 2} and B = {a, b}. Then {(0, a),
(0, b), (1, a), (2, b)} is a relation from A to B.
Relation 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.
• Ex 1. Let A be the set {1, 2, 3, 4}. Which ordered
pairs are in the relation R = {(a, b) | a divides b}?
– Solution: Because (a, b) is in R if and only if a and b
are positive integers not exceeding 4 such that a
divides b, we see that R = {(1, 1), (1, 2), (1, 3), (1, 4),
(2, 2), (2, 4), (3, 3), (4, 4)}.
Graphical and Tabular representation of
relation of Ex 1 of previous slide
Example-X
Solution: The pair (1, 1) is in R1, R3, R4, and R6; (1, 2) is in R1 and R6; (2, 1)
is in R2, R5, and R6; (1, −1) is in R2, R3, and R6; and finally, (2, 2) is in R1,
R3, and R4.
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 n2 elements when A has n
elements, and a set with m elements has 2m
subsets, so there are subsets of A × A.
• Thus, there are relations on a set with n
elements.
• Ex. How many relations can be defined on a set
of cardinality 3?
Ans. = 29 = 1024.
Types of relations
• Reflexive Relation
• Symmetric Relation
• Anti-symmetric Relation
• Transitive Relation
• Equivalence Relation
Reflexive Relation
• A relation R on a set A is called reflexive if (a, a) ∈ R for every element a ∈
A.
• The relation R on the set A is reflexive if
∀a((a, a) ∈ R),
where the domain is the set of all elements in A.
• Ex. Consider the following relations on {1, 2, 3, 4}:
R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)},
R2 = {(1, 1), (1, 2), (2, 1)},
R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)}
Which of these relations are reflexive?
Ans. R3 is reflexive
• Ex. Reflexive relations in Example X are R1, R3, and R4.
• Ex. Is the “divides” relation on the set of positive integers reflexive?
Ans. Yes.
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.
• Using quantifiers, we see that the relation R on the
set A is symmetric if
∀a∀b((a, b) ∈ R → (b, a) ∈ R).
• A relation is symmetric if and only if a is related to b
implies that b is related to a.
• Ex. If A = {1,2,3}, then the relation R1 = {(1,2),(2,1)} is
symmetric but R2= {(1,2),(2,1), (3,1)} is not symmetric.
• Ex. R3, R4, and R6 are symmetric in Example X.
Anti-symmetric Relation
• A relation R on a set A such that for all a, b ∈ A, if (a, b) ∈ R and (b, a)
∈ R, then a = b is called anti-symmetric.
• The relation R on the set A is anti-symmetric if
∀a∀b(((a, b) ∈ R ∧ (b, a) ∈ R) → (a = b)).
• The relation is symmetric if the only way to have a related to b and b
related to a is for a and b to be the same element.
• Ex. In Example X, The relations R1, R2, R4, and R5 are anti-symmetric.
R1 is anti-symmetric because the inequalities a ≤ b and b ≤ a imply
that a = b. R2 is anti-symmetric because it is impossible that a > b and
b > a. R4 is anti-symmetric, because two elements are related with
respect to R4 if and only if they are equal. R5 is anti-symmetric
because it is impossible that a = b + 1 and b = a + 1. The reader should
verify that none of the other relations is anti-symmetric.
Symmetric and Anti-symmetric
• The terms symmetric and anti-symmetric are
not opposites.
• A relation may be symmetric and anti-
symmetric both and may lack both of them.
• Ex. If A = {1,2,3}, then R = {(1,1)} is symmetric
as well as anti-symmetric relation on A.
• Also, R = {(1,1),(1,2),(2,1),(1,3)} is neither
symmetric nor anti-symmetric.
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.
• In quantified form
∀a∀b∀c(((a, b) ∈ R ∧ (b, c) ∈ R) → (a, c) ∈ R).
• Ex. R1 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)} is transitive, because
(3, 2) and (2, 1), (4, 2) and (2, 1), (4, 3) and (3, 1), and (4, 3) and (3,
2) are the only such sets of pairs, and (3, 1), (4, 1), and (4, 2) belong
to R1.
• In Example X, the relations R1, R2, R3, and R4 are transitive.
• Is the “divides” relation on the set of positive integers transitive?
Solution: Suppose that a divides b and b divides c. Then there are positive
integers k and l such that b = ak and c = bl. Hence, c = a(kl), so a divides c. It
follows that this relation is transitive.
Equivalence Relation
• A relation which is reflexive, symmetric, and
transitive is called equivalence relation.
• Ex. If A = {1,2,3} and R = {(1,1), (2,2),(3,3),(1,2),
(2,1),(2,3),(3,2),(1,3)} is not an equivalence
relation, as this is not transitive because (3,2)
∈ R, (2,1) ∈ R, but (3,1) R.
• Ex. In Example X, R3 and R4 are equivalence
relation.
Combining Relations
• Let A = {1, 2, 3} and B = {1, 2, 3, 4}. The
relations R1 = {(1, 1), (2, 2), (3, 3)} and R2 =
{(1, 1), (1, 2), (1, 3), (1, 4)} can be combined to
obtain
– R1 ∪ R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)},
– R1 ∩ R2 = {(1, 1)},
– R1 − R2 = {(2, 2), (3, 3)},
– R2 − R1 = {(1, 2), (1, 3), (1, 4)}.