A function is called onto if the range of the function is same as the codomain
of the function.
•
f : R −→ N
f(n) = (
0 if n ∈ Q
1 otherwise
Range(f) = {0, 1}, is not the same as Codomain(f) = N.
•
f : N −→ N
f(n) = (
n if n is even
n + 1 otherwise
Range(f) = Set of even numbers, is not same as Codomain(f) = N.
•
f : N −→ N
f(n) = (
n if n is odd
2n otherwise
Range(f) = N \ {2}, is not the same as Codomain(f) = N.
•
f : N −→
N
f(n) = (
n
2
if n is even
n + 1 otherwise
Range(f) = N, is same as Codomain(f) = N. Hence f is onto.
•
f : R −→ R
f(n) = n
Range(f) = R, is same as Codomain(f) = R. Hence f is onto
can you please explain cuz i still dont understand this...how did they find out the range.. please help