Class 12 Mathematics · Chapter 1 · Relations and Functions · 26 solved examples · Session 2026-27
Example 1
Let A be the set of all students of a boys school. Show that the relation R in A given by R = {(a, b) : a is sister of b} is the empty relation and R′ = {(a, b) : the difference between heights of a and b is less than 3 metres} is the universal relation.
Solution
A contains only boys, so no student a can be the sister of any student b.
Hence no ordered pair satisfies the condition, giving R = φ — the empty relation.
For R′, the height difference of any two students of a school is certainly less than 3 metres.
So every pair (a, b) ∈ A × A satisfies the condition.
Therefore R′ = A × A, the universal relation.
Example 2
Let T be the set of all triangles in a plane with R a relation in T given by R = {(T₁, T₂) : T₁ is congruent to T₂}. Show that R is an equivalence relation.
Solution
Reflexive: every triangle is congruent to itself, so (T, T) ∈ R.
Symmetric: if T₁ ≅ T₂ then T₂ ≅ T₁.
Transitive: if T₁ ≅ T₂ and T₂ ≅ T₃ then T₁ ≅ T₃.
All three properties hold, so R is an equivalence relation.
Example 3
Let L be the set of all lines in a plane and R be the relation in L defined as R = {(L₁, L₂) : L₁ is perpendicular to L₂}. Show that R is symmetric but neither reflexive nor transitive.
Solution
Symmetric: if L₁ ⊥ L₂ then L₂ ⊥ L₁.
Not reflexive: a line is never perpendicular to itself, so (L, L) ∉ R.
Not transitive: if L₁ ⊥ L₂ and L₂ ⊥ L₃, then L₁ is parallel to L₃, not perpendicular.
Hence R is symmetric only.
Example 4
Show that the relation R in the set {1, 2, 3} given by R = {(1, 1), (2, 2), (3, 3), (1, 2), (2, 3)} is reflexive but neither symmetric nor transitive.
Solution
Reflexive: (1,1), (2,2), (3,3) all belong to R.
Not symmetric: (1,2) ∈ R but (2,1) ∉ R.
Not transitive: (1,2) ∈ R and (2,3) ∈ R, but (1,3) ∉ R.
Example 5
Show that the relation R in the set Z of integers given by R = {(a, b) : 2 divides a − b} is an equivalence relation.
Solution
Reflexive: a − a = 0 and 2 divides 0.
Symmetric: if 2 | (a − b) then 2 | (b − a), since b − a = −(a − b).
Transitive: if 2 | (a − b) and 2 | (b − c), then 2 | [(a − b) + (b − c)] = (a − c).
Hence R is an equivalence relation.
Example 6
Let R be the relation defined in the set A = {1, 2, 3, 4, 5, 6, 7} by R = {(a, b) : both a and b are either odd or even}. Show that R is an equivalence relation. Further, show that all the elements of the subset {1, 3, 5, 7} are related to each other and all the elements of the subset {2, 4, 6} are related to each other, but no element of {1, 3, 5, 7} is related to any element of {2, 4, 6}.
Solution
Reflexive: a and a always have the same parity.
Symmetric: if a, b have the same parity, so do b, a.
Transitive: if a, b share parity and b, c share parity, then a, c share parity.
So R is an equivalence relation.
All of {1, 3, 5, 7} are odd, hence mutually related; all of {2, 4, 6} are even, hence mutually related.
An odd and an even number have different parity, so no cross pair belongs to R.
Example 7
Let A be the set of all 50 students of Class X in a school. Let f : A → N be function defined by f(x) = roll number of the student x. Show that f is one-one but not onto.
Solution
No two different students of the class can have the same roll number, so f is one-one.
Roll numbers run from 1 to 50, so the range of f is {1, …, 50}.
51 ∈ N is not the image of any student.
Hence f is one-one but not onto.
Example 8
Show that the function f : N → N, given by f(x) = 2x, is one-one but not onto.
Solution
One-one: f(x₁) = f(x₂) ⇒ 2x₁ = 2x₂ ⇒ x₁ = x₂.
Not onto: for 1 ∈ N there is no x ∈ N with 2x = 1.
Example 9
Prove that the function f : R → R, given by f(x) = 2x, is one-one and onto.
Solution
One-one: f(x₁) = f(x₂) ⇒ 2x₁ = 2x₂ ⇒ x₁ = x₂.
Onto: given any y ∈ R, take x = y/2 ∈ R; then f(x) = 2(y/2) = y.
Hence f is bijective.
Example 10
Show that the function f : N → N, given by f(1) = f(2) = 1 and f(x) = x − 1, for every x > 2, is onto but not one-one.
Solution
Not one-one: f(1) = f(2) = 1 although 1 ≠ 2.
Onto: for any y ∈ N with y ≠ 1, choose x = y + 1 (> 2); then f(y + 1) = y.
And for y = 1 we have f(1) = 1.
Every element of N has a pre-image, so f is onto but not one-one.
Example 11
Show that the function f : R → R, defined as f(x) = x², is neither one-one nor onto.
Solution
Not one-one: f(−1) = 1 = f(1) while −1 ≠ 1.
Not onto: −2 in the co-domain R is not the square of any real number, since x² ≥ 0.
Example 12
Show that f : N → N, given by f(x) = x + 1 if x is odd, and x − 1 if x is even, is both one-one and onto.
Solution
Suppose f(x₁) = f(x₂). If x₁ is odd and x₂ even, then x₁ + 1 = x₂ − 1, i.e. x₂ − x₁ = 2 — impossible, since one is odd and one even.
The opposite parity case is ruled out similarly. So x₁, x₂ have the same parity.
If both odd: x₁ + 1 = x₂ + 1 ⇒ x₁ = x₂. If both even: x₁ − 1 = x₂ − 1 ⇒ x₁ = x₂. Hence one-one.
Onto: any odd number 2r + 1 is the image of the even number 2r + 2; any even number 2r is the image of the odd number 2r − 1.
So f is bijective.
Example 13
Show that an onto function f : {1, 2, 3} → {1, 2, 3} is always one-one.
Solution
Suppose, for contradiction, that f is not one-one.
Then two elements, say 1 and 2, have the same image; and 3 has one image.
So the range contains at most two elements of the co-domain {1, 2, 3}.
That contradicts f being onto.
Hence f must be one-one.
Example 14
Show that a one-one function f : {1, 2, 3} → {1, 2, 3} must be onto.
Solution
Since f is one-one, the three elements of the domain go to three distinct elements of the co-domain.
The co-domain has exactly three elements, so all of them are used.
Hence f is onto. (For a finite set X, one-one ⇔ onto for f : X → X.)
Example 15
Let f : {2, 3, 4, 5} → {3, 4, 5, 9} and g : {3, 4, 5, 9} → {7, 11, 15} be functions defined as f(2) = 3, f(3) = 4, f(4) = f(5) = 5 and g(3) = g(4) = 7 and g(5) = g(9) = 11. Find gof.
Solution
Apply f first, then g.
gof(2) = g(f(2)) = g(3) = 7.
gof(3) = g(f(3)) = g(4) = 7.
gof(4) = g(f(4)) = g(5) = 11.
gof(5) = g(f(5)) = g(5) = 11.
gof = {(2, 7), (3, 7), (4, 11), (5, 11)}.
Example 16
Find gof and fog, if f : R → R and g : R → R are given by f(x) = cos x and g(x) = 3x². Show that gof ≠ fog.
fog(y) = f((y − 3)/4) = 4·(y − 3)/4 + 3 = y, so fog = I_Y.
Hence f is invertible with f⁻¹(y) = (y − 3)/4.
Example 18
If R₁ and R₂ are equivalence relations in a set A, show that R₁ ∩ R₂ is also an equivalence relation.
Solution
Reflexive: (a, a) ∈ R₁ and (a, a) ∈ R₂ for all a, hence (a, a) ∈ R₁ ∩ R₂.
Symmetric: (a, b) ∈ R₁ ∩ R₂ ⇒ (a, b) is in both ⇒ (b, a) is in both ⇒ (b, a) ∈ R₁ ∩ R₂.
Transitive: (a, b), (b, c) ∈ R₁ ∩ R₂ ⇒ (a, c) ∈ R₁ and (a, c) ∈ R₂ ⇒ (a, c) ∈ R₁ ∩ R₂.
So R₁ ∩ R₂ is an equivalence relation.
Example 19
Let R be a relation on the set A of ordered pairs of positive integers defined by (x, y) R (u, v) if and only if xv = yu. Show that R is an equivalence relation.
Solution
Reflexive: xy = yx, so (x, y) R (x, y).
Symmetric: if xv = yu then uy = vx, so (u, v) R (x, y).
Transitive: let (x, y) R (u, v) and (u, v) R (a, b), i.e. xv = yu and ub = va.
From the first, u = xv/y; substituting into the second gives (xv/y)b = va ⇒ xb = ya.
Hence (x, y) R (a, b).
So R is an equivalence relation.
Example 20
Let X = {1, 2, …, 9}. Let R₁ be a relation in X given by R₁ = {(x, y) : x − y is divisible by 3} and R₂ = {(x, y) : {x, y} ⊂ {1, 4, 7}} ∪ {(x, y) : {x, y} ⊂ {2, 5, 8}} ∪ {(x, y) : {x, y} ⊂ {3, 6, 9}}. Show that R₁ = R₂.
Solution
x − y is divisible by 3 exactly when x and y leave the same remainder on division by 3.
R is an equivalence relation, since it is inherited from equality in Y.
Example 22
Find the number of all one-one functions from set A = {1, 2, 3} to itself.
Solution
A one-one function from a finite set to itself is a bijection, i.e. a permutation.
The number of permutations of 3 distinct elements is 3!.
Number of one-one functions = 3! = 6.
Example 23
Let A = {1, 2, 3}. Then show that the number of relations containing (1, 2) and (2, 3) which are reflexive and transitive but not symmetric is three.
Solution
Reflexivity forces (1,1), (2,2), (3,3) ∈ R; we are also given (1,2), (2,3) ∈ R.
Transitivity with (1,2) and (2,3) forces (1,3) ∈ R.
So the smallest candidate is R₁ = {(1,1),(2,2),(3,3),(1,2),(2,3),(1,3)} — transitive, not symmetric. ✓
We may additionally add (2,1) — giving R₂ — while keeping transitivity and losing symmetry overall. ✓
Or add (3,2) instead — giving R₃. ✓
Adding both (2,1) and (3,2) would make R symmetric, which is disallowed.
Hence there are exactly three such relations.
Example 24
Show that the number of equivalence relations in the set {1, 2, 3} containing (1, 2) and (2, 1) is two.
Solution
Any equivalence relation contains (1,1), (2,2), (3,3); we are given (1,2) and (2,1).
Case 1: R = {(1,1),(2,2),(3,3),(1,2),(2,1)}. Partition {1,2} and {3}. ✓
Case 2: bring 3 into the same class, giving the universal relation A × A. ✓
Any relation strictly between the two would break transitivity or symmetry.
So exactly two such equivalence relations exist.
Example 25
Consider the identity function I_N : N → N defined as I_N(x) = x ∀ x ∈ N. Show that although I_N is onto but I_N + I_N : N → N defined as (I_N + I_N)(x) = I_N(x) + I_N(x) = x + x = 2x is not onto.
Solution
I_N is onto: for any y ∈ N, I_N(y) = y, so y has a pre-image.
Now (I_N + I_N)(x) = 2x, whose range is the set of even natural numbers.
The odd number 1 ∈ N has no pre-image, since 2x = 1 has no natural solution.
So the sum of two onto functions need not be onto.
Example 26
Consider a function f : [0, π/2] → R given by f(x) = sin x and g : [0, π/2] → R given by g(x) = cos x. Show that f and g are one-one, but f + g is not one-one.
Solution
On [0, π/2], sin x is strictly increasing, so f is one-one.
On [0, π/2], cos x is strictly decreasing, so g is one-one.