JEE Main 2019 Mathematics question — Composite functions
Let N be the set of natural numbers and two functions f and g be defined as f,g:N→N such that f(n)={2n+1,2n,if n is oddif n is even and g(n)=n−(−1)n. Then fog is:
SOLUTION
We consider the set of natural numbers N={1,2,3,…} and the two given functions
f:N→N,f(n)=⎩⎨⎧2n+1,2n,if n is oddif n is even
and
g:N→N,g(n)=n−(−1)n.
First we rewrite g separately for even and odd inputs. We know the elementary fact (−1)n={1,−1,n evenn odd. Using this fact, we have
For even n, say n=2k,
g(2k)=2k−1.
For odd n, say n=2k−1,
g(2k−1)=2k−1−(−1)2k−1=2k−1−(−1)=2k.
So
g(n)={n−1,n+1,n evenn odd.
Now we evaluate the composition f∘g, that is, (f∘g)(n)=f(g(n)). We again consider the parity of n.
Case 1 : n is even. Write n=2k. Then
g(n)=g(2k)=2k−1,
and this number 2k−1 is odd. When the input to f is odd we use the first branch of f, hence
f(g(2k))=f(2k−1)=2(2k−1)+1=22k=k.
Because n=2k, we can rewrite this result as
(f∘g)(n)=2n,n even.
Case 2 : n is odd. Write n=2k−1. Then
g(n)=g(2k−1)=2k,
and this output 2k is even. For an even input, f takes its second branch, giving
f(g(2k−1))=f(2k)=22k=k.
Because n=2k−1, this can be rewritten as
(f∘g)(n)=2n+1,n odd.
Combining the two cases, we obtain the explicit expression
(f∘g)(n)=⎩⎨⎧2n+1,2n,n oddn even
We notice that this is exactly the same rule that defines f itself. Hence f∘g=f. To decide between the options we must examine whether this function is one-one (injective) and/or onto (surjective) as a map from N to N.
Injectivity test. We compute two different inputs that yield the same output:
f(1)=21+1=1,f(2)=22=1.
The values 1 and 2 are distinct, yet f(1)=f(2). Therefore f is not one-one. Since f∘g=f, the composition is also not one-one.
Surjectivity test. Take any arbitrary natural number m∈N. Choosing n=2m (which is even) gives
f(2m)=22m=m.
Thus every element m in the codomain N is hit by some element of the domain, so f is onto, and therefore f∘g is also onto.
We have proved that f∘g is onto but not one-one.
Hence, the correct answer is Option A.
Tagged Composite functions. Machine-assigned, so read it as a strong shortlist rather than a verdict.