# Injective/Surjective.

• Oct 29th 2009, 04:54 PM
GreenDay14
Injective/Surjective.
I have a question here that asks to:

Give an example of a function N --> N that is

i) onto but not one-to-one
ii) neither one-to-one nor onto
iii) both one-to-one and onto.

If anyone could help me with any of these, it would be greatly appreciate. Thanks.
• Oct 29th 2009, 08:51 PM
ux0
Quote:

Originally Posted by GreenDay14
I have a question here that asks to:

Give an example of a function N --> N that is

i) onto but not one-to-one
ii) neither one-to-one nor onto
iii) both one-to-one and onto.

If anyone could help me with any of these, it would be greatly appreciate. Thanks.

i) $\displaystyle f(x)=1$ ... a simple constant function works here, because you can use all values of x in the natural numbers, but you just get one value for f(x) which is in the co-domain.

ii) not sure if this one is correct but what if we used $\displaystyle f(x)=-x$, in this case it is mapping the natural numbers to a co-domain that isn't the natural numbers, which is not onto, or one-to-one...

iii) $\displaystyle f(x)=x$ it is just mapping the natural numbers, to the natural numbers, therefore its onto and one-to-one, but you might want to do a formula proof of each of these using the definitions.
• Oct 30th 2009, 06:30 AM
HallsofIvy
Quote:

Originally Posted by ux0
i) $\displaystyle f(x)=1$ ... a simple constant function works here, because you can use all values of x in the natural numbers, but you just get one value for f(x) which is in the co-domain.

No, that's not "onto"- if fact, it's very badly not "onto"! Nothing is mapped into any number other than 1! An example of a function that is "onto" but not "one to one" would be f(1)= 1, f(2)= 1, f(n)= n-1 for n> 2.

Quote:

i) not sure if this one is correct but what if we used $\displaystyle f(x)=-x$, in this case it is mapping the natural numbers to a co-domain that isn't the natural numbers, which is not onto, or one-to-one...
No, that isn't correct either. The problem specifically asked for a function from N to N (N->N) and that is not. Actually, your first example, f(n)= 1 for all n is neither "onto" nor "one to one".

Quote:

$\displaystyle f(x)=x$ it is just mapping the natural numbers, to the natural numbers, therefore its onto and one-to-one, but you might want to do a formula proof of each of these using the definitions.
Yes, this works fine.
• Oct 30th 2009, 05:25 PM
ux0
yup i'm a big dummy... even though the question didn't ask, if you had $\displaystyle f(x)=x^2$... would this be an example of a function that is one-to-one, but not onto, seeing you don't get the entire co-domain, but you do get a unique value for every x...
• Oct 31st 2009, 02:01 AM
HallsofIvy
Quote:

Originally Posted by ux0
yup i'm a big dummy... even though the question didn't ask, if you had $\displaystyle f(x)=x^2$... would this be an example of a function that is one-to-one, but not onto, seeing you don't get the entire co-domain, but you do get a unique value for every x...

If you mean from R to R, no, it is not "one to one" because f(-1)= f(1).

Getting "a unique value for every x" is the definition of function, not "one-to-one". A function if one to one if f(x)= f(y) only when x=y.
• Oct 31st 2009, 07:04 AM
ux0
No, I meant it for this example... $\displaystyle N \rightarrow N$
• Oct 31st 2009, 07:14 AM
Defunkt
Quote:

Originally Posted by ux0
No, I meant it for this example... $\displaystyle N \rightarrow N$

Yes, if $\displaystyle f:\mathbb{N} \to \mathbb{N}$ is defined by $\displaystyle f(x) = x^2$ then it is:

(1) one-one: $\displaystyle x^2 = y^2 \Rightarrow x=y$

(2) not onto: What is the source of 3?