3

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?

Asaf Karagila
  • 393,674

9 Answers9

17

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

Zev Chonoles
  • 129,973
  • 1
    +1 nice Zev. I don't know why we always search for the complicated examples while we can easily find them around us. Love simplicity. – Mikasa Mar 06 '13 at 05:36
  • 7
    "+1" for wicked TeX. (And for a perfect "illustration" of the concept.) – Aeolian Mar 06 '13 at 05:39
6

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\}$$

amWhy
  • 209,954
5

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).$$

Clayton
  • 24,751
3

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}$.

Seirios
  • 33,157
3

For example:

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

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$.

  • 2
    Your last statement is incorrect. Since $\Bbb R^2$ and $\Bbb R$ have the same cardinality, there exists a bijection between them. – Clayton Mar 06 '13 at 05:34
  • There is a bijection between $\mathbb{R}^2$ and $\mathbb{R}$, it's just not continuous. And no one knows what it is… – Aeolian Mar 06 '13 at 05:37
  • 1
    @Aeolian Actually there are definable bijections between $\mathbb{R}^2$ and $\mathbb{R}$ (for example, see http://math.stackexchange.com/questions/123326/a-simple-bijection-between-mathbbr-and-mathbbr4-or-mathbbrn) – Trevor Wilson Mar 06 '13 at 08:11
  • @TrevorWilson Thanks for the correction. I learned something new, as well. – Aeolian Mar 06 '13 at 08:22
2

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

2

$f(1)=1$, $f(n)=n-1$ for each integer $n\ge 2$.

user127096
  • 9,683
Jared
  • 31
1

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.

Asaf Karagila
  • 393,674