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

elementary-set-theoryfunctions

Give examples of functions from $\mathbb{N}$ to $\mathbb{N}$ 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?

Best Answer

i. This is certainly injective because $(-x)^2$ will be unique for unique $x \in \mathbb{R}^+$. 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{R}^+$ 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{N} \rightarrow \mathbb{N}$?