Example of functions that are onto but not one-to-one

81.6k Views Asked by At

I have been preparing for my exam tomorrow and I just can't think of a function that is onto but not one-to-one.

I know an absolute function isn't one-to-one or onto. And an example of a one-to-one function that isn't onto is $f(n)=2n$ where $f:\mathbb{Z}\to\mathbb{Z}$.

Help?

8

There are 8 best solutions below

0
On

For example, $\sin(x)$ from $\mathbb{R}$ to $[-1,1]$, $x^2$ from $\mathbb{R}$ to $\mathbb{R}_+$, or $x^3+5x^2+x+1$ from $\mathbb{R}$ to $\mathbb{R}$.

4
On

In order for a function to be onto, but not one-to-one, you can kind of imagine that there would be "more" things in the domain than the range.

A simple example would be $f(x,y)=x$, which takes $\mathbb{R}^2$ to $\mathbb{R}$. It is clearly onto, but since we always ignore $y$, it's also not one-to-one:

$f(2,1)=f(2,2)=f(2,12525235423)=2$.

0
On

For an example of a function $f:\Bbb R\to\Bbb R$ which is onto but not one-to-one, consider $$f(x)=x\sin(x).$$

1
On

For example:

  • $x^{2k}, k\in\mathbb Z$ from $\mathbb R$ to $\mathbb R^+$
2
On

$$\left\{\begin{matrix} a\\ \;\\ b\end{matrix}\right\}\begin{matrix} \searrow\\\nearrow\end{matrix}\{c\}$$

0
On

I have to sort $52$ cards by suit and stack them in 4 boxes labeled according to suit:

$52$-cards $\to$ ($4$ boxes)

$$f: \text{Set of $52$ Cards} \to \{spades,\; clubs, \;diamonds,\; hearts\}$$

0
On

Or you could use this simple example $f:\mathbb{R}\to[0,+\infty)$, $f(x) = |x|$

0
On

Take any bijection of $\Bbb N$ with $\Bbb{N\times N}$, e.g. $f(n,m)=2^n(2m+1)-1$ and take $g(n)$ to be the projection on the right coordinate of $f^{-1}(n)$.

Easily this is surjective, but every point has an infinite preimage.