Does there exist a function f Q Z which is onto How about a
Does there exist a function f : Q Z which is onto? How about an onto function
g : Z+ Z?
Solution
A function f : A B is called onto if for every b B, there is an a A such that f (a) = b. Q is the set of rational numbers and Z is the set of integers. Z+ is the set of positive integers. An arbitrary element of Q is of the form a/b where a and b are integers.
Let us define f: Q Z as under:
f ( a/b) = a . Then, for every integer a in Z ( positive, or negative) , there is an a/b in Q such that f ( a/b) = a. Also, for the integer 0 Z, there is 0 Q, such that f (0) = 0. Thus f is onto.
Now, let us see whether there can be an onto function g from Z+ to Z. Let us define a function g: Z+ Z as under:
g ( mod (a)) = a and g ( 0) = 0 . Then, every integer in Z, positive or negative, is a positive integer mod(a) in Z+ such that g ( mod (a) ) = a . Also g (0) = 0. Obviously, g is onto.
