Functions – Example of a Function from N to N That Satisfies Conditions

discrete mathematicsfunctions

For each of the following properties give an example of a function from $\mathbb N \to \mathbb N$ that satisfied:

(a) one-to-one but not onto

(b) onto but not one-to-one

(c) both onto and one-to-one

(d) neither one-to-one nor onto

In part (b), the model answer uses $f(n)= \max\{\}$, I got confused, what's the relationship between maximum and surjective function?

Best Answer

Some possibilities:

$1)$ How about $f(x)=2x\,,\forall x\in\mathbb N$.

$2)$ $f(x)=\begin{cases}1, x=1\\x-1, x\neq1\end{cases}$

$3)f(x)=x\,,\forall x\in\mathbb N$

$4)f(x)=1\,,\forall x\in\mathbb N$