# Thread: example of a function (one to one & onto)

1. ## example of a function (one to one & onto)

Give an example of a function from N to N that is one to one but not onto

My answer is the function from {a,b,c} to {1,2,3,4} with f(a) = 3, f(b) = 4, f(c) = 1. Is this the correct example to this question? What does it mean from N to N?

2. Originally Posted by TheRekz
Give an example of a function from N to N that is one to one but not onto

My answer is the function from {a,b,c} to {1,2,3,4} with f(a) = 3, f(b) = 4, f(c) = 1. Is this the correct example to this question? What does it mean from N to N?
f(1)=2, f(2)=3, f(3)=4, ... f(n) = n+1, ...

3. Originally Posted by TheRekz
Give an example of a function from N to N that is one to one but not onto
My answer is the function from {a,b,c} to {1,2,3,4} with f(a) = 3, f(b) = 4, f(c) = 1. Is this the correct example to this question? What does it mean from N to N?
No it is not correct.
First N is the set of counting numbers either {0,1,2,3,...} or {1,2,3,4,...} (i.e. it contains 0 or not depending on your textbook). So N is infinite; so your example must be infinite also. Here is another example in addition to the one given above.
$f:N \mapsto N,\quad \left( {n \in N} \right)\left[ {f(n) = 2^n } \right]\quad$

4. Note if $S$ is a finite set it is NOT POSSIBLE to find:

$f:S\to S$ that is one-to-one but not onto. This is a consequence of the Pigeonhole Principle. This is a distinction between finite and infinite sets.

5. Originally Posted by Plato
No it is not correct.
First N is the set of counting numbers either {0,1,2,3,...} or {1,2,3,4,...} (i.e. it contains 0 or not depending on your textbook). So N is infinite; so your example must be infinite also. Here is another example in addition to the one given above.
$f:N \mapsto N,\quad \left( {n \in N} \right)\left[ {f(n) = 2^n } \right]\quad$
so what you're saying is that the function f(x) = 2^x will work as an example of this question?

6. Originally Posted by TheRekz
so what you're saying is that the function f(x) = 2^x will work as an example of this question?
Yes. The function I gave it even simpler.

7. What if the question is neither one to one nor onto? What would be a perfect example? Would x^2 + 1 work?

8. Originally Posted by TheRekz
What if the question is neither one to one nor onto? What would be a perfect example? Would x^2 + 1 work?
x^2+1 is one-to-one in this case.

f(1)=1
f(2)=1
f(3)=1
f(4)=1
...
f(n)=1

9. Originally Posted by TheRekz
What if the question is neither one to one nor onto? What would be a perfect example? Would x^2 + 1 work?
No! Because the elements of N are non-negative that function is one-to-one.
Look at the function $f:N \mapsto N,\quad f(n) = \text{floor}\left( {\frac{{n + 5}}{2}} \right)$

10. can you give me other examples that does not use the floor operator?

11. N is a set of natural numbers right? And a natural number can't be negative?

12. Originally Posted by TheRekz
N is a set of natural numbers right? And a natural number can't be negative?
correct. the natural numbers is the set of positive integers: 1,2,3,4,5,6....

13. Originally Posted by TheRekz
N is a set of natural numbers right? And a natural number can't be negative?
Look! We do not know what textbook or set of notes you are following.
Sorry to say, but it is true nonetheless, there are no hard and fast definition in mathematics. So you read the definition of $N$ in your text material. Most texts that I have seen require $N$ to be either {0,1,2,3,…} or {1,2,3,…}*. So yes the customary and usual definitions of $N$ mean that the set is made of non-negative integers.

* See this site: Counting Number -- from Wolfram MathWorld