SOLVER7 Study. Nothing Else.
Chapter 1 Examples Q12

Show that \( f : N → N,\) given by \(f(x)=\)
\(x+1,\) if \(x\) is odd\(,\)
\(x-1,\) if \(x\) is even
is both one-one and onto.

CBSE Class 12 Maths · Relations and Functions

Solution

👶 Simple Explanation

Simple Explanation

Imagine a dance where everyone swaps with their neighbour. The number 1 grabs the hand of 2 and they swap places. Then 3 and 4 swap, then 5 and 6, and so on forever. Every single number finds exactly one partner to swap with. Nobody is left out, and nobody dances with two people at once. That kind of perfect swap is what mathematicians call a bijection — a completely fair, one-to-one pairing between all natural numbers.

Answer: Since \( f \) is both one-one and onto, \( f : N \to N \) is a bijection. The rule simply interchanges each odd number with the next even number, i.e. \( 1 \leftrightarrow 2 \), \( 3 \leftrightarrow 4 \), \( 5 \leftrightarrow 6 \), and so on.

📖 Proving f is One-One and Onto (Bijection)

Detailed Explanation

A function \( f : N \to N \) is called one-one (injective) if different inputs always give different outputs, that is, \( f(a) = f(b) \) forces \( a = b \). It is called onto (surjective) if every element of the codomain \( N \) is the image of some element of the domain \( N \). A function that is both one-one and onto is called a bijection. Here the function is defined piecewise: it adds 1 to odd numbers and subtracts 1 from even numbers. Notice that applying this rule swaps consecutive pairs like \( 1 \leftrightarrow 2 \), \( 3 \leftrightarrow 4 \), \( 5 \leftrightarrow 6 \), and so on. Since it just pairs numbers up, it should be a bijection, and we now prove this carefully.

Formula Used

\[ f(x) = \begin{cases} x+1 & x \text{ is odd} \\ x-1 & x \text{ is even} \end{cases} \]

Solution

  1. Step 1: Understand the effect of the rule. If \( x \) is odd, then \( x+1 \) is even, so odd numbers are sent to even numbers. If \( x \) is even, then \( x-1 \) is odd, so even numbers are sent to odd numbers. Thus the function always changes parity (odd becomes even and even becomes odd).
  2. Step 2 (One-one): compare two odd inputs: Suppose \( a \) and \( b \) are both odd and \( f(a) = f(b) \). Then \( a + 1 = b + 1 \), which gives \( a = b \). So two odd inputs with equal images must be equal.
  3. Step 3 (One-one): compare two even inputs: Suppose \( a \) and \( b \) are both even and \( f(a) = f(b) \). Then \( a - 1 = b - 1 \), which gives \( a = b \). So two even inputs with equal images must be equal.
  4. Step 4 (One-one): one odd and one even input: Suppose \( a \) is odd and \( b \) is even. Then \( f(a) = a + 1 \) is even, while \( f(b) = b - 1 \) is odd. An even number can never equal an odd number, so \( f(a) \ne f(b) \). Hence a mixed pair can never share the same image. Combining Steps 2, 3 and 4, \( f(a) = f(b) \) always forces \( a = b \), so \( f \) is one-one.
  5. Step 5 (Onto): find a pre-image for every natural number: Take any \( y \in N \). We must find \( x \in N \) with \( f(x) = y \). Case 1: if \( y \) is odd, choose \( x = y + 1 \), which is even. Then \( f(x) = x - 1 = (y+1) - 1 = y \). Case 2: if \( y \) is even, choose \( x = y - 1 \), which is odd. Then \( f(x) = x + 1 = (y-1) + 1 = y \).
  6. Step 6 (Onto): conclude surjectivity: In both cases we found an \( x \in N \) whose image is the chosen \( y \). (For \( y = 1 \), which is odd, \( x = 1 + 1 = 2 \) gives \( f(2) = 1 \), so even \( y = 1 \) is covered.) Since every \( y \in N \) has a pre-image, \( f \) is onto.

Final Answer

Since \( f \) is both one-one and onto, \( f : N \to N \) is a bijection. The rule simply interchanges each odd number with the next even number, i.e. \( 1 \leftrightarrow 2 \), \( 3 \leftrightarrow 4 \), \( 5 \leftrightarrow 6 \), and so on.

Common Mistake

A common mistake is to check \( f(a) = f(b) \Rightarrow a = b \) only within one branch (say both odd) and forget the mixed case where one input is odd and the other is even. Skipping the parity argument in Step 4 leaves the one-one proof incomplete.

🪜 Step-by-step Solution

