Skip to main content

Beginning Activity Beginning Activity 2: A Function from \(\boldsymbol{\N}\) to \(\boldsymbol{\Z}\)

In this activity, we will define and explore a function \(f:\mathbb{N} \to \mathbb{Z}\text{.}\) We will start by defining \(f ( n )\) for the first few natural numbers \(n\text{.}\)

\begin{align*} f ( 1 ) \amp = 0 \amp \\ f ( 2 ) \amp = 1 \amp f ( 3 ) \amp = -1\\ f ( 4 ) \amp = 2 \amp f ( 5 ) \amp = -2\\ f ( 6 ) \amp = 3 \amp f ( 7 ) \amp = -3 \end{align*}

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

1 2 3 4 5 6 7 8 9 10 \(\cdots\)
\(\downarrow\) \(\downarrow\) \(\downarrow\) \(\downarrow\) \(\downarrow\) \(\downarrow\) \(\downarrow\) \(\downarrow\) \(\downarrow\) \(\downarrow\) \(\cdots\)
0 1 \(-1\) 2 \(-2\) 3 \(-3\) 4 \(-4\) 5 \(\cdots\)
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 )\text{?}\) 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 )\text{,}\) where \(n \in \mathbb{N}\text{.}\) 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\x \mathbb{N} \to \mathbb{Z}\text{,}\) where

\begin{equation*} f ( n ) = \left\{ \begin{gathered} ?? \text{ if } n \text{ is even } \\ \\ ?? \text{ if } n \text{ is odd } . \end{gathered} \right. \end{equation*}

6.

Use the formula in Exercise 5 to

(a)

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

(b)

Calculate \(f ( 1000 )\) and \(f ( 1001 )\text{.}\)

(c)

Determine the value of \(n\) so that \(f ( n ) = 1000\text{.}\)