Relations and Functions

NCERT Class 12 Mathematics — Relations and Functions, Exercise 1.2. All 12 questions solved.

Exercise 1.2 moves from relations to functions, and two definitions run all twelve questions.

A function $f : \mathrm{X} \to \mathrm{Y}$ is one-one (injective) if $f(x_1) = f(x_2)$ forces $x_1 = x_2$ — distinct inputs never share an output. It is onto (surjective) if every $y \in \mathrm{Y}$ is $f(x)$ for some $x \in \mathrm{X}$ — nothing in the codomain is missed. A function that is both is bijective.

Key insight. Neither property belongs to the formula. Both depend on the domain and codomain as much as on the rule. Question 2 makes this its whole point: $f(x) = x^2$ is injective on $\mathbf{N}$ and not injective on $\mathbf{Z}$, without the formula changing at all. Always read the arrow before you start.

To disprove injectivity, name two inputs with the same output. To disprove surjectivity, name one element of the codomain that nothing maps to. To prove either, you need a general argument.

Question 1

Show that the function $f : \mathbf{R}_* \to \mathbf{R}_*$ defined by $f(x) = \dfrac{1}{x}$ is one-one and onto, where $\mathbf{R}_*$ is the set of all non-zero real numbers. Is the result true, if the domain $\mathbf{R}_*$ is replaced by $\mathbf{N}$ with co-domain being same as $\mathbf{R}_*$?

Solution. One-one. Suppose $f(x_1) = f(x_2)$:

$$\frac{1}{x_1} = \frac{1}{x_2} \quad\Rightarrow\quad x_1 = x_2$$

Onto. Given any $y \in \mathbf{R}_*$, take $x = \tfrac{1}{y}$, which is a non-zero real and so lies in the domain. Then $f(x) = y$. So $f$ is bijective.

Now replace the domain by $\mathbf{N}$, keeping the codomain $\mathbf{R}_*$. The function $f(n) = \tfrac{1}{n}$ is still one-one, by the same algebra. But it is no longer onto: take $y = 2 \in \mathbf{R}_*$. We would need $\tfrac{1}{n} = 2$, so $n = \tfrac12$, which is not a natural number.

$f$ is one-one and onto on $\mathbf{R}_*$. With domain $\mathbf{N}$ it remains one-one but is not onto, so the result is not true.

Question 2

Check the injectivity and surjectivity of the following functions.

Solution. The same two formulas appear over different domains, and the answers change accordingly.

(i) $f : \mathbf{N} \to \mathbf{N}$, $f(x) = x^2$. Injective: on the naturals $x_1^2 = x_2^2$ gives $x_1 = x_2$, since both are positive. Not surjective: $3 \in \mathbf{N}$ is not a perfect square. Injective but not surjective.

(ii) $f : \mathbf{Z} \to \mathbf{Z}$, $f(x) = x^2$. Not injective: $f(1) = f(-1) = 1$ — negative inputs are now available and this breaks it. Not surjective: $-1$ is not a square. Neither.

(iii) $f : \mathbf{R} \to \mathbf{R}$, $f(x) = x^2$. Not injective, same counterexample. Not surjective, since $x^2 \geq 0$ always. Neither.

(iv) $f : \mathbf{N} \to \mathbf{N}$, $f(x) = x^3$. Injective. Not surjective: $2$ is not a perfect cube. Injective but not surjective.

(v) $f : \mathbf{Z} \to \mathbf{Z}$, $f(x) = x^3$. Injective — unlike squaring, cubing preserves sign, so $-1$ and $1$ have different images. Not surjective: $2$ has no integer cube root. Injective but not surjective.

Compare (ii) and (v): both go from $\mathbf{Z}$ to $\mathbf{Z}$, and only the even power loses injectivity.

(i) Injective but not surjective (ii) Neither (iii) Neither (iv) Injective but not surjective (v) Injective but not surjective

Question 3

Prove that the Greatest Integer Function $f : \mathbf{R} \to \mathbf{R}$, given by $f(x) = [x]$, is neither one-one nor onto.

Solution. Not one-one. Any two numbers in the same unit interval collapse together:

$$f(1.2) = 1 = f(1.5), \qquad \text{yet } 1.2 \neq 1.5$$

Not onto. The output $[x]$ is always an integer, so nothing maps to $0.5 \in \mathbf{R}$. The range is $\mathbf{Z}$, a proper subset of the codomain.

$f$ is neither one-one nor onto.

Question 4

Show that the Modulus Function $f : \mathbf{R} \to \mathbf{R}$, given by $f(x) = |x|$, is neither one-one nor onto.

Solution. Not one-one. $f(1) = 1 = f(-1)$ while $1 \neq -1$ — the modulus sends $x$ and $-x$ to the same place.

