Relations and Order in Discrete Math
Relations and Order in Discrete Math
SEM: III
Contents
1. Closure of relations
2. Equivalence Relations
3. Partial Orderings
4. Functions
Self-Study
1. Transitive Closure
2. Warshall’s Algorithm
➢ Let P be a property of such relations such as being symmetric or being transitive or being reflexive.
➢ We will write reflexive (R), symmetric (S) and transitive (T) for the reflexive, symmetric and transitive closures of R.
NOTE: Generally P(R) need not exist. However, in general situation P(R) will always exist.
➢ The closure of a relation R with respect to property P is the relation obtained by adding the minimum number of
OR
➢ Let R be a relation on a set A. R may or may not have some property P, such as reflexivity, symmetry, or transitivity.
If there is a relation S with property P containing R such that S is a subset of every relation with property P
➢ If relation R on set A, does not satisfy any property or some property. In order to make relation R satisfy
the property, some ordered pairs are added and a new relation S is formed which satisfies the property.
➢Add only necessary/ smallest/ minimum number of ordered pairs to make relation satisfy the property.
➢Upon adding ordered pairs, the new relation formed must satisfy the property.
➢A new relation formed must contain relation R i.e., R is a subset of new relation say S → R ⊆ S
➢ Let A be a set and let Δ = {(x, x) | x in A}. Δ is called a diagonal relation on A and sometimes
➢ In other words, reflexive (R) is obtained by simply adding to R those elements (a, a) in the diagonal
NOTE:
➢ The reflexive relation r(R) of a relation R is the smallest reflexive relation that contains R as a subset.
➢ The relation R = {(1, 1), (1, 2), (2, 1), (3, 2)} on the set A = {1, 2, 3} is not reflexive.
➢ This can be done by adding (2, 2) and (3, 3) to R, because these are the only pairs of the form (a, a)
➢ Let, N be a set of positive integers and R be a relation i.e. less than ( < ) on the set. Determine reflexive
closure of R.
➢ The closure of a relation R w.r.t property P is the relation obtained by adding minimum number of
Let, A = {1, 2, 3, 4} and R = {(1, 2), (2, 1), (1, 1), (2, 2)}. Compute Reflexive r(R).
r (R) = R ∪ Δ
R ∪ Δ = {(1, 2), (2, 1), (1, 1), (2, 2)} ∪ {(1, 1), (2, 2), (3, 3), (4, 4)}
R ∪ Δ = {(1, 1), (2, 2), (3, 3), (4, 4), (1, 2), (2, 1)}
r(R) = {(1, 1), (2, 2), (3, 3), (4, 4), {(1, 2), (2, 1)}
Let, A = {1, 2, 3, 4} and R = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3)}. Compute Reflexive r(R).
r (R) = R ∪ Δ
R ∪ Δ = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3)} ∪ {(1, 1), (2, 2), (3, 3), (4, 4)}
R ∪ Δ = {(1, 1), (2, 2), (3, 3), (4, 4), (1, 3), (2, 4), (3, 1), (4, 3)}
r(R) = {(1, 1), (2, 2), (3, 3), (4, 4), (1, 3), (2, 4), (3, 1), (4, 3)}
r (R) = R ∪ Δ
➢ Let R be a relation on A. Then 𝑅−1 is the inverse of R then, the symmetric closure of R denoted as S(R) is
➢ In other words, symmetric (R) is obtained by adding to R all pairs (b, a) whenever (a, b) belongs to R.
➢ A symmetric closure s(R) is the smallest symmetric relation that contains R as a subset.
➢ The relation {(1, 1), (1, 2), (2, 2), (2, 3), (3, 1), (3, 2)} on {1, 2, 3} is not symmetric.
➢ How can we produce a symmetric relation that is as small as possible and contains R?
➢ To do this, we need only add (2, 1) and (1, 3), because these are the only pairs of the form (b, a)
➢ This new relation is symmetric and contains R. Furthermore, any symmetric relation that contains R
must contain this new relation, because a symmetric relation that contains R must contain (2, 1) and (1,
3).
➢ Let, N be a set of positive integers and R be a relation i.e. less than ( < ) on the set. Determine
symmetric closure of R.
➢ General Formula
Let, A = {1, 2, 3, 4} and R = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3)}. Find symmetric closure.
s(R) = R ∪ 𝑅−1
𝑅−1 = { 1, 1 , 3, 1 , 4, 2 , 1, 3 , 3, 3 , 3, 4 }
R ∪ 𝑅−1 = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3)} ∪ { 1, 1 , 3, 1 , 4, 2 , 1, 3 , 3, 3 , 3, 4 }
R ∪ 𝑅 −1 = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3), (4, 2), (3, 4)}
s(R) = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3), (4, 2), (3, 4)}
Consider the following relation R on the set: A = {1,2,3,4} R = {(1,1) (1,3) (2,4) (3,1) (3,3) (4,3)}
Compute Reflexive(R) and Symmetric(R)
Reflexive(R) = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3), (2, 2), (4, 4)}
Symmetric(R) = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3), (4, 2), (3, 4)}
Consider the following relation R on the set: A = {a, b, c}, R = {(a, a), (a, b), (b, c), (c, c)}
Compute: Reflexive(R) and Symmetric(R)
Reflexive(R) = {(a, a), (a, b), (b, c), (c, c), (b, b)}
Symmetric(R) = {(a, a), (a, b), (b, c), (c, c), (b, a), (c, b)}
➢ The transitive closure 𝑅+ is the smallest transitive relation that contains R as a subset.
t(R) = 𝑅∗ = R ∪ 𝑅2 ∪ . . . . ∪ 𝑅𝑛
Where, 𝑅2 = R o R
𝑅3 = R o R o R and so on 𝑅𝑛 = 𝑅𝑛−1 o R
Consider the following relation R on the set: A = {1, 2, 3}, R = {(1, 2), (2, 3), (3, 3)}. Find transitive
closure.
|A| = 3
t(R) = R ∪ 𝑅2 ∪ 𝑅3
R = {(1, 2), (2, 3), (3, 3)}
𝑅2 = R o R = {(1, 3), (2, 3), (3, 3)}
𝑅3 = 𝑅2 o R = {(1, 3), (2, 3), (3, 3)}
t(R) = R ∪ 𝑅2 ∪ 𝑅3 = {(1, 2), (2, 3), (3, 3), (1, 3)}
Consider the following relation R on the set: A = {1, 2, 3}, R = {(1, 2), (2, 3), (3, 1)}. Find transitive
closure.
|A| = 3
t(R) = R ∪ 𝑅2 ∪ 𝑅3
R = {(1, 2), (2, 3), (3, 1)}
𝑅2 = R o R = {(1, 3), (2, 1), (3, 2)}
𝑅3 = 𝑅2 o R = {(1, 1), (2, 2), (3, 3)}
t(R) = R ∪ 𝑅2 ∪ 𝑅3 = {(1, 2), (2, 3), (3, 1), (1, 3), (2, 1), (3, 2), (1, 1), (2, 2), (3, 3)}
Consider the following relation R on the set: A = {a, b, c}, R = {(a, a), (a, b), (b, c), (c, c)} Find
transitive closure.
|A| = 3
t(R) = R ∪ 𝑅2 ∪ 𝑅3
R = = {(a, a), (a, b), (b, c), (c, c)}
𝑅2 = R o R = {(a, a), (a, b), (a, c), (b, c), (c, c)}
𝑅3 = 𝑅2 o R = {(a, a), (a, b), (a, c), (b, c), (c, c)}
t(R) = R ∪ 𝑅2 ∪ 𝑅3 = {(a, a), (a, b), (b, c), (c, c), (a, c)}
➢ To find the transitive closure – if there is a path from a to b add an arc from b to b.
➢ A path from a to b in the directed graph G is a sequence of edges (x0, x1), (x1, x2), (x2, x3), . . . , (𝑥𝑛−1 ,
𝑥𝑛 ) in G, where n is a nonnegative integer, and 𝑥0 = a and 𝑥𝑛 = b, that is, a sequence of edges where the
terminal vertex of an edge is the same as the initial vertex in the next edge in the path.
➢ This path is denoted by x0, x1, x2,..., 𝑥𝑛−1 , 𝑥𝑛 and has length n.
➢ A path in a directed graph can pass through a vertex more than once.
➢ Moreover, an edge in a directed graph can occur more than once in a path.
1. a, b, e, d
2. a, e, c, d, b
3. b, a, c, b, a, a, b
4. d,c
5. c, b, a
Figure 1: A Directed Graph
6. e, b, a, b, a, b, e
b, a, c, b, a, a, b (b, a), (a, c), (c, b), (b, a), (a, a), and (a, b) are all edges 6
e, b, a, b, a, b, e (e, b), (b, a), (a, b), (b, a), (a, b), and (b, e) are edges 6
Determine whether these sequences of vertices are paths in this directed graph.
a) a, b, c, e
b) b, e, c, b, e
c) a, a, b, e, d, e
d) b, c, e, d, a, a, b
e) b, c, c, b, e, d, e, d
Figure 2: A Directed Graph
f) a, a, b, b, c, c, b, e, d
➢ Let 𝑀𝑅 be the zero–one matrix of the relation R on a set with n elements. Then the zero–one matrix of
1. Find the zero–one matrix of the transitive closure of the relation R where
Solution:
➢ The general idea behind an equivalence relation is that it is a classification of objects which are in some way “alike”.
➢ The notation a ∼ b is often used to denote that a and b are equivalent elements with respect to a particular
equivalence relation.
It is reflexive and transitive (A ⊆ B and B ⊆ C then, A ⊆ C) but not symmetric as A ⊆ B does not imply
B ⊆ A.
Example:
R is reflexive → 1 ⊆ 1
R is transitive → 2 ⊆ 3 3 ⊆ 4 then, 2 ⊆ 4
Let, A = {1, 2, 3, 4}
i) R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 3), (3, 3), (4, 4)}
ii) R2 = {(1, 1), (1, 2), (2, 2), (3, 3), (4, 4)}
iii) R3 = ∅
iv) R4 = A × A
Let, R = {(12, 6), (6, 12), (6, 6), (9, 3), (20, 8), . . . . . }
i) Reflexive:
Let, x ∈ Z then, x –x = 0 and 0 is divisible by 6.
(x, x) ∈ R
Therefore, xRx ∀ n ∈ Z
Hence, R is reflexive
Let, R = {(12, 6), (6, 12), (6, 6), (9, 3), (20, 8), . . . . . }
ii) Symmetric
Let, xRy → (x, y) ∈ R which is:
(x – y) is divisible by 6
(y – x) is divisible by 6
→ yRx i.e., (y, x) ∈ R
Hence, R is symmetric ∀ x, y ∈ Z
Let, R = {(12, 6), (6, 12), (6, 6), (9, 3), (20, 8), . . . . . }
iii) Transitive
Let, (x, y) ∈ R and (y, z) ∈ R
(x – y) is divisible by 6 and (y – z) is divisible by 6
[(x – y) + (y – z)] is divisible by 6
[(x – y + y - z]
(x – z) is divisible by 6
xRz
(x, z) ∈ R
Hence, R is transitive ∀ x, y, z ∈ Z
R is an equivalence relation on set of integers.
b = 10011, 1101, . . . .
R is symmetric → Since (a,b) have equal number of 0’s (b,a) also have equal number of 0’s
(a,b) ∈ R, (b,a) ∈ R
(a,c) ∈ R
i. If (a,a) i.e., Even – Even = Even and Odd – Odd = Even is not odd positive integer (a,a) ∉ R
Case 1: (odd – even) = odd ; (even – odd) = odd then, (odd – odd) = even
Let A = {1,2,3,4,5}
ii. R is symmetric
➢ Suppose A is a set and R is an equivalence relation on A, the equivalence class of x denoted by [x], is set of all
➢ Let A = {1, 2, 3, 4} and R = {(1, 2), (2, 1), (1, 1), (2, 2), (3, 3), (4, 4)} is an equivalence relation. Determine equivalence
classes.
[2] = {1, 2}
[3] = {3}
[4] = {4}
➢ The collection of all equivalence classes of elements of set A under an equivalence relation R is denoted by A/R.
➢ A/R = {[x] : x ∈ A}
➢ Let A be a non-empty set. A partition of set A is a subdivision of A into non overlapping, non empty subsets.
➢ A partition of a set A is a set of non-empty subsets of A denoted as {A1, A2, . . . . Ak} such that-
ii) A1 ∪ A2 ∪ . . . . ∪ Ak = A
Ai ≠ Aj then, Ai ∩ Aj = ∅
➢ In order to find partition of a given set, the equivalence classes are found first and from that partitions are obtained.
➢ Consider the following collections of subsets of S = {1, 2, . . . . , 8, 9} and identify whether it is a partition or not.
It is not a partition as 5 is present in 2 subsets i.e., {1, 3, 5} and {5, 7, 9} are not disjoint.
It is a partition on set A.
a) Here, 6 ∈ A but, 6 does not belongs to any given partitions. Hence, these are not partitions of A.
b) Here, two partitions {1,5,7} {2,5,6} are not disjoint partitions of A. hence, these are not
partitions of A.
Consider the following relation R on S = {1, 2, 3}. R = {(1, 1), (1, 2), (2, 2), (2, 1), (3, 3)} and R is an
equivalence relation on S. Find equivalence classes, quotient set and representative of equivalence
class.
Let R be the following relation on set A. A = {1, 2, 3, 4, 5, 6} and R be a relation R = {(1, 1), (1, 5),
(2, 2), (2, 3), (2, 6), (3, 2), (3, 3), (3, 6), (4, 4), (5, 1), (5, 5), (6, 2), (6, 3), (6, 6)}. Find the partition
of A induced by R.
Consider the set of words w = {sheet, last, sky, wash, wind, sit}. Find w/R where R is the
R = {(sheet, sheet), (last, last), (last, wash), (last, wind), (sky, sky), (sky, sit), (wash, wash), (wash, last),
(wash, wind), (wind, wind), (wind, last), (wind, wash), (sit, sit), (sit, sky)}
R = {(sheet, sheet), (sheet, sky), (sheet, sit), (last, last), (sky, sky), (sky, sheet), (sky, sit), (wash, wash), (wash,
wind), (wind, wind), (wind, wash), (sit, sit), (sit, sky), (sit, sheet)}
Given S = {0, 1, 2, 3, 4, 5}
R = {(0, 0), (0, 4), (1, 1), (1, 3), (4, 5), (0, 5), (5, 4), (5, 0), (5, 5), (2, 2), (3, 1), (3, 3), (4, 0), (4, 4)}
For the equivalence relation R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 3), (3, 3), (4, 4)} defined on
➢ A relation R on a set A is called a partial ordering or a partial order if R is reflexive, antisymmetric and transitive.
➢ A set S together with a partial ordering R is called a partially ordered set, or poset, and is denoted by (S, R).
The elements a and b of a poset (S, ≼) are called comparable if either a ≼ b or b ≼ a. When a and b are elements
of S such that neither a ≼ b nor b ≼ a, a and b are called incomparable.
The word “partial” in “partial ordering” indicates that not every pair of element in the set is comparable
EXAMPLE 1 In the poset (Z+, |), are the integers 3 and 9 comparable? Are 5 and 7 comparable?
Solution: The integers 3 and 9 are comparable, because 3 | 9. The integers 5 and 7 are incomparable, because 5
∤ 7 and 7 ∤ 5.
Definition 3:
If (S, ≼) is a poset and every two elements of S are comparable, S is called a totally ordered or linearly ordered
set, and ≼ is called a total order or a linear order. A totally ordered set is also called a chain.
EXAMPLE 2 The poset (Z, ≤) is totally ordered, because a ≤ b or b ≤ a whenever a and b are integers
Show that the “greater than or equal” relation (≥) is a partial ordering on the set of integers
Finally, ≥ is transitive because a ≥ b and b ≥ c imply that a ≥ c. It follows that ≥ is a partial ordering on the
Show that the inclusion relation ⊆ is a partial ordering on the power set of a set S.
imply that A = B. Finally, ⊆ is transitive, because A ⊆ B and B ⊆ C imply that A ⊆ C. Hence, ⊆ is a partial
A = {1, 2, 3}
R1 = { }
R2 = {(1, 1), (2, 2), (3, 3)}
R3 = {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1)}
R4 = A × A
Given A = {1, 2, 3, 4}
R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)}
Determine (A, R) is a Poset ?
R → Reflexive
R → Antisymmetric
R → Transitive
A = {1, 2, 3, 4}
R = {(1, 1), (2, 2), (3, 3), (4, 4), (1, 4), (3, 2), (3, 4), (3, 1)}
From the given digraphs, write relations as set of ordered pairs, check for equivalence or partial ordering
relations.
A = {a, b, c, d}
R = {(a, b), (b, a), (a, c), (c, d), (b, d), (c, c)}
ordering relation.
R = {(3, 3), (3, 4), (3, 5), (3, 6), (4, 4), (4, 5), (4, 6), (5, 5), (5, 6), (6, 6)}
Show that the relation “greater than or equal to” is a partially ordering relation on a set of integers.
Z = {. . . . . . , -3, -2, -1, 0, 1, 2, 3, . . . . }
A Hasse diagram is used to represent partial order relations with sufficient information
Step 1: Start with a directed graph of the relation in which all arrows point upward.
Step 2: Remove self loops. Self loops are quite obvious and they must be present for all vertices because R is reflexive.
So we can remove them to simplify the diagram
c. If (c,d) also belongs to the partial order then remove the edge(a,d) and so on.
Step 4: Remove all the arrows of the directed graph. If we assume that all edges are pointing upwards then there is no
need to show the directions in the graph. We can safely remove the arrows in the diagram.
Let’s say we have a set S={1,2,3,9,18} and Relation R is defined on set S. R={(a,b) | a divides b)}
1. Reflexivity: a|a
2. Antisymmetry: a|b and b|a → a=b
3. Transitivity: a|b and b|c → a|c
Therefore , R is a partial order and (S,R) is a poset.
Lets try to represent relation R={(a,b) | a divides b)} using a directed graph S ={1,2,3,9,18}
18
9
2
3
1
➢ An element of a poset is called maximal if it is not less than any element of the poset.
➢ a is maximal in the poset (S, ≼ ) if there is no b ⋲ S such that a ⊰ b.
➢ An element of a poset is called minimal if it is not greater than any element of the poset.
➢ a is minimal if there is no element b ⋲ S such that b ⊰ a
➢ Maximal and minimal elements are easy to spot using a Hasse diagram.
Which elements of the poset ({2, 4, 5, 10, 12, 20, 25}, |) are maximal, and which are minimal?
Solution: The Hasse diagram for this poset shows that the maximal elements are 12, 20, and 25, and the
minimal elements are 2 and 5.
➢ a is the greatest element of the poset (S, ≼) if b ≼ a for all b ∈ S. The greatest element is unique when it
exists.
➢ a is the least element of (S, ≼ )if a ≼ b for all b ∈ S. The least element is unique when it exists
➢ Determine whether the posets represented in each of the Hasse diagram below have a greatest element and a
least element.
➢ The least element of the poset with Hasse diagram (a) is a. This poset has no greatest element.
➢ The poset with Hasse diagram (b) has neither a least nor a greatest element.
➢ The poset with Hasse diagram (c) has no least element. Its greatest element is d.
➢ The poset with Hasse diagram (d) has least element a and greatest element d.
➢ The element x is the least upper bound of A if a ≼ x whenever a ∈ A, and x ≼ z whenever z is an upper
bound of A.
➢ The element y is called the greatest lower bound of A if y is a lower bound of A and z ≼ y whenever z is a
lower bound of A.
➢ The greatest lower bound and least upper bound of A is unique if it exists.
The upper bounds of {b, d, g} are g and h. Because g ≺ h, g is the least upper bound. The lower bounds of {b, d, g} are
a and b. Because a ≺ b, b is the greatest lower bound.
A total ordering ≼ is said to be compatible with the partial ordering R if a ≼ b whenever aRb. Constructing a
Find a compatible total ordering for the poset ({1, 2, 4, 5, 12, 20}, |).
started only after other tasks are finished. A partial ordering on tasks is set up by considering task X ≺ task Y if task
Y cannot be started until task X has been completed. The Hasse diagram for the seven tasks, with respect to this
partial ordering, is shown in below. Find an order in which these tasks can be carried out to complete the project.
y = 𝑥2 + 1
If x = 1 → y = 2 2
1 4
x=2→y=5
2 5
x = 3 → y = 10 8
3
10
• Given any two non empty sets A, B, a function (“transformation” or “mapping”) f from A to B (f:
• • y
• • •
a• b
•
•
• •
A • x
B
Venn Diagram Graph Plot
➢ A is the domain of f.
➢ B is the codomain of f.
➢ a is a pre-image of b under f.
1 A
2 B
3 C
A
1
Valid B
2
C
3
D
Valid
1
A
2
B
3
A
1
Invalid B
2
C
3
D
Invalid
1
A
2
B
3
C
4
A
1
Valid B
2
C
3
D
Invalid
Course Name: DMGT School of Engineering, DSU 85
Example 1
Let A = {1, 2, 3} and B = {a, b, c, d}. With the help of Venn diagram given below identify image, pre-
image and range. A B
a
1
b
Solution 2 c
3 d
‘a’ is the image of 1 and ‘b’ is the image of 2 and 3
1 is the pre-image of a, 2 and 3 is the pre-image of b
Ran(f) = {a, b}
Domain of f : {1, 2, 3}
Co-domain of f: {a, b, c, d}
Course Name: DMGT School of Engineering, DSU 86
Example 2
Let R be the relation with ordered pairs (Abdul, 22), (Brenda, 24), (Carla, 21), (Desire, 22), (Eddie, 24),
and (Felicia, 22). Here each pair consists of a graduate student and this student’s age. Specify a function
determined by this relation.
Solution
Consider the function f(x) = 𝑥 3 i.e., f assigns to each real number its cube. Then find the image of (2).
Solution
f (x) = 𝑥 3
f (2) = 23 = 8
c t
Solution d u
Image:
Range:
f (A) = {r, s, u}
Let A = {0, ± 1, ± 2, ± 3}. Consider f: A → R where R is the set of all real numbers defined by
Solution
f(x) = 𝑥 3 - 2𝑥 2 + 3x + 1
f(-3) = -53
➢ A function is called real-valued if its codomain is the set of real numbers, and it is called integer-
valued if its codomain is the set of integers.
➢ Two real-valued functions or two integer-valued functions with the same domain can be added, as well
as multiplied.
➢ Let f and g be functions from A to R. Then f + g and f x g are also functions from A to R defined for all
x ∈ A by:
(f × g ): A → R, (f . g)(x) = f(x)g(x)
Let f1 and f2 be functions from R to R such that f(x) = 𝑥 2 and g(x) = x − 𝑥 2 . What are the functions f + g
and f x g?
(f × g)(x) = 𝑥 2 (x − 𝑥 2 ) = 𝑥 3 - 𝑥 4
4. Identity Function
5. Inverse Function
➢ A function f is said to be one-to-one, or an injunction, if and only if f (a) = f (b) implies that a = b for
all a and b in the domain of f.
➢ A function is one-to-one (1-1), or injective, or an injection, iff every element of its range has only one
pre-image.
➢ Determine whether the function f from {a, b, c, d} to {1, 2, 3, 4, 5} with f (a) = 4, f (b) = 5, f (c) = 1,
and f (d) = 3 is one-to-one
Solution
The function f is one-to-one because f takes on different values at the four elements of its domain.
Let A = {1, 2, 3} and B = {a, b, c, d}. In each case state whether the given function f (if defined) is
injective or not.
• However, a function that is increasing, but not strictly increasing, or decreasing, but
not strictly decreasing, is not one-to-one.
Example 1: Consider the function f(x) = x (the identity function). For any 𝑥1 and 𝑥2
where 𝑥1 <𝑥2 , f(𝑥1 ) = x1 and f(𝑥2 ) = 𝑥2 , which satisfies the condition for a strictly
f(x) = x → 𝑥1 <𝑥2
f(𝑥1 ) = x1
f(𝑥2 ) = 𝑥2
Example 2: Consider the function f(x) = −x. For any 𝑥1 and 𝑥2 where 𝑥1 <𝑥2 , f(𝑥1 ) =
−𝑥1 and f(𝑥2 ) = −𝑥2 , which satisfies the condition for a strictly decreasing function and
is one-to-one.
f(x) = −x → 𝑥1 <𝑥2
f(𝑥1 ) = −𝑥1
f(𝑥2 ) = −𝑥2
Example 3: Consider the function f(x)=𝑥2 . For 𝑥1 = −1 and 𝑥2 = 1, we have 𝑥1 <𝑥2 , but f(𝑥1 ) = 1
and f(𝑥2 ) = 1, which are equal. So, this function is increasing but not strictly increasing and is
not one-to-one.
f(x)=𝑥2 → 𝑥1 <𝑥2
𝑥1 = −1 and 𝑥2 = 1
f(𝑥1 ) = 1
f(𝑥2 ) = 1
Course Name: DMGT School of Engineering, DSU 100
Examples
Example 4: Consider the function f(x) = −𝑥2 . For 𝑥1 = −1 and 𝑥2 =1, we have 𝑥1 <𝑥2 , but f(𝑥1 ) =
−1 and f(𝑥2 ) = −1, which are equal. So, this function is decreasing but not strictly decreasing
𝑥1 = −1 and 𝑥2 =1
f(𝑥1 ) = −1
f(𝑥2 ) = −1
Course Name: DMGT School of Engineering, DSU 101
NOTE: Constant Function
➢ A function f: A → B is said to be constant if and only if f (a) = c for every a belongs to A, where c is a
fixed element of B
➢ A function f from A to B is called onto, or a surjection, if and only if for every element b ∈ B there is
an element a ∈ A with f (a) = b. A function f is called surjective if it is onto.
➢ A function f:A→B is onto or surjective or a surjection iff its range is equal to its codomain (bB,
aA: f(a)=b).
Let f be the function from {a, b, c, d} to {1, 2, 3} defined by f (a) = 3, f (b) = 2, f (c) = 1, and f (d) = 3. Is
f an onto function?
Solution
➢ Because all three elements of the codomain are images of elements in the domain, we see that f is onto.
➢ Note that if the codomain were {1, 2, 3, 4}, then f would not be onto.
Let A = {1, 2, 3, 4} and B = {a, b, c, d} and f = {(1, a), (2, b), (3, c), (4, d)}. State whether the given
function f (if defined) is onto or not.
Solution
A B
It is an onto function. 1 a
2 b
3 c
4 d
Let A = {1, 2, 3} and B = {a, b, c, d} and f = {(1, a), (2, b), (3, c)}. State whether the given function f (if
defined) is onto or not.
Solution
A B
Let f be the function from {a, b, c, d} to {1, 2, 3, 4} with f (a) = 4, f (b) = 2, f (c) = 1, and f (d) = 3. Is f a
bijection?
Solution
A B
➢ The function f is one-to-one and onto. It is one-to-one because
a 1
no two values in the domain are assigned the same function
b 2
value. It is onto because all four elements of the codomain are c 3
d 4
images of elements in the domain. Hence, f is a bijection
➢ The function f is called the identity function if each element of set A has an image on itself i.e. f (a) = a
∀ a ∈ A.
➢ For any domain A, the identity function I:A→A (variously written, IA, 1, 1A) is the unique function such
that aA: I(a)=a.
➢ Note that the identity function is both one-to-one and onto (bijective).
➢ Consider, A = {1, 2, 3, 4, 5} and I: A → A such that I= {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)}.
➢ Let f be a one-to-one correspondence from the set A to the set B. The inverse function of f is the
function that assigns to an element b belonging to B the unique element a in A such that f (a) = b. The
➢ A one-to-one correspondence is called invertible because we can define an inverse of this function. A
function is not invertible if it is not a one-to-one correspondence, because the inverse of such a function
➢ Let f be the function from {a, b, c} to {1, 2, 3} such that f (a) = 2, f (b) = 3, and f (c) = 1. Is f invertible, and if it is, what
is its inverse?
Solution
The function f is invertible because it is a one-to-one correspondence. The inverse function f −1 reverses
the correspondence given by f , so f −1 (1) = c, f −1(2) = a, and f −1 (3) = b.
Solution
➢ The function f has an inverse because it is a one-to-one correspondence. suppose that y is the image of x, so
that
y = x+1
Therefore, x=y-1
Solution
Because f (−2) = f (2) = 4, f is not one-to-one. If an inverse function were defined, it would have to assign
two elements to 4. Hence, f is not invertible.
i) To each person on the earth, assign the number which correspond to his age.
ii) To each country in the world, assign the latitude and longitude of its capital.
Solution
i) Identity
ii) Constant
iii) Neither
Let A = {1, 2, 3} and B = {1, 2, 3, 4, 5}. Find whether the following functions from A to B are one-to-one and onto.
Solution
i) One-to-one
ii) Neither
Let A = {a1, a2, a3}, B = {b1, b2, b3}, C = {c1, c2}, d = {d1, d2, d3, d4}. Let 𝑓1 : A → B, 𝑓2 : A → D, 𝑓3 : B → C and 𝑓4 :
ii) One-to-One
iii) Onto
iv) Neither
➢ Two functions are equal when they have the same domain, have the same codomain, and map
each element of their common domain to the same element in their common codomain.
▪ f(x)=2x g(x)=x+x
For example:
▪ f(3)=2×3=6
▪ g(3)=3+3=6
▪ Since f(x)=g(x) for all x in R, we can conclude that f and g are equal functions.
Course Name: DMGT School of Engineering, DSU 119
Composition of Functions
Let g be a function from the set A to the set B and let f be a function from the set B to the set C. The
composition of the functions f and g, denoted for all a ∈ A by f ◦ g, is defined by:
(f ◦ g)(a) = f (g(a))
Let g be the function from the set {a, b, c} to itself such that g(a) = b, g(b) = c, and g(c) = a. Let f be the
function from the set {a, b, c} to the set {1, 2, 3} such that f (a) = 3, f (b) = 2, and f (c) = 1. What is the
composition of f and g, and what is the composition of g and f ?
Solution
Let the function f: A → B and g: B → C be denoted by the following arrow diagram. Find the
composition of g ◦ f: A→ C
Solution
i) (g ◦ f) a = g(f(a)) = g(y) = t
Hence, g ◦ f = {s, t}
Course Name: DMGT School of Engineering, DSU 122
Example 3
Solution
(g ◦ f) = g(f(x)) = g(2x + 1)
= 4𝑥 2 + 1 + 4x – 2
g(2x + 1) = 4𝑥 2 + 4x – 1
Hence, (g ◦ f) = 4𝑥 2 + 4x – 1
g: R → R and g(x) = 2x + 1
Find f ◦ g and g ◦ f
Solution
(f ◦ g) = 4𝑥 2 + 4x + 1
(g ◦ f) = 2𝑥 2 + 1
Solution
Domain of f : {1, 3, 4} Range of f : {2, 5, 1}
f ◦ g = { (2, 5), (5, 2), (1, 5)} g ◦ f = {(1, 3), (3, 1), (4, 3)}
Course Name: DMGT School of Engineering, DSU 125
Example 6
Let, f(n) = 𝑛2 g(n) = n + 1 h(n) = n – 1 Find h o f o g
Solution
h o f o g = h o f o (g(n))
= h o f o (n + 1)
= h o f (n + 1)
= h o (𝑛 + 1)2
= h (𝑛 + 1)2
= (𝑛 + 1)2 - 1
= 𝑛2 + 1 + 2n – 1
h o f o g = 𝑛2 + 2n
where 𝐼𝐴 and 𝐼𝐵 are the identity functions on the sets A and B, respectively. That is,
𝑓 −1 −1
=f
➢ For functions over numbers, we can represent an ordered pair (x,y) as a point on a plane. A function is
then drawn as a curve (set of points) with only one y for each x.
➢ A partial function f from a set A to a set B is an assignment to each element a in a subset of A, called
EXAMPLE
The function f : Z → R where f (n) = √n is a partial function from Z to R where the domain of definition
is the set of nonnegative integers. Note that f is undefined for negative integers.
➢ The floor function assigns to the real number x the largest integer that is less than or equal to x. The
➢ The ceiling function assigns to the real number x the smallest integer that is greater than or equal to x.
EXAMPLES
0.5 0 0.5 1
1.5 1 1.5 2
2.7 2 2.7 3
0.2 0 0.2 1
2.5 2 2.5 3
1. constant factors or
2. lower-order terms