Show that f:N→Nf: \mathbf{N} \rightarrow \mathbf{N}, given by f(x)=x+1, if x is odd ,x−1, if x is even f(x)=\begin{aligned} & x+1, \text { if } x \text { is odd }, \\ & x-1, \text { if } x \text { is even } \end{aligned} is both one-one and onto. The image of 1 and -1 under ff is 1 . Fig 1.4 Solution Suppose f(x1)=f(x2)f\left(x_{1}\right)=f\left(x_{2}\right). Note that if x1x_{1} is odd and x2x_{2} is even, then we will have x1+1=x2−1x_{1}+1=x_{2}-1, i.e., x2−x1=2x_{2}-x_{1}=2 which is impossible. Similarly, the possibility of x1x_{1} being even and x2x_{2} being odd can also be ruled out, using the similar argument. Therefore, both x1x_{1} and x2x_{2} must be either odd or even. Suppose both x1x_{1} and x2x_{2} are odd. Then f(x1)=f(x2)⇒x1+1=x2+1⇒x1=x2f\left(x_{1}\right)=f\left(x_{2}\right) \Rightarrow x_{1}+1=x_{2}+1 \Rightarrow x_{1}=x_{2}. Similarly, if both x1x_{1} and x2x_{2} are even, then also f(x1)=f(x2)⇒x1−1=x2−1⇒x1=x2f\left(x_{1}\right)=f\left(x_{2}\right) \Rightarrow x_{1}-1=x_{2}-1 \Rightarrow x_{1}=x_{2}. Thus, ff is one-one. Also, any odd number 2r+12 r+1 in the co-domain N\mathbf{N} is the image of 2r+22 r+2 in the domain N\mathbf{N} and any even number 2r2 r in the co-domain N\mathbf{N} is the image of 2r−12 r-1 in the domain N\mathbf{N}. Thus, ff is onto. \\

Answer: The function f:N→Nf: \mathbf{N} \rightarrow \mathbf{N} given by f(x)={x+1,if x is oddx−1,if x is evenf(x)=\begin{cases} x+1, & \text{if } x \text{ is odd} \\ x-1, & \text{if } x \text{ is even} \end{cases} is both one-one and onto.

Step-by-step solution

Step 1: Prove f is one-one (Case 1: x1 odd, x2 even)

To prove that the function ff is one-one, we assume f(x1)=f(x2)f(x_1) = f(x_2) and show that x1=x2x_1 = x_2 . We consider different cases for x1x_1 and x2x_2 . First, let's assume x1x_1 is odd and x2x_2 is even. In this case, f(x1)=x1+1f(x_1) = x_1+1 and f(x2)=x2−1f(x_2) = x_2-1 . Setting them equal gives x1+1=x2−1x_1+1 = x_2-1 , which simplifies to x2−x1=2x_2 - x_1 = 2 .

Step 2: Prove f is one-one (Case 2: x1 even, x2 odd)

Next, let's consider the case where x1x_1 is even and x2x_2 is odd. Here, f(x1)=x1−1f(x_1) = x_1-1 and f(x2)=x2+1f(x_2) = x_2+1 . Setting them equal gives x1−1=x2+1x_1-1 = x_2+1 , which simplifies to x1−x2=2x_1 - x_2 = 2 . This is also impossible because if x1x_1 is even and x2x_2 is odd, then x1−x2x_1 - x_2 must be an odd number, not an even number like 2.

Step 3: Prove f is one-one (Case 3: x1, x2 both odd or both even)

Since the previous two cases are impossible, x1x_1 and x2x_2 must either both be odd or both be even. If both x1x_1 and x2x_2 are odd, then f(x1)=x1+1f(x_1) = x_1+1 and f(x2)=x2+1f(x_2) = x_2+1 . Setting f(x1)=f(x2)f(x_1) = f(x_2) implies x1+1=x2+1x_1+1 = x_2+1 , which simplifies to x1=x2x_1 = x_2 . Similarly, if both x1x_1 and x2x_2 are even, then f(x1)=x1−1f(x_1) = x_1-1 and f(x2)=x2−1f(x_2) = x_2-1 . Setting f(x1)=f(x2)f(x_1) = f(x_2) implies x1−1=x2−1x_1-1 = x_2-1 , which simplifies to x1=x2x_1 = x_2 . In all valid cases, x1=x2x_1 = x_2 , so ff is one-one.

Step 4: Prove f is onto (Case 1: y is odd)

To prove that the function ff is onto, we need to show that for every element yy in the codomain N\mathbf{N} , there exists an element xx in the domain N\mathbf{N} such that f(x)=yf(x) = y . Let yy be an odd number in the codomain, so y=2r+1y = 2r+1 for some integer r≥0r \ge 0 . If y=1y=1 , then r=0r=0 , so y=2(0)+1=1y=2(0)+1=1 . We need to find an xx such that f(x)=yf(x)=y . Consider x=2r+2x = 2r+2 . Since r≥0r \ge 0 , x=2r+2x = 2r+2 is an even natural number (e.g., if r=0r=0 , x=2x=2 ; if r=1r=1 , x=4x=4 ). Since xx is even, f(x)=x−1=(2r+2)−1=2r+1=yf(x) = x-1 = (2r+2)-1 = 2r+1 = y . Thus, every odd number in the codomain has a pre-image.

Step 5: Prove f is onto (Case 2: y is even)

Now, let yy be an even number in the codomain, so y=2ry = 2r for some integer r≥1r \ge 1 (since y∈Ny \in \mathbf{N} , yy must be at least 2). We need to find an xx such that f(x)=yf(x)=y . Consider x=2r−1x = 2r-1 . Since r≥1r \ge 1 , x=2r−1x = 2r-1 is an odd natural number (e.g., if r=1r=1 , x=1x=1 ; if r=2r=2 , x=3x=3 ). Since xx is odd, f(x)=x+1=(2r−1)+1=2r=yf(x) = x+1 = (2r-1)+1 = 2r = y . Thus, every even number in the codomain also has a pre-image. Since every element in the codomain has a pre-image, ff is onto.

More from this chapter

All Relations and Functions solutions →

Solve your own maths question free →