Not onto. $|x| \geq 0$ for every real $x$, so no $x$ satisfies $f(x) = -1$. The range is $[0, \infty)$, not all of $\mathbf{R}$.

$f$ is neither one-one nor onto.

Question 5

Show that the Signum Function $f : \mathbf{R} \to \mathbf{R}$, given by

$$f(x) = \begin{cases} 1, & \text{if } x > 0 \\ 0, & \text{if } x = 0 \\ -1, & \text{if } x < 0 \end{cases}$$

is neither one-one nor onto.

Solution. Not one-one. Every positive number maps to $1$:

$$f(1) = 1 = f(2), \qquad \text{yet } 1 \neq 2$$

Not onto. The function takes only three values, so its range is $\{-1, 0, 1\}$. Nothing maps to $2 \in \mathbf{R}$.

$f$ is neither one-one nor onto — its range is only $\{-1, 0, 1\}$.

A note on the printing. In the current reprint the third branch is set as “$1$, if $x < 0$”, with no minus sign — and the line is indented as though one was dropped in typesetting. The correct definition, and the one used above, has $f(x) = -1$ for $x < 0$; that is what makes it the Signum function. As it happens the question’s conclusion survives the misprint, since the function as printed takes only the values $0$ and $1$ and is still neither one-one nor onto. But the range would be wrong, and the misprinted version is not the function the question names.

Question 6

Let $\mathrm{A} = \{1, 2, 3\}$, $\mathrm{B} = \{4, 5, 6, 7\}$ and let $f = \{(1, 4), (2, 5), (3, 6)\}$ be a function from A to B. Show that $f$ is one-one.

Solution. With a finite function listed pair by pair, injectivity is checked by looking at the second coordinates:

$$f(1) = 4, \qquad f(2) = 5, \qquad f(3) = 6$$

The three images $4$, $5$, $6$ are distinct, so no two elements of A share an image, and $f$ is one-one.

Note it is not onto: $7 \in \mathrm{B}$ is not an image. A one-one function into a larger set never can be.

Distinct elements of A have distinct images, so $f$ is one-one.

Question 7

In each of the following cases, state whether the function is one-one, onto or bijective. Justify your answer.

Question 7 (i)

$f : \mathbf{R} \to \mathbf{R}$ defined by $f(x) = 3 – 4x$

Solution. One-one. Suppose $f(x_1) = f(x_2)$:

$$3 – 4x_1 = 3 – 4x_2 \quad\Rightarrow\quad -4x_1 = -4x_2 \quad\Rightarrow\quad x_1 = x_2$$

Onto. Given $y \in \mathbf{R}$, solve $y = 3 – 4x$ for $x$:

$$x = \frac{3 – y}{4}$$

which is a real number for every real $y$, so every $y$ is attained.

Bijective (one-one and onto).

Question 7 (ii)

$f : \mathbf{R} \to \mathbf{R}$ defined by $f(x) = 1 + x^2$

Solution. Not one-one. $f(1) = 2 = f(-1)$ while $1 \neq -1$.

Not onto. Since $x^2 \geq 0$, we have $f(x) \geq 1$ for all $x$. So nothing maps to $0$, and the range is $[1, \infty)$.

Neither one-one nor onto.

Question 8

Let A and B be sets. Show that $f : \mathrm{A}\times\mathrm{B} \to \mathrm{B}\times\mathrm{A}$ such that $f(a, b) = (b, a)$ is bijective function.

Solution. One-one. Suppose $f(a_1, b_1) = f(a_2, b_2)$. Then

$$(b_1, a_1) = (b_2, a_2)$$

Two ordered pairs are equal only when both coordinates match, so $b_1 = b_2$ and $a_1 = a_2$, giving $(a_1, b_1) = (a_2, b_2)$.

Onto. Take any $(b, a) \in \mathrm{B}\times\mathrm{A}$. Then $(a, b) \in \mathrm{A}\times\mathrm{B}$ and $f(a, b) = (b, a)$, so every element of the codomain is hit.

$f$ is bijective — it simply swaps the coordinates, and swapping back is its inverse.

Question 9

Let $f : \mathbf{N} \to \mathbf{N}$ be defined by

$$f(n) = \begin{cases} \dfrac{n+1}{2}, & \text{if } n \text{ is odd} \\[6pt] \dfrac{n}{2}, & \text{if } n \text{ is even} \end{cases}$$

State whether the function $f$ is bijective. Justify your answer.

Solution. Compute a few values to see the pattern:

$$f(1) = 1, \quad f(2) = 1, \quad f(3) = 2, \quad f(4) = 2, \quad f(5) = 3, \dots$$

