# Math Help - discrete function - onto and 1-1

1. ## discrete function - onto and 1-1

Give a example of a function from N to N (naturals) that is
a) one-to-one and onto
b) onto but not one-to-one

2. What about $f(n) = \left\lfloor {\frac{n}{2}} \right\rfloor$?
Which part does that answer?

3. Originally Posted by pila0688
Give a example of a function from N to N (naturals) that is
a) one-to-one and ontoo
An obvious answer: f(n)= n.

b) onto but not one-to-one
Try mapping each even number, 2n, into n and each odd number, 2n+ 1 into n.

That is, 1->1, 2->1, 3->2, 4->2, etc.

4. Would f(n) = n^2 be onto but not 1-1?