MODULE-2 - Relations and Functions
MODULE-2 - Relations and Functions
MODULE-2
RELATIONS, AND FUNCTIONS
Relations and Functions: Cartesian Products and Relations.
Relations: Computer Recognition – Zero-One Matrices and Directed Graphs, Properties of
Relations, Equivalence Relations and Partitions, Partial Orders – Hasse Diagrams.
Functions: Plain and One-to- One, Onto Functions. Function Composition, and Inverse
Functions.
For sets A, B the Cartesian product, or Cross product, or Product set of A and B is denoted by
𝐴 × 𝐵. Thus, 𝐴 × 𝐵 = {(𝑎, 𝑏)|𝑎 ∈ 𝐴, 𝑏 ∈ 𝐵}.
Relations
For sets A, B, any subset of 𝐴 × 𝐵 is called a relation (ℛ) from A to B, where ℛ is a set of
ordered pair (𝑎, 𝑏) where 𝑎 ∈ 𝐴 and 𝑏 ∈ 𝐵 and is denoted as 𝑎ℛ𝑏.
If ℛ is a relation from 𝐴 to 𝐴, i.e. if ℛ is a subset of 𝐴 × 𝐴, then ℛ is a binary relation on 𝐴.
Note: For finite sets 𝐴, 𝐵 with |𝐴| = 𝑚 and |𝐵| = 𝑛, there are 2𝑚𝑛 relations from 𝐴 to 𝐵,
including the empty relation as well as the relation 𝐴 × 𝐵 itself.
Problems
1
22CDT45A
2
22CDT45A
2
(iii) No. of binary relations on A is 2𝑚𝑚 = 2𝑚 = 29 = 512.
(v) Since 𝐴 × 𝐵 contains 9 ordered pairs, the number of relations from A to B that contain
exactly five ordered pairs is precisely the number of ways of choosing five ordered pairs from
nine ordered pairs. This number is ⬚9 𝐶5 = 126 .
(vi) Similarly, the number of binary relations on A that contains at least seven elements (ordered
pairs) is ⬚9 𝐶7 +9 𝐶8 +9 𝐶9 = 46.
3
22CDT45A
Homework
1. For any non-empty sets A, B, C, prove that (𝐴 ∪ 𝐵) × 𝐶 = (𝐴 × 𝐶) ∪ (𝐵 × 𝐶).
2. Let A and B be sets with |𝐵| = 3. If there are 4096 relations from A to B, what is |𝐴|?
3. A binary relation 𝑅 on 𝑁 is defined recursively by (i) (0,0) ∈ 𝑅 and (ii) if (𝑠, 𝑡) ∈ 𝑅 then
(𝑠 + 1, 𝑡 + 7) ∈ 𝑅. Find 𝑅 as a set of ordered pairs.
4. Find x and y in each of the following cases:
(i) (2𝑥 − 3,3𝑦 + 1) = (5,7) (ii) (𝑥 + 2,4) = (5,2𝑥 + 𝑦) (iii) (𝑥, 𝑦) = (𝑥 2 , 𝑦 2 )
5. Let 𝐴 = {1,2,3,4}, 𝐵 = {2,5}, 𝑐 = {3,4,7}. Write down the following:
𝐴 × 𝐵, 𝐵 × 𝐴, 𝐴 ∪ (𝐵 × 𝐶), (𝐴 ∪ 𝐵) × 𝐶, (𝐴 × 𝐶) ∪ (𝐵 × 𝐶).
Matrix of a relation
Example: Consider the sets 𝐴 = {0,1,2} and 𝐵 = {𝑝, 𝑞} and the relation ℛ from 𝐴 to 𝐵 defined
by ℛ = {(0, 𝑝), (1, 𝑞), (2, 𝑝)}. Write the matrix of the relation ℛ.
Sol: Here, 𝐴 = {𝑎1 , 𝑎2 , 𝑎3 } and 𝐵 = {𝑏1 , 𝑏2 }, where 𝑎1 = 0, 𝑎2 = 1, 𝑎3 = 2, 𝑏1 = 𝑝, 𝑏2 = 𝑞.
𝑚11 = (𝑎1 , 𝑏1 ) = (0, 𝑝) = 1, because (0, 𝑝) ∈ ℛ
𝑚12 = (𝑎1 , 𝑏2 ) = (0, 𝑞) = 0, because (0, 𝑞) ∉ ℛ
𝑚21 = (𝑎2 , 𝑏1 ) = (1, 𝑝) = 0, because (1, 𝑝) ∉ ℛ
𝑚22 = (𝑎2 , 𝑏2 ) = (1, 𝑞) = 1, because (1, 𝑞) ∈ ℛ
𝑚31 = (𝑎3 , 𝑏1 ) = (2, 𝑝) = 1, because (2, 𝑝) ∈ ℛ
𝑚32 = (𝑎3 , 𝑏2 ) = (2, 𝑞) = 0, because (2, 𝑞) ∉ ℛ.
The matrix of the relation ℛ is,
1 0
𝑀ℛ = 𝑀(ℛ) = [0 1].
1 0
Digraph of a relation
• Let ℛ be a binary relation on a finite nonempty set 𝑉. A directed graph (or digraph) 𝐺 on
𝑉 is made up of the elements of 𝑉, called the vertices or nodes of 𝐺, and a subset 𝐸, of ℛ =
𝑉 × 𝑉, that contains the (directed) edges, or arcs, of 𝐺. The set 𝑉 is called the vertex set of
𝐺, and the set 𝐸 is called edge set. Then, graph is denoted by 𝐺 = (𝑉, 𝐸).
• If a relation is pictorially represented by a digraph, a vertex from which an edge leaves is
called the origin or the source for that edge, and a vertex where an edge end is called the
terminus or terminating vertex for that edge.
• A vertex which is neither a source nor a terminus of any edge is called an isolated vertex.
• An edge for which the source and the terminus are one and the same vertex is called a loop.
4
22CDT45A
• The number of edges (arrows) terminating at a vertex is called the in-degree of that vertex
and the number of edges (arrows) leaving a vertex is called the out-degree of that vertex.
Problems
1. Let 𝐴 = {1,2,3,4} and ℛ be a relation on 𝐴 defined by 𝑥ℛ𝑦 if and only if “𝑥 divides 𝑦”,
written 𝑥|𝑦.
(a) Write down ℛ as a set of ordered pairs.
(b) Draw the digraph of ℛ.
(c) Determine the in-degrees and out-degrees of the vertices in the diagraph.
Sol:
(a) By the definition of the given ℛ
ℛ = {(1,1), (1,2), (1,3), (1,4), (2,2), (2,4), (3,3), (4,4)}.
(b) The digraph of ℛ,
(c) In ℛ, for the vertices of 1,2,3,4, the in-degrees are 1,2,2,3 respectively and out-degrees are
4,2,1,1 respectively.
5
22CDT45A
The digraph of ℛ is
In ℛ, for the vertices of 1,2,3,4,6 the in-degrees are 5,3,2,1,1 respectively and out-degrees are
1,2,2,3,4 respectively.
The digraph of ℛ is
Homework
2. Find the relation represented by the digraph given below. Also, write down its matrix, and
determine the in-degrees and out-degrees of the vertices in the diagraph.
a)
6
22CDT45A
b)
Properties of Relations
Problem:
If 𝐴 = {1, 2, 3, 4,5}, give an example of a relation ℛ on 𝐴 that is
a) Reflexive and symmetric but not transitive
b) Reflexive and transitive but not symmetric
c) Symmetric and transitive but not reflexive.
Sol:
a) 𝑅1 = {(1,1), (2,2), (3,3), (4,4), (5,5), (1,5), (5,1), (5,3), (3,5)} is reflexive because of
(1,1), (2,2), (3,3), (4,4), (5,5), symmetric because of (1,5), (5,1), and (5,3), (3,5) but not
transitive because (1,5), (5,3) then (1,3) should be in relation 𝑅1 by transitive property. But
(1,3) ∉ 𝑅1 .
b) 𝑅2 = {(1,1), (2,2), (3,3), (4,4), (5,5), (1,5)} is reflexive; transitive because (1,5), (5,5) ⇒
(1,5) ∈ 𝑅2 which is true. But 𝑅2 is not symmetric because (1,5) ∈ 𝑅2 but (5,1) ∉ 𝑅2 .
7
22CDT45A
c) 𝑅3 = {(4,4), (5,5), (3,3), (1,5), (5,1), (1,1)} is symmetric because (1,5) ∈ 𝑅3 ⇒ (5,1) ∈
𝑅3 ; transitive because (1,5), (5,1) ⇒ (1,1) ∈ 𝑅3 but not reflexive because (2,2) ∉ 𝑅3 .
Proof:
(1) Suppose ℛ and 𝒮 are reflexive. Then (𝑎, 𝑎) ∈ ℛ and (𝑎, 𝑎) ∈ 𝒮 for all 𝑎 ∈ 𝐴.
Consequently, (𝑎, 𝑎) ∈ ℛ ∩ 𝒮 and (𝑎, 𝑎) ∈ ℛ ∪ 𝒮. Therefore, ℛ ∩ 𝒮 and ℛ ∪ 𝒮 are
reflexive.
(2) Suppose ℛ and 𝒮 are symmetric. Take any (𝑎, 𝑏) ∈ ℛ ∩ 𝒮. Then (𝑎, 𝑏) ∈ ℛ and (𝑎, 𝑏) ∈
𝒮. Therefore, (𝑏, 𝑎) ∈ ℛ and (𝑏, 𝑎) ∈ 𝒮. Consequently, (𝑏, 𝑎) ∈ ℛ ∩ 𝒮. Hence ℛ ∩ 𝒮 is
symmetric.
Next, take any (𝑥, 𝑦) ∈ ℛ ∪ 𝒮. Then, (𝑥, 𝑦) ∈ ℛ or (𝑥, 𝑦) ∈ 𝒮. Therefore, (𝑦, 𝑥) ∈ ℛ or
(𝑦, 𝑥) ∈ 𝒮. Consequently, (𝑦, 𝑥) ∈ ℛ ∪ 𝒮. Hence ℛ ∪ 𝒮 is symmetric.
(3) Suppose ℛ and 𝒮 are antisymmetric. Take any (𝑎, 𝑏), (𝑏, 𝑎) ∈ ℛ ∩ 𝒮. Then, (𝑎, 𝑏), (𝑏, 𝑎) ∈
ℛ and (𝑎, 𝑏), (𝑏, 𝑎) ∈ 𝒮. By the antisymmetric of ℛ (or 𝒮), it follows that 𝑏 = 𝑎. Thus, ℛ ∩
𝒮 is antisymmetric.
(4) Suppose ℛ and 𝒮 are transitive. Take any (𝑎, 𝑏), (𝑏, 𝑐) ∈ ℛ ∩ 𝒮. Then, (𝑎, 𝑏) ∈ ℛ, (𝑎, 𝑏) ∈
𝒮, (𝑏, 𝑐) ∈ ℛ, (𝑏, 𝑐) ∈ 𝒮. These yield (𝑎, 𝑐) ∈ ℛ and (𝑎, 𝑐) ∈ 𝒮, so that (𝑎, 𝑐) ∈ ℛ ∩ 𝒮.
Therefore, ℛ ∩ 𝒮 is transitive.
Homework
1. Determine the number of relations on 𝐴 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒} that are (a) reflexive (b) symmetric
(c) reflexive and symmetric (d) antisymmetric (e) asymmetric (f) irreflexive.
2. If 𝐴 = {1, 2, 3, 4}, give an example of a relation ℛ on 𝐴 that is
a) Reflexive and symmetric but not transitive
b) Reflexive and transitive but not symmetric
c) Symmetric and transitive but not reflexive.
Equivalence Relations
Example. Let 𝐴 = {1,2,3,4} and 𝑅 = {(1,1), (1,2), (2,1), (2,2), (3,4), (4,3), (3,3), (4,4)} be a
relation on A. Verify that R is an equivalence relation.
Sol: Firstly we note that, (1,1), (2,2), (3,3), (4,4) belong to R. That is, (𝑎, 𝑎) ∈ 𝑅 for all 𝑎 ∈ 𝐴.
Therefore, 𝑅 is a reflexive relation.
Next, we note that (1,2), (2,1) ∈ 𝑅 and (3,4), (4,3) ∈ 𝑅.
8
22CDT45A
Equivalence Classes
Let R be an equivalence relation on a set A and a ∈ A. Then the set of all those elements x of
A which are related to a by R is called the equivalence class of a with respect to R. This
equivalence class is denoted by 𝑅(𝑎), or [𝑎], or 𝑎̅ . Thus,
𝑎̅ = [a] =R(a) = {x ∈ A | (x,a) ∈ R}
Example. Consider the equivalence relation
R = {(1,1), (1,3), (2,2), (3,1), (3,3)}
Defined on the set A = {1,2,3}.
We find that the elements x of A for which (x,1) ∈ R are x =1, x=3.
Therefore, {1,3} is the equivalence class of 1 (with respect to R); that is,
[1] = {1,3}.
Similarly,
[2] = {2}, [3] = {1,3}.
Partition of a Set
Let A be a nonempty set. Suppose there exist nonempty subsets A1, A2, A3,…, Ak of A such
that the following two condition hold:
(1) A is the union of A1, A2,…, Ak; that is, A=A1 ∪ A2 ∪ A3 ∪ . . . ∪ Ak.
(2) Any two of the subsets A1, A2,…, Ak are disjoint; that is, Ai ∩ Aj =∅ for i ≠ j.
Then the set P = {A1, A2, A3, . . . , Ak} is called a partition of A. Also, A1, A2, A3,…, Ak are
called the blocks or cells of the partition.
Example.
9
22CDT45A
Problems
10
22CDT45A
Sol:(a) For all (x,y) ∈ A × A, we have 𝑥 + 𝑦 = 𝑥 + 𝑦; that is, (x,y) R (x,y). Therefore, R is
reflexive.
Next, take any (𝑥1 , 𝑦1 ) (𝑥2 , 𝑦2 ) ∈ 𝐴 × 𝐴 and suppose that (𝑥1 , 𝑦1 )R(𝑥2 , 𝑦2 ).
Then 𝑥1 + 𝑦1 = 𝑥2 + 𝑦2 . This gives 𝑥2 + 𝑦2 = 𝑥1 + 𝑦1 which means that (𝑥2 , 𝑦2 )R(𝑥1 , 𝑦1 ).
Therefore, R is symmetric.
Next, take any (𝑥1 , 𝑦1 )(𝑥2 , 𝑦2 )(𝑥3 , 𝑦3 ) ∈ 𝐴 × 𝐴 and suppose that (𝑥1 , 𝑦1 )R(𝑥2 , 𝑦2 ). Thus, R is
reflexive, symmetric and transitive. Therefore, R is an Equivalence relation.
(c) To determine the partition induced by R, we have to find the equivalence classes of all
elements (x, y), of A × A, w.r.t R. From what has been found above, we note that
[(1,1)] = {[(1,1)]},
[(1,3)] = [(2,2)] = [(3,1)],
[(2,4)] = [(1,5)] = [(3,3)] = [(4,2)] = [(5,1)].
Homework
1. Define ℛ on 𝐴 = {1,2,3,4,5,6,7} by (𝑥, 𝑦) ∈ ℛ if 𝑥 − 𝑦 is a multiple of 3.
(a) Show that ℛ is an equivalence relation on 𝐴.
(b) Determine the equivalence classes and partition of 𝐴 induced by ℛ.
11
22CDT45A
(−4, −20), (−3, −9), (−2, −4), (−1, −11), (−1, −3),
2. For 𝐴 = { } define the relation ℛ on 𝐴
(1,2), (1,5), (2,10), (2,14), (3,6), (4,8), (4,12)
by (𝑎, 𝑏)ℛ(𝑐, 𝑑) if 𝑎𝑑 = 𝑏𝑐.
(a) Verify that ℛ is an equivalence relation on 𝐴.
(b) Find the equivalence classes [(2,14)], [(−3, −9)] and [(4,8)].
(c) How many cells are there in the partition of 𝐴 induced by ℛ?
A set 𝐴 with a partial order ℛ defined on it is called a partially ordered set or an ordered set
or a poset, and is denoted by the pair (𝐴, ℛ).
The digraph of a partial order drawn is called a poset diagram or the Hasse diagram for the
partial order.
Example:
Let 𝐴 = {1,2,3,4} and ℛ = {(1,1, ), (1,2), (2,2), (2,4), (1,3), (3,3), (3,4), (1,4), (4,4)}. Verify
that ℛ is a partial order on 𝐴. Also, write down the Hasse diagram for ℛ.
Sol: The given relation ℛ is reflexive and transitive. Further, ℛ does not contain ordered pairs
of the form (𝑎, 𝑏) and (𝑏, 𝑎) with 𝑏 = 𝑎. Therefore, ℛ is antisymmetric. As such, ℛ is a partial
order on 𝐴.
Hasse diagram:
12
22CDT45A
Problems:
1. Let 𝐴 = {1,2,3,4,6,12}. On 𝐴, define the relation ℛ by 𝑎ℛ𝑏 if and only if ‘𝑎 divides 𝑏’.
Prove that ℛ is a partial order on 𝐴. Draw the Hasse diagram for this relation and matrix of ℛ.
Sol: Given, ℛ = {(𝑎, 𝑏)|𝑎, 𝑏 ∈ 𝐴 and 𝑎 divides 𝑏}
(1,1), (1,2), (1,3), (1,4), (1,6), (1,12), (2,2), (2,4), (2,6), (2,12),
={ }.
(3,3), (3,6), (3,12), (4,4), (4,12), (6,6), (6,12), (12,12)
We see that,
(i) there is (𝑎, 𝑎) ∈ ℛ for all 𝑎 ∈ 𝐴 ⇒ ℛ is reflexive.
(ii) if (𝑎, 𝑏) ∈ ℛ and (𝑏, 𝑐) ∈ ℛ then (𝑎, 𝑐) ∈ ℛ ⇒ ℛ is transitive.
(iii) for all 𝑎, 𝑏 ∈ 𝐴, if 𝑎 divides 𝑏 and 𝑏 divides 𝑎, then 𝑎 = 𝑏 ⇒ ℛ is antisymmetric.
Therefore, ℛ is a partial order on a set 𝐴.
Hasse diagram:
Matrix of ℛ
1 1 1 1 1 1
0 1 0 1 1 1
0 0 1 0 1 1.
𝑀ℛ =
0 0 0 1 0 1
0 0 0 0 1 1
[0 0 0 0 0 1]
Hasse diagram:
13
22CDT45A
3. The Hasse diagram of a partial order ℛ on the set 𝐴 = {1,2,3,4,5,6} is as given below. Write
down ℛ as a subset of 𝐴 × 𝐴. Construct its digraph.
Digraph:
4. Draw the Hasse diagram of the relation ℛ on 𝐴 = {1,2,3,4,5} whose matrix is given below:
1 0 1 1 1
0 1 1 1 1
𝑀ℛ = 0 0 1 1 1 .
0 0 0 1 0
[0 0 0 0 1]
(1,1), (1,3), (1,4), (1,5), (2,2), (2,3), (2,4),
Sol: Given, ℛ = { }.
(2,5), (3,3), (3,4), (3,5), (5,5), (4,4)
Hasse diagram:
Homework:
1. Let 𝐴 = {1,2,3,4}. On 𝐴, define the relation ℛ by 𝑥ℛ𝑦 if and only if ‘𝑥 divides 𝑦’. Prove
that (𝐴, ℛ) is a poset. Draw the Hasse diagram for this relation and matrix of ℛ.
2. Let 𝐴 = {1,2,3,4,6,8,12}. And ℛ be a partial order on 𝐴 defined 𝑎ℛ𝑏 if and only if ‘𝑎
divides 𝑏’.
(a) Draw the Hasse diagram of the poset (𝐴, ℛ)
(b) Determine the relational matrix for ℛ
14
22CDT45A
𝑓(𝑎) = 𝑏
A B
15
22CDT45A
❖ A function 𝑓: 𝐴 → 𝐵 is called onto, or surjective, if 𝑓(𝐴) = 𝐵 that is, if for all 𝑏 ∈ 𝐵 there
is at least one 𝑎 ∈ 𝐴 with 𝑓(𝑎) = 𝑏.
Problems:
1. Let 𝑓: 𝑅 ⟶ 𝑅 be defined by
3𝑥 − 5, 𝑥>0
𝑓(𝑥) = {
−3𝑥 + 1, 𝑥≤0
5 −5
(i) Determine 𝑓(0), 𝑓(−1), 𝑓 (3), 𝑓 ( 3 ).
(ii) Find 𝑓 −1 (0), 𝑓 −1 (1), 𝑓 −1 (−1), 𝑓 −1 (3), 𝑓 −1 (−3), 𝑓 −1 (−6).
(iii) What are 𝑓 −1 ([−5,5]) and 𝑓 −1 ([−6,5]) ?
Sol: (i) By definition,
𝑓(0) = (−3 × 0) + 1 = 1, 𝑓(−1) = (−3 × −1) + 1 = 4
5 5 −5 −5
𝑓 (3) = (3 × 3) − 5 = 0, 𝑓 ( 3 ) = (−3 × ) + 1 = 6.
3
16
22CDT45A
5 5
(ii) By definition, we find that 𝑓(𝑥) = 0 only when 𝑥 = 3. ∴ 𝑓 −1 (0) = {3}. (Observe that
𝑓(𝑥) ≠ 0 for 𝑥 ≤ 0).
Similarly, 𝑓 −1 (1) = {𝑥 ∈ 𝑅| 𝑓(𝑥) = 1} = {2,0},
4
𝑓 −1 (−1) = {𝑥 ∈ 𝑅| 𝑓(𝑥) = −1} = {3} Observe that 𝑓(𝑥) ≠ −1 when 𝑥 ≤ 0.
8 −2
𝑓 −1 (3) = {𝑥 ∈ 𝑅| 𝑓(𝑥) = 3} = {3 , }.
3
2
𝑓 −1 (−3) = {3}.
𝑓 −1 (−6) = ∅, because 𝑓(𝑥) ≠ −6 for any 𝑥 ∈ 𝑅.
17
22CDT45A
Sol:
(1) 𝑓 −1 (𝐶 ∪ 𝐷) = {𝑥 ∈ 𝑋|𝑓(𝑥) ∈ 𝐶 ∪ 𝐷}.
Therefore, for any 𝑥 ∈ 𝐴,
𝑥 ∈ 𝑓 −1 (𝐶 ∪ 𝐷) ⇔ 𝑓(𝑥) ∈ {𝐶 ∪ 𝐷}
⇔ 𝑓(𝑥) ∈ 𝐶 or 𝑓(𝑥) ∈ 𝐷
⇔ 𝑥 ∈ 𝑓 −1 (𝐶) or 𝑥 ∈ 𝑓 −1 (𝐷)
⇔ 𝑥 ∈ {𝑓 −1 (𝐶) ∪ 𝑓 −1 (𝐷)}
∴ 𝑓 −1 (𝐶 ∪ 𝐷) = 𝑓 −1 (𝐶) ∪ 𝑓 −1 (𝐷).
(2) Similarly, for any 𝑥 ∈ 𝐴,
𝑥 ∈ 𝑓 −1 (𝐶 ∩ 𝐷) ⇔ 𝑓(𝑥) ∈ {𝐶 ∩ 𝐷}
⇔ 𝑓(𝑥) ∈ 𝐶 and 𝑓(𝑥) ∈ 𝐷
⇔ 𝑥 ∈ 𝑓 −1 (𝐶) and 𝑥 ∈ 𝑓 −1 (𝐷)
⇔ 𝑥 ∈ {𝑓 −1 (𝐶) ∩ 𝑓 −1 (𝐷)}
∴ 𝑓 −1 (𝐶 ∩ 𝐷) = 𝑓 −1 (𝐶) ∩ 𝑓 −1 (𝐷).
(3) Likewise, for any 𝑥 ∈ 𝐴,
𝑥 ∈ 𝑓 −1 (𝐶̅ ) ⇔ 𝑓(𝑥) ∈ 𝐶̅
⇔ 𝑓(𝑥) ∉ 𝐶
⇔ 𝑥 ∉ 𝑓 −1 (𝐶)
⇔𝑥∈𝑓 ̅̅̅̅̅̅̅̅̅
−1 (𝐶)
∴ 𝑓 −1 (𝐶̅ ) = 𝑓̅̅̅̅̅̅̅̅̅
−1 (𝐶)
Homework
1. Let 𝐴 = {1,2,3,4,5,6} and 𝐵 = {6,7,8,9,10}. If a function 𝑓: 𝐴 → 𝐵 is defined by 𝑓 =
{(1,7), (2,7), (3,8), (4,6), (5,9), (6,9)}, determine 𝑓 −1 (6) and 𝑓 −1 (9). If 𝐵1 = {7,8} and
𝐵2 = {8,9,10}, find 𝑓 −1 (𝐵1 ) and 𝑓 −1 (𝐵2 ).
18
22CDT45A
❖ The function 𝐼𝐴 : 𝐴 → 𝐴, defined by 𝐼𝐴 (𝑎) = 𝑎 for all 𝑎 ∈ 𝐴, is called the identity function
of 𝐴.
❖ If 𝑓, 𝑔: 𝐴 → 𝐵, we say that 𝑓 and 𝑔 are equal and write 𝑓 = 𝑔, if 𝑓(𝑎) = 𝑔(𝑎) for all 𝑎 ∈
𝐴.
❖ If 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 → 𝐶, then composition function, which is denoted 𝑔 ∘ 𝑓: 𝐴 → 𝐶 by
(𝑔 ∘ 𝑓)(𝑎) = 𝑔(𝑓(𝑎)), for each 𝑎 ∈ 𝐴.
19
22CDT45A
Theorem. Let 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 → 𝐶 be any two functions. Then the following are true:
(1) If 𝑓 and 𝑔 are one-to-one, so is 𝑔 ∘ 𝑓. (2) If 𝑔 ∘ 𝑓 is one-to-one, then 𝑓 is one-to-one.
(2) If 𝑓 and 𝑔 are onto, so is 𝑔 ∘ 𝑓. (4) If 𝑔 ∘ 𝑓 is onto, then g is onto.
(3) Take any 𝑐 𝜖 𝐶. Since 𝑔 is onto, there is some 𝑏 𝜖 𝐵 such that 𝑔(𝑏) = 𝑐. Since 𝑏 𝜖 𝐵
and f is onto, there is some 𝑎 𝜖 𝐴 such that 𝑓(𝑎) = (𝑏). Consequently,
(𝑔 ∘ 𝑓 )(𝑎) = 𝑔(𝑓(𝑎)) = 𝑔(𝑏) = 𝑐.
Thus, for any 𝑐 𝜖 𝐶, there is some 𝑎 𝜖 𝐴 such that (𝑔 ∘ 𝑓 )(𝑎) = 𝑐.
Therefore, 𝑔 ∘ 𝑓 is onto.
(4) Take any 𝑐 𝜖 𝐶.
Since 𝑔 ∘ 𝑓 ∶ 𝐴 → 𝐶 is onto, there is some 𝑎 𝜖 𝐴, such that 𝑔(𝑓(𝑎)) = 𝑐.
Since 𝑓 (𝑎) 𝜖 𝐵, this means that , given any 𝑐 𝜖 𝐶, there is an element 𝑓(𝑎) in 𝐵 such
that 𝑔(𝑓(𝑎)) = 𝑐. Therefore, 𝑔 is onto.
Problem: Let 𝐴 = 𝐵 = ℛ, the set of all real numbers, and the functions 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 →
1
3 1 3
𝐴 be defined by 𝑓(𝑥) = 2𝑥 − 1, ∀𝑥 ∈ 𝐴, 𝑔(𝑦) = {2 (𝑦 + 1)} , ∀𝑦 ∈ 𝐵. Show that each of 𝑓
and 𝑔 is the inverse of the other.
Sol: For any 𝑥 ∈ 𝐴,
1
1
(𝑔 ∘ 𝑓)(𝑥) = 𝑔(𝑓(𝑥)) = 𝑔(𝑦) = { (𝑦 + 1)}3 , where 𝑦 = 𝑓(𝑥)
2
1
1 3
= {2 (2𝑥 3 − 1 + 1)} , because 𝑦 = 𝑓(𝑥) = 2𝑥 3 − 1
= 𝑥.
Thus, 𝑔 ∘ 𝑓 = 𝐼𝐴 .
Next, for any 𝑦 ∈ 𝐵,
1
1 3
(𝑓 ∘ 𝑔)(𝑦) = 𝑓(𝑔(𝑦)) = 𝑓 ({ (𝑦 + 1)} )
2
1 3
1 3
= 2 ({2 (𝑦 + 1)} ) − 1
1
= 2 {2 (𝑦 + 1)} − 1
= 𝑦.
Thus, 𝑓 ∘ 𝑔 = 𝐼𝐵 .
Hence, each of 𝑓 and 𝑔 is the inverse of the other.
Homework
1. Let 𝑓 and 𝑔 be the function from ℛ to ℛ defined by 𝑓(𝑥) = 𝑎𝑥 + 𝑏 and 𝑔(𝑥) = 1 − 𝑥 + 𝑥 2 .
If (𝑔 ∘ 𝑓 )(𝑥) = 9𝑥 2 − 9𝑥 + 3, determine 𝑎, 𝑏.
2. Consider the functions 𝑓 and 𝑔 defined by 𝑓(𝑥) = 𝑥 3 and 𝑔(𝑥) = 𝑥 2 + 1, ∀𝑥 ∈ ℛ. Find
𝑔 ∘ 𝑓, 𝑓 ∘ 𝑔, 𝑓 2 and 𝑔2 .
3. Let 𝐴 = {𝑥|𝑥 𝑖𝑠 𝑟𝑒𝑎𝑙 𝑎𝑛𝑑 𝑥 ≥ −1}, and 𝐵 = {𝑥|𝑥 𝑖𝑠 𝑟𝑒𝑎𝑙 𝑎𝑛𝑑 𝑥 ≥ 0}. Consider the
function 𝑓: 𝐴 → 𝐵 defined by 𝑓(𝑎) = √𝑎 + 1, for all 𝑎 ∈ 𝐴. Show that 𝑓 is invertible and
determine 𝑓 −1 .
1
4. Let 𝐴 = 𝐵 = 𝐶 = 𝑅, and 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 → 𝐶 be defined by 𝑓(𝑎) = 2𝑎 + 1, 𝑔(𝑏) = 3 𝑏,
∀𝑎 ∈ 𝐴, ∀𝑏 ∈ 𝐵. Compute 𝑔 ∘ 𝑓 and show that 𝑔 ∘ 𝑓 is invertible. What is (𝑔 ∘ 𝑓)−1?
21