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

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\to\mathbb$. Help?

399k 47 47 gold badges 628 628 silver badges 1k 1k bronze badges asked Mar 6, 2013 at 5:22 Username Unknown Username Unknown 4,683 9 9 gold badges 58 58 silver badges 109 109 bronze badges $\begingroup$ Any fonction is surjective onto its image. Just pick a non-injective one. $\endgroup$ Commented Mar 6, 2013 at 13:38

9 Answers 9

$\begingroup$ answered Mar 6, 2013 at 5:29 Zev Chonoles Zev Chonoles 131k 21 21 gold badges 337 337 silver badges 547 547 bronze badges

$\begingroup$ +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. $\endgroup$

Commented Mar 6, 2013 at 5:36 $\begingroup$ "+1" for wicked TeX. (And for a perfect "illustration" of the concept.) $\endgroup$ Commented Mar 6, 2013 at 5:39 $\begingroup$

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

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

answered Mar 6, 2013 at 5:47 211k 186 186 gold badges 280 280 silver badges 504 504 bronze badges $\begingroup$

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

answered Mar 6, 2013 at 5:26 24.9k 7 7 gold badges 56 56 silver badges 112 112 bronze badges $\begingroup$ answered Mar 6, 2013 at 5:29 67.6k 12 12 gold badges 75 75 silver badges 201 201 bronze badges $\begingroup$ Nice example! +1 Hope you had a great day at Uni! $\endgroup$ Commented Mar 12, 2013 at 15:06 $\begingroup$

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

answered Mar 6, 2013 at 5:25 33.4k 6 6 gold badges 83 83 silver badges 148 148 bronze badges $\begingroup$

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^2$ to $\mathbb$. It is clearly onto, but since we always ignore $y$, it's also not one-to-one:

answered Mar 6, 2013 at 5:26 tacos_tacos_tacos tacos_tacos_tacos 1,996 1 1 gold badge 18 18 silver badges 33 33 bronze badges

$\begingroup$ Your last statement is incorrect. Since $\Bbb R^2$ and $\Bbb R$ have the same cardinality, there exists a bijection between them. $\endgroup$

Commented Mar 6, 2013 at 5:34

$\begingroup$ There is a bijection between $\mathbb^2$ and $\mathbb$, it's just not continuous. And no one knows what it is… $\endgroup$

Commented Mar 6, 2013 at 5:37

$\begingroup$ @Aeolian Actually there are definable bijections between $\mathbb^2$ and $\mathbb$ (for example, see math.stackexchange.com/questions/123326/…) $\endgroup$