Skip to content

Ch 1 · Relations and Functions

Solved Examples

Exercise 1 of 4

NCERT Solutions – Solved Examples

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
  1. A contains only boys, so no student a can be the sister of any student b.
  2. Hence no ordered pair satisfies the condition, giving R = φ — the empty relation.
  3. For R′, the height difference of any two students of a school is certainly less than 3 metres.
  4. 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
  1. Reflexive: every triangle is congruent to itself, so (T, T) ∈ R.
  2. Symmetric: if T₁ ≅ T₂ then T₂ ≅ T₁.
  3. 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
  1. Symmetric: if L₁ ⊥ L₂ then L₂ ⊥ L₁.
  2. Not reflexive: a line is never perpendicular to itself, so (L, L) ∉ R.
  3. 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
  1. Reflexive: (1,1), (2,2), (3,3) all belong to R.
  2. Not symmetric: (1,2) ∈ R but (2,1) ∉ R.
  3. 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
  1. Reflexive: a − a = 0 and 2 divides 0.
  2. Symmetric: if 2 | (a − b) then 2 | (b − a), since b − a = −(a − b).
  3. 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
  1. Reflexive: a and a always have the same parity.
  2. Symmetric: if a, b have the same parity, so do b, a.
  3. Transitive: if a, b share parity and b, c share parity, then a, c share parity.
  4. So R is an equivalence relation.
  5. All of {1, 3, 5, 7} are odd, hence mutually related; all of {2, 4, 6} are even, hence mutually related.
  6. 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
  1. No two different students of the class can have the same roll number, so f is one-one.
  2. Roll numbers run from 1 to 50, so the range of f is {1, …, 50}.
  3. 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
  1. One-one: f(x₁) = f(x₂) ⇒ 2x₁ = 2x₂ ⇒ x₁ = x₂.
  2. 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
  1. One-one: f(x₁) = f(x₂) ⇒ 2x₁ = 2x₂ ⇒ x₁ = x₂.
  2. 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
  1. Not one-one: f(1) = f(2) = 1 although 1 ≠ 2.
  2. Onto: for any y ∈ N with y ≠ 1, choose x = y + 1 (> 2); then f(y + 1) = y.
  3. 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
  1. Not one-one: f(−1) = 1 = f(1) while −1 ≠ 1.
  2. 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
  1. 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.
  2. The opposite parity case is ruled out similarly. So x₁, x₂ have the same parity.
  3. If both odd: x₁ + 1 = x₂ + 1 ⇒ x₁ = x₂. If both even: x₁ − 1 = x₂ − 1 ⇒ x₁ = x₂. Hence one-one.
  4. 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
  1. Suppose, for contradiction, that f is not one-one.
  2. Then two elements, say 1 and 2, have the same image; and 3 has one image.
  3. So the range contains at most two elements of the co-domain {1, 2, 3}.
  4. 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
  1. Since f is one-one, the three elements of the domain go to three distinct elements of the co-domain.
  2. 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.

  1. gof(2) = g(f(2)) = g(3) = 7.
  2. gof(3) = g(f(3)) = g(4) = 7.
  3. gof(4) = g(f(4)) = g(5) = 11.
  4. 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.
Solution
  1. gof(x) = g(f(x)) = g(cos x) = 3(cos x)² = 3 cos²x.
  2. fog(x) = f(g(x)) = f(3x²) = cos(3x²).
  3. At x = 0: gof(0) = 3 cos²0 = 3, whereas fog(0) = cos 0 = 1.

Since 3 ≠ 1, gof ≠ fog.

Example 17
Let f : N → Y be a function defined as f(x) = 4x + 3, where Y = {y ∈ N : y = 4x + 3 for some x ∈ N}. Show that f is invertible. Find the inverse.
Solution
  1. Take an arbitrary y ∈ Y. By definition of Y, y = 4x + 3 for some x ∈ N, so x = (y − 3)/4.
  2. Define g : Y → N by g(y) = (y − 3)/4.
  3. gof(x) = g(4x + 3) = (4x + 3 − 3)/4 = x, so gof = I_N.
  4. 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
  1. Reflexive: (a, a) ∈ R₁ and (a, a) ∈ R₂ for all a, hence (a, a) ∈ R₁ ∩ R₂.
  2. Symmetric: (a, b) ∈ R₁ ∩ R₂ ⇒ (a, b) is in both ⇒ (b, a) is in both ⇒ (b, a) ∈ R₁ ∩ R₂.
  3. 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
  1. Reflexive: xy = yx, so (x, y) R (x, y).
  2. Symmetric: if xv = yu then uy = vx, so (u, v) R (x, y).
  3. Transitive: let (x, y) R (u, v) and (u, v) R (a, b), i.e. xv = yu and ub = va.
  4. From the first, u = xv/y; substituting into the second gives (xv/y)b = va ⇒ xb = ya.
  5. 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
  1. x − y is divisible by 3 exactly when x and y leave the same remainder on division by 3.
  2. Remainder 1: {1, 4, 7}. Remainder 2: {2, 5, 8}. Remainder 0: {3, 6, 9}.
  3. So (x, y) ∈ R₁ ⇔ x and y lie in the same one of these three subsets.
  4. That is precisely the condition defining R₂.

Hence R₁ = R₂.

Example 21
Let f : X → Y be a function. Define a relation R in X given by R = {(a, b) : f(a) = f(b)}. Examine whether R is an equivalence relation or not.
Solution
  1. Reflexive: f(a) = f(a) for every a ∈ X.
  2. Symmetric: f(a) = f(b) ⇒ f(b) = f(a).
  3. Transitive: f(a) = f(b) and f(b) = f(c) ⇒ f(a) = f(c).

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
  1. A one-one function from a finite set to itself is a bijection, i.e. a permutation.
  2. 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
  1. Reflexivity forces (1,1), (2,2), (3,3) ∈ R; we are also given (1,2), (2,3) ∈ R.
  2. Transitivity with (1,2) and (2,3) forces (1,3) ∈ R.
  3. So the smallest candidate is R₁ = {(1,1),(2,2),(3,3),(1,2),(2,3),(1,3)} — transitive, not symmetric. ✓
  4. We may additionally add (2,1) — giving R₂ — while keeping transitivity and losing symmetry overall. ✓
  5. Or add (3,2) instead — giving R₃. ✓
  6. 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
  1. Any equivalence relation contains (1,1), (2,2), (3,3); we are given (1,2) and (2,1).
  2. Case 1: R = {(1,1),(2,2),(3,3),(1,2),(2,1)}. Partition {1,2} and {3}. ✓
  3. Case 2: bring 3 into the same class, giving the universal relation A × A. ✓
  4. 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
  1. I_N is onto: for any y ∈ N, I_N(y) = y, so y has a pre-image.
  2. Now (I_N + I_N)(x) = 2x, whose range is the set of even natural numbers.
  3. 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
  1. On [0, π/2], sin x is strictly increasing, so f is one-one.
  2. On [0, π/2], cos x is strictly decreasing, so g is one-one.
  3. Now (f + g)(0) = sin 0 + cos 0 = 0 + 1 = 1.
  4. And (f + g)(π/2) = sin(π/2) + cos(π/2) = 1 + 0 = 1.
  5. So (f + g)(0) = (f + g)(π/2) although 0 ≠ π/2.

Hence f + g is not one-one.