Function from Z to N: Onto N but Not One-to-One

  • Thread starter Thread starter nicnicman
  • Start date Start date
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
3 replies · 2K views
nicnicman
Messages
132
Reaction score
0
Hello all,

This is tripping me up a bit an I just want to see if I on the right track. Here is the problem:

Give a function from Z to N that is onto N but not one-to-one.

Answer: f(x) = {x if x ≥ 0, -1x if x < 0

Seems simple, but I think it works. Note: in our book, 0 is included in the set of natural numbers.
 
Physics news on Phys.org
nicnicman said:
Hello all,

This is tripping me up a bit an I just want to see if I on the right track. Here is the problem:

Give a function from Z to N that is onto N but not one-to-one.

Answer: f(x) = {x if x ≥ 0, -1x if x < 0

Seems simple, but I think it works. Note: in our book, 0 is included in the set of natural numbers.

That works. Your function is essentially the absolute value function, |x|, with its domain restricted to the integers.

Fair warning: The three parts of the homework template are there for a reason. In the future, when you post a problem, do not delete them.
 
Thanks for the help. And, I'll be sure to follow protocol next time.

I guess I could just do this:

f(x) = |x|