Step-by-step Solution

  1. Step 1: Observe the Parity-Swapping Behaviour: When \( x \) is odd, \( f(x) = x + 1 \) is even; when \( x \) is even, \( f(x) = x - 1 \) is odd. So the function always maps odd numbers to even numbers and even numbers to odd numbers. — Reason: Understanding this parity swap is the key insight; it tells us the function simply interchanges consecutive pairs like \( 1 \leftrightarrow 2 \), \( 3 \leftrightarrow 4 \), and so on, which strongly suggests it is a bijection.
  2. Step 2: Prove One-One — Case 1 (Both Inputs Odd): Suppose \( a \) and \( b \) are both odd and \( f(a) = f(b) \). Then \( a + 1 = b + 1 \), so \( a = b \). — Reason: We handle odd and even inputs separately because the formula differs in each case; showing equal outputs force equal inputs (for the odd case) establishes injectivity for that half of the domain.
  3. Step 3: Prove One-One — Case 2 (Both Inputs Even): Suppose \( a \) and \( b \) are both even and \( f(a) = f(b) \). Then \( a - 1 = b - 1 \), so \( a = b \). — Reason: This completes the injectivity argument for the even half of the domain.
  4. Step 4: Prove One-One — Case 3 (One Odd, One Even): Suppose \( a \) is odd and \( b \) is even (or vice versa) and \( f(a) = f(b) \). Then \( a + 1 = b - 1 \), giving \( b = a + 2 \). But from Step 1, \( f(a) = a + 1 \) is even and \( f(b) = b - 1 \) is odd, so they cannot be equal. This is a contradiction, meaning no such pair \( a, b \) exists. — Reason: A one-one proof must rule out ALL possible cases; since an odd output can never equal an odd output arising from mixing parities here, this case is impossible and injectivity is fully established.
  5. Step 5: Prove Onto — Every Natural Number is Achieved: Let \( y \in N \) be arbitrary. If \( y \) is even, choose \( x = y - 1 \), which is odd and lies in \( N \); then \( f(x) = (y-1) + 1 = y \). If \( y \) is odd, choose \( x = y + 1 \), which is even and lies in \( N \); then \( f(x) = (y+1) - 1 = y \). In both cases a pre-image exists. — Reason: Surjectivity requires us to show every element of the codomain \( N \) has at least one pre-image in the domain \( N \); constructing the pre-image explicitly is the clearest way to do this.
  6. Step 6: Combine to Conclude Bijection: Since \( f \) is one-one (Steps 2–4) and onto (Step 5), it satisfies both conditions for being a bijection. — Reason: A bijection is defined as a function that is simultaneously injective and surjective; having verified both properties, the conclusion follows directly.

Final Answer

Since \( f \) is both one-one and onto, \( f : N \to N \) is a bijection. The rule simply interchanges each odd number with the next even number, i.e. \( 1 \leftrightarrow 2 \), \( 3 \leftrightarrow 4 \), \( 5 \leftrightarrow 6 \), and so on.

Common Mistake

One common mistake: Students often check only the case where both inputs have the same parity (both odd or both even) when proving one-one, and forget to rule out the mixed-parity case (one odd input and one even input). Always verify all three sub-cases to make the injectivity proof complete.

✍️ Exam-ready Answer

Exam-ready Answer

  1. One-one (Injective): Case 1: \( a, b \) both odd, \( f(a) = f(b) \) implies \( a+1 = b+1 \) implies \( a = b \). Case 2: \( a, b \) both even, \( f(a) = f(b) \) implies \( a-1 = b-1 \) implies \( a = b \). Case 3: \( a \) odd, \( b \) even, \( f(a) = f(b) \) implies \( a+1 = b-1 \), but \( a+1 \) is even and \( b-1 \) is odd — contradiction. So \( f \) is one-one.
  2. Onto (Surjective): For any \( n \in N \): if \( n \) is even, then \( n-1 \) is odd and \( f(n-1) = (n-1)+1 = n \); if \( n \) is odd, then \( n+1 \) is even and \( f(n+1) = (n+1)-1 = n \). Every \( n \in N \) has a preimage, so \( f \) is onto.

Answer: Since \( f \) is both one-one and onto, \( f : N \to N \) is a bijection. The rule simply interchanges each odd number with the next even number, i.e. \( 1 \leftrightarrow 2 \), \( 3 \leftrightarrow 4 \), \( 5 \leftrightarrow 6 \), and so on.

➕ More Examples

More Examples

Example 1

Question: Let \( f : \mathbb{N} \to \mathbb{N} \) be defined by \[f(n) = \begin{cases} n + 3 & \text{if } n \text{ is odd} \\ n - 3 & \text{if } n \text{ is even and } n \ge 4 \\ n & \text{if } n \in \{1, 2\} \end{cases}\] Hmm — actually, consider the simpler function \( g : \mathbb{Z} \to \mathbb{Z} \) defined by \[g(n) = \begin{cases} n - 1 & \text{if } n \text{ is odd} \\ n + 1 & \text{if } n \text{ is even} \end{cases}\] Show that \( g \) is both one-one and onto.

