Skip to main content

Beginning Activity Beginning Activity 2: A Function from N to Z

In this activity, we will define and explore a function f:NZ. We will start by defining f(n) for the first few natural numbers n.

f(1)=0f(2)=1f(3)=1f(4)=2f(5)=2f(6)=3f(7)=3

Notice that if we list the outputs of f in the order f(1),f(2),f(3),, we create the following list of integers: 0,1,1,2,2,3,3,. We can also illustrate the outputs of this function with the following diagram:

1 2 3 4 5 6 7 8 9 10
0 1 1 2 2 3 3 4 4 5
Figure 9.10. A Function from N to Z

1.

If the pattern suggested by the function values we have defined continues, what are f(11) and f(12)? What is f(n) for n from 13 to 16?

2.

If the pattern of outputs continues, does the function f appear to be an injection? Does f appear to be a surjection? (Formal proofs are not required.)

We will now attempt to determine a formula for f(n), where nN. We will actually determine two formulas: one for when n is even and one for when n is odd.

3.

Look at the pattern of the values of f(n) when n is even. What appears to be a formula for f(n) when n is even?

4.

Look at the pattern of the values of f(n) when n is odd. What appears to be a formula for f(n) when n is odd?

5.

Use the work in Exercise 3 and Exercise 4 to complete the following: Define f:NZ, where

f(n)={?? if n is even ?? if n is odd .

6.

Use the formula in Exercise 5 to

(a)

Calculate f(1) through f(10). Are these results consistent with the pattern exhibited at the start of this activity?

(b)

Calculate f(1000) and f(1001).

(c)

Determine the value of n so that f(n)=1000.