# discrete function - onto and 1-1

Printable View

• Oct 29th 2008, 12:35 PM
pila0688
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
• Oct 29th 2008, 01:03 PM
Plato
What about $f(n) = \left\lfloor {\frac{n}{2}} \right\rfloor$?
Which part does that answer?
• Oct 29th 2008, 11:57 PM
HallsofIvy
Quote:

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.

Quote:

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.
• Nov 2nd 2008, 04:17 PM
Unt0t
Would f(n) = n^2 be onto but not 1-1?