Consider the function \(f : N\rightarrow N\) given by \(f(x)=\begin{cases}x+1, & \text{if } x \text{ is odd}\\ x-1, & \text{if } x \text{ is even}\end{cases}\)
Answer & explanation
Correct answer: option 4
The correct answer is Option (4) → f is both one-one and onto
f swaps each odd number with the next even number:
\(f(1)=2,\ f(2)=1,\ f(3)=4,\ f(4)=3,\ \ldots\)
One-one: an odd x goes to an even number and an even x goes to an odd number, so an odd and an even input never share an image. Two odd inputs with x + 1 = y + 1 are equal, and two even inputs with x − 1 = y − 1 are equal.
Onto: for any y in N,
y even: y = f(y − 1), where y − 1 is odd and in N
y odd: y = f(y + 1), where y + 1 is even
So every natural number is an image, and f is both one-one and onto.