Solution: We need to show that \( g : \mathbb{Z} \to \mathbb{Z} \) defined by \[g(n) = \begin{cases} n - 1 & \text{if } n \text{ is odd} \\ n + 1 & \text{if } n \text{ is even} \end{cases}\] is one-one and onto. Step 1 — One-one (Injectivity): Assume \( g(a) = g(b) \) for some \( a, b \in \mathbb{Z} \). We consider three cases. Case 1: Both \( a \) and \( b \) are odd. Then \( g(a) = a - 1 \) and \( g(b) = b - 1 \). So \( a - 1 = b - 1 \) which gives \( a = b \). Case 2: Both \( a \) and \( b \) are even. Then \( g(a) = a + 1 \) and \( g(b) = b + 1 \). So \( a + 1 = b + 1 \) which gives \( a = b \). Case 3: \( a \) is odd and \( b \) is even (or vice versa). Then \( g(a) = a - 1 \) (even) and \( g(b) = b + 1 \) (odd). An even number cannot equal an odd number, so \( g(a) \ne g(b) \). This case cannot produce \( g(a) = g(b) \). In all valid cases, \( g(a) = g(b) \Rightarrow a = b \). Hence \( g \) is one-one. Step 2 — Onto (Surjectivity): Let \( y \in \mathbb{Z} \) be arbitrary. We find a pre-image \( x \) such that \( g(x) = y \). If \( y \) is even: Take \( x = y + 1 \) (which is odd). Then \[g(x) = g(y+1) = (y+1) - 1 = y.\] So \( y \) has a pre-image. If \( y \) is odd: Take \( x = y - 1 \) (which is even). Then \[g(x) = g(y-1) = (y-1) + 1 = y.\] So \( y \) has a pre-image. Since every \( y \in \mathbb{Z} \) has a pre-image in \( \mathbb{Z} \), \( g \) is onto. Conclusion: \( g \) is both one-one and onto, hence a bijection.

Answer: g is both one-one and onto (bijective). Every integer y has the pre-image y+1 (if y is even) or y−1 (if y is odd), and distinct inputs always produce distinct outputs.

Example 2

Question: Let \( h : \mathbb{N} \to \mathbb{N} \) be defined by \[h(n) = \begin{cases} n + 2 & \text{if } n \text{ is odd} \\ n - 2 & \text{if } n \text{ is even and } n \ge 4 \end{cases}\] and \( h(1) = 1,\ h(2) = 2 \). Is this function one-one and onto? Actually, consider instead \( p : \mathbb{N} \to \mathbb{N} \) defined by \[p(n) = \begin{cases} n - 1 & \text{if } n \text{ is even} \\ n + 1 & \text{if } n \text{ is odd} \end{cases}\] Show that \( p \) is both one-one and onto.

Solution: We verify that \( p : \mathbb{N} \to \mathbb{N} \) defined by \[p(n) = \begin{cases} n - 1 & \text{if } n \text{ is even} \\ n + 1 & \text{if } n \text{ is odd} \end{cases}\] is well-defined, one-one, and onto. Well-defined check: If \( n \) is even, then \( n \ge 2 \) in \( \mathbb{N} \), so \( n - 1 \ge 1 \in \mathbb{N} \). If \( n \) is odd, \( n + 1 \ge 2 \in \mathbb{N} \). So \( p \) maps \( \mathbb{N} \) into \( \mathbb{N} \). Note the explicit values: \( p(1) = 2,\ p(2) = 1,\ p(3) = 4,\ p(4) = 3,\ \ldots \) Each consecutive pair \( \{2k-1,\ 2k\} \) is swapped. Step 1 — One-one: Assume \( p(a) = p(b) \). Case 1: Both \( a, b \) are odd. Then \( a + 1 = b + 1 \Rightarrow a = b \). Case 2: Both \( a, b \) are even. Then \( a - 1 = b - 1 \Rightarrow a = b \). Case 3: \( a \) is odd, \( b \) is even. Then \( p(a) = a + 1 \) is even, and \( p(b) = b - 1 \) is odd. An even number cannot equal an odd number, so \( p(a) \ne p(b) \). A contradiction — this case is impossible. Hence \( p(a) = p(b) \Rightarrow a = b \), so \( p \) is one-one. Step 2 — Onto: Let \( m \in \mathbb{N} \) be arbitrary. If \( m \) is odd: Choose \( n = m + 1 \) (even, and \( n \ge 2 \in \mathbb{N} \)). Then \[p(n) = p(m+1) = (m+1) - 1 = m.\] If \( m \) is even: Choose \( n = m - 1 \) (odd). Since \( m \ge 2 \), we have \( n = m-1 \ge 1 \in \mathbb{N} \). Then \[p(n) = p(m-1) = (m-1) + 1 = m.\] In both cases, every \( m \in \mathbb{N} \) has a pre-image in \( \mathbb{N} \), so \( p \) is onto. Conclusion: \( p \) is both one-one and onto. In fact, \( p \) is its own inverse since applying it twice gives \[p(p(n)) = n \text{ for all } n \in \mathbb{N},\] confirming \( p \) is a bijection and \( p^{-1} = p \).

