Question:medium

If $f : \mathbb{N} \rightarrow \mathbb{W}$ is defined as \[ f(n) = \begin{cases} \frac{n}{2}, & \text{if } n \text{ is even} \\ 0, & \text{if } n \text{ is odd} \end{cases} \] then $f$ is :

Show Hint

To check if a function is injective, verify if distinct inputs map to distinct outputs. To check for surjectivity, ensure every element in the codomain has a pre-image in the domain.
Updated On: Feb 28, 2026
  • injective only
  • surjective only
  • a bijection
  • neither surjective nor injective
Show Solution

The Correct Option is D

Solution and Explanation

- Injectivity requires each domain element to map to a distinct codomain element. The function $f$ maps both even and odd numbers to different values, thus it is not injective. - Surjectivity requires every codomain element to be mapped from a domain element. However, $f$ does not map to all elements in the codomain $\mathbb{W}$; specifically, it cannot map to all odd numbers. Therefore, $f$ is not surjective. Consequently, $f$ is neither injective nor surjective.
Was this answer helpful?
4