Examples of one-to-one and onto functions $f:\mathbb N\to \mathbb N$

Give examples of functions from $\mathbb$ to $\mathbb$ with the following properties: i. one-to-one but not onto ii. onto but not one-to-one iii. both onto and one-to-one iv. neither one-to-one nor onto Here's my solution: i. $y = x^2$ from the set of non-negative real numbers to the set of all real numbers ii. $y = x^2$ from the set of all real numbers to the set of non-negative real numbers iii. $y = x^2$ from the set of non-negative real numbers to the set of non-negative real numbers iv. $y = x^2$ from the set of all real numbers to the set of all real numbers Do you think my answers are correct?

user147263 asked Apr 21, 2014 at 21:40 hullahmullah hullahmullah 11 1 1 silver badge 2 2 bronze badges $\begingroup$ But they must be from $\Bbb N$ to $\Bbb N$, mustn't they? $\endgroup$ Commented Apr 21, 2014 at 21:46

4 Answers 4

$\begingroup$

i. This is certainly injective because $(-x)^2$ will be unique for unique $x \in \mathbb^+$. However, it cannot be surjective since you aren't mapping onto any negative reals.

ii. That is certainly correct. $(-x)^2$ and $x^2$ will map to the same element, so the function is not injective. However, every element in $\mathbb^+$ has a square root, so it must be a surjective mapping to the non-negative reals.

iii. Is also correct. The problem with ii not being injective has been resolved by restricting the function's domain to the non-negative real numbers.

iv. Is correct. Certainly, it cannot be surjective since you aren't mapping onto the negative reals. It cannot be injective because $(-x)^2$ = $x^2$.

In short, you are partiallly correct. The only thing is that it looks like your problem statement requires your functions be defined as $f:\mathbb \rightarrow \mathbb$?