Not one-one. $f(1) = f(2) = 1$, and $1 \neq 2$. Every value is taken twice — once by an odd number and once by an even one.

Since injectivity fails, $f$ is not bijective. (It is in fact onto: for any $m \in \mathbf{N}$, $f(2m) = m$. So this is an onto function on an infinite set that is not one-one — impossible on a finite set, and worth noticing.)

No, $f$ is not bijective — it is onto but not one-one, since $f(1) = f(2) = 1$.

Question 10

Let $\mathrm{A} = \mathbf{R} – \{3\}$ and $\mathrm{B} = \mathbf{R} – \{1\}$. Consider the function $f : \mathrm{A} \to \mathrm{B}$ defined by $f(x) = \left(\dfrac{x-2}{x-3}\right)$. Is $f$ one-one and onto? Justify your answer.

Solution. The two exclusions are deliberate: $3$ is removed from the domain because it makes the denominator zero, and $1$ from the codomain for a reason the working reveals.

One-one. Suppose $f(x_1) = f(x_2)$, and cross-multiply:

$$(x_1 – 2)(x_2 – 3) = (x_2 – 2)(x_1 – 3)$$

$$x_1x_2 – 3x_1 – 2x_2 + 6 = x_1x_2 – 3x_2 – 2x_1 + 6$$

The $x_1x_2$ and constant terms cancel, leaving $-3x_1 – 2x_2 = -3x_2 – 2x_1$, so $-x_1 = -x_2$ and $x_1 = x_2$.

Onto. Given $y \in \mathrm{B}$, solve $y = \dfrac{x-2}{x-3}$ for $x$:

$$y(x – 3) = x – 2 \quad\Rightarrow\quad x(y – 1) = 3y – 2 \quad\Rightarrow\quad x = \frac{3y – 2}{y – 1}$$

This is defined because $y \neq 1$ — which is exactly why $1$ was excluded from the codomain. And $x \neq 3$, since $\tfrac{3y-2}{y-1} = 3$ would give $3y – 2 = 3y – 3$, an impossibility. So $x$ lies in A and $f(x) = y$.

Yes — $f$ is both one-one and onto, hence bijective.

Question 11

Let $f : \mathbf{R} \to \mathbf{R}$ be defined as $f(x) = x^4$. Choose the correct answer.

(A) $f$ is one-one onto
(B) $f$ is many-one onto
(C) $f$ is one-one but not onto
(D) $f$ is neither one-one nor onto

Solution. Not one-one. $f(1) = 1 = f(-1)$ — an even power destroys the sign, exactly as squaring did in question 2(iii).

Not onto. $x^4 \geq 0$ for every real $x$, so $-1$ is never attained.

$$\text{(D)}\quad f \text{ is neither one-one nor onto}$$

Question 12

Let $f : \mathbf{R} \to \mathbf{R}$ be defined as $f(x) = 3x$. Choose the correct answer.

(A) $f$ is one-one onto
(B) $f$ is many-one onto
(C) $f$ is one-one but not onto
(D) $f$ is neither one-one nor onto

Solution. One-one. $3x_1 = 3x_2$ gives $x_1 = x_2$.

Onto. For any $y \in \mathbf{R}$, $x = \tfrac{y}{3}$ is real and $f(x) = y$.

Contrast with question 11: an odd power (here the first) preserves sign and covers all of $\mathbf{R}$; an even power does neither.

$$\text{(A)}\quad f \text{ is one-one onto}$$

Common mistakes

  • Judging a function by its formula alone. $x^2$ is injective on $\mathbf{N}$ and not on $\mathbf{Z}$; $\tfrac1x$ is onto from $\mathbf{R}_*$ and not from $\mathbf{N}$. Read the domain and codomain first — questions 1 and 2 exist for this.
  • Confusing range with codomain. A function is onto only when these coincide. In question 3 the range is $\mathbf{Z}$ and the codomain $\mathbf{R}$, so it fails.
  • Trying to prove injectivity by testing values. Testing shows only that you have not yet found a clash. Start from $f(x_1) = f(x_2)$ and derive $x_1 = x_2$.
  • Ignoring why elements are excluded. In question 10, $3$ is removed from the domain to avoid dividing by zero and $1$ from the codomain so that the inverse formula is defined. Both exclusions do real work.
  • Assuming onto implies one-one. True on a finite set, false on an infinite one — question 9 is precisely the counterexample.

Practise next

Keep track of what you have finished — create a free account.

Doubts are answered by Shiwam, usually within a day. Ask about this question specifically — a general question about the chapter is better asked in class.

Ask your doubt

Stuck on this question? Ask Shiwam directly.

A free account lets you post a doubt on any question, keep track of the exercises you have finished, and come back to the answer later.

Create a free accountI already have one