Answer: p is both one-one and onto. The function swaps each consecutive pair (2k−1, 2k), so every natural number is reached exactly once, making p a bijection that is its own inverse.

🎯 Try a Similar Question

Try a Similar Question

Question: Let \( g : \mathbb{N} \to \mathbb{N} \) be defined by \[ g(n) = \begin{cases} n - 1 & \text{if } n \text{ is even} \\ n + 1 & \text{if } n \text{ is odd} \end{cases} \] Show that \( g \) is both one-one and onto. Hence state whether \( g \) is invertible, and if so, find \( g^{-1} \).

Solution

  1. Step 1: Understand the rule: The function \( g \) maps every even natural number \( n \) to \( n - 1 \) (one less) and every odd natural number \( n \) to \( n + 1 \) (one more). For example: \( g(1) = 2,\; g(2) = 1,\; g(3) = 4,\; g(4) = 3,\; g(5) = 6,\; g(6) = 5, \ldots \) So the function pairs up consecutive natural numbers: \( 1 \leftrightarrow 2 \), \( 3 \leftrightarrow 4 \), \( 5 \leftrightarrow 6 \), and so on.
  2. Step 2: Prove g is one-one (injective): Assume \( g(a) = g(b) \) for some \( a, b \in \mathbb{N} \). We consider four cases based on the parity of \( a \) and \( b \). Case 1: Both \( a \) and \( b \) are odd. Then \( g(a) = a + 1 \) and \( g(b) = b + 1 \), so \( a + 1 = b + 1 \) which gives \( a = b \). Case 2: Both \( a \) and \( b \) are even. Then \( g(a) = a - 1 \) and \( g(b) = b - 1 \), so \( a - 1 = b - 1 \) which gives \( a = b \). Case 3: \( a \) is odd and \( b \) is even. Then \( g(a) = a + 1 \) (which is even) and \( g(b) = b - 1 \) (which is odd). An even number cannot equal an odd number, so \( g(a) \ne g(b) \); this case gives no solution. Case 4: \( a \) is even and \( b \) is odd. By symmetry, same contradiction as Case 3. In all valid cases, \( g(a) = g(b) \Rightarrow a = b \). Hence \( g \) is one-one.
  3. Step 3: Prove g is onto (surjective): Let \( y \in \mathbb{N} \) be arbitrary. We must find \( x \in \mathbb{N} \) such that \( g(x) = y \). Case 1: \( y \) is even. Choose \( x = y - 1 \). Since \( y \ge 2 \) (the smallest even natural number is 2), \( x = y - 1 \ge 1 \), so \( x \in \mathbb{N} \). Also \( x = y - 1 \) is odd, so \( g(x) = x + 1 = (y - 1) + 1 = y \). Case 2: \( y \) is odd. Choose \( x = y + 1 \). Then \( x \in \mathbb{N} \) and \( x = y + 1 \) is even, so \( g(x) = x - 1 = (y + 1) - 1 = y \). In every case, a pre-image exists in \( \mathbb{N} \). Hence \( g \) is onto.
  4. Step 4: Conclude bijection and find the inverse: Since \( g \) is both one-one and onto, \( g \) is a bijection and therefore invertible. To find \( g^{-1} \), note that if \( y \) is even then the unique pre-image is \( y - 1 \) (odd), and if \( y \) is odd then the unique pre-image is \( y + 1 \) (even). Therefore \[ g^{-1}(y) = \begin{cases} y - 1 & \text{if } y \text{ is even} \\ y + 1 & \text{if } y \text{ is odd} \end{cases} \] Observe that \( g^{-1} = g \), meaning \( g \) is its own inverse, i.e., \( g \circ g = I_{\mathbb{N}} \).

Answer: The function \( g \) is a bijection (both one-one and onto). It is its own inverse: \( g^{-1} = g \), given by the same rule \[ g^{-1}(n) = \begin{cases} n - 1 & \text{if } n \text{ is even} \\ n + 1 & \text{if } n \text{ is odd} \end{cases} \] The function swaps each odd number with its successor: \( 1 \leftrightarrow 2 \), \( 3 \leftrightarrow 4 \), \( 5 \leftrightarrow 6 \), and so on.

Everything you get with Solver7

More questions in Relations and Functions