Question
Mathematics Question on Types of Functions
If the function f:N→N is defined as f(n)={n−1, n+1,if n is evenif n is odd, then:
(A) f is injective
(B) f is into
(C) f is surjective
(D) f is invertible
Choose the correct answer from the options given below:
(B) only
(A), (B), and (D) only
(A) and (C) only
(A), (C), and (D) only
(A), (C), and (D) only
Solution
For n even: f(n)=n−1. For n odd: f(n)=n+1.
f is injective : No two different inputs map to the same output. For example:
- If n1 and n2 are even or odd, the outputs f(n1)=f(n2).
- If n1 is even and n2 is odd, their outputs f(n1)=n1−1 and f(n2)=n2+1 are distinct.
Hence, f is injective.
f is surjective : Every natural number k∈N is an output of f :
- For odd k , k=f(k−1), where k−1 is even.
- For even k , k=f(k+1), where k+1 is odd.
Hence, f is surjective.
f is invertible : Since f is both injective and surjective, it is invertible. The inverse function f−1 is:
f−1(n)={n+1, n−1,if n is oddif n is even
Thus, the function f satisfies properties (A), (C), and (D).
Answer:
(A),(C), and (D).