16. Give an example of a function from

Answered question

2022-03-07

16. Give an example of a function from N to N that isa) one-to-one but not onto.b) onto but not one-to-one.c) both onto and one-to-one (but different from the identity function).d) neither one-to-one nor onto

Answer & Explanation

star233

star233

Skilled2022-03-14Added 403 answers

a) The objective is to give an example of a function from N to N that is one-to-one but not onto.

Let f:NN be defined as f(n)=n2

A function f:AB is one-to-one if and only if f(a)=f(b)a=b for a,bA.

A function f:AB is onto if and only if for every element bB there exist an element aA such that f(a)=b.

If aN and bN then,

f(a)=f(b)a2=b2a=b

The function is one-to-one.

Not every natural number is the square of a natural number.

For example, 2 is not a perfect square and thus 2 is not the image of any natural number. Thus, f is not onto.

Therefore, the function defined by f(n)=n2 is one-to-one but not onto.

b) The objective is to give an example of a function from N to N that is onto but not one-to-one

Let f:NN be defined as f(n)=[n/2].

For n=1,f(1)=[1/2]=[0.5]=1.

For n=2,f(2)=[2/2]=[1]=1.

The function is not one-to-one as different natural numbers have same image.

For nN, there is an image of 2n in N.

f(2n)=[2n/2]=[n]=n.

Thus, the function f is onto.

Therefore, the function defined by f(n)=[n/2] is onto but not one-to-one.

c) The objective is to give an example of a function from N to N that is both onto one-to-one.

Let f:NN be defined as f(n)={n+1if n is evenn1if n is odd.

If n,m is odd, then

f(n)=f(m)

n1=m1

n=m

if n,m is even, then

f(n)=f(m)

n+1=m+1

n=m

The function is one-to-one.

For nN and is odd, there is an image of n1 that is even such that

f(n1)=n1+1=n

For nN and is even, there is an image of n+1 that is even such that

f(n1)=n+11=n

Thus, the function f is onto.

Therefore, the function defined by f(n)={n+1if n is evenn1if n is odd is both one-to-one.

d) The objective is to give an example of a function from N to N that is neither one-to-one nor onto.

Let: f:NN br defined is f(n)=0

The function is not one-to-one as every integer has the same image 0.

The function is not onto, as every positive integer is not the image of any natural number.

Therefore, the function defined by f(n)=0 is neither one-to-one nor onto.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?