SOLUTION: Give an example of a function (a) f∶ Z→N that is both 1-1 and onto. (b) f∶ N→Z that is both 1-1 and onto

Algebra.Com
Question 1074720: Give an example of a function
(a) f∶ Z→N that is both 1-1 and onto.
(b) f∶ N→Z that is both 1-1 and onto

Answer by ikleyn(52915)   (Show Source): You can put this solution on YOUR website!
.
Give an example of a function
(a) f∶ Z→N that is both 1-1 and onto.
(b) f∶ N→Z that is both 1-1 and onto
~~~~~~~~~~~~~~~~~~~~~~~

(a)  f: Z --> N  that is both 1-1 and onto. 


     It may seem to be strange but in Math (Math with the capital M, i.e, in the TRUE Math) you may find different definitions of 
     what is natural number.  

     Some mathematicians include 0 (zero) to natural.
     Others no.   See this Wikipedia article: https://en.wikipedia.org/wiki/Natural_number

                                              https://en.wikipedia.org/wiki/Natural_number


     In what follows I will include 0 to naturals (for simplicity, ha-ha-ha).

     My example of such function is 

         f(0) = 0,
         f(n) = 2n       for positive integer n,   and
         f(n) = 2|n|-1   for negative integer n.

     (in other words, positive n go to the even positive integers; negative n go to the odd positive integers.)


     It is clear that this map is "onto",   and

     It is clear that it is "1-1".



(b)  You can easily construct an example for (b), reversing the function from (a).


RELATED QUESTIONS

Let f∶ Z×Z→Z×Z be defined as f(m,n)=(3m+7n,2m+5n). Is f a bijection,... (answered by Fombitz)
Determine whether the function f : Z × Z → Z is onto if a) f (m, n) = m. b) f (m, (answered by Edwin McCravy)
Suppose f∶ R→R and g∶ R→R where g(x)=2x+1 and g○f(x)=2x+11. (answered by Fombitz)
Let f∶ R→Z, where f(x)=⌈2x−1⌉. (a) Find f(A), where... (answered by Fombitz)
The range of the function f: N→N defined by f(x)=... (answered by stanbon,tommyt3rd)
The range of the function f: N→N defined by f(x)=... (answered by tommyt3rd)
prove that if k>1 then k^n→∞ an n→∞ there is a hint given.... (answered by richard1234)
If N represents the set of natural numbers, and the function f: N → N such that... (answered by ikleyn)
If N represents the set of natural numbers, and the function f: N → N such that... (answered by MathLover1)