An illustration of how a function is defined using a rule

An illustration of how a function is defined using a rule

IB Year 5 | Grade 11

Let \(\mathbb{Z}\) denote the set of all integers and define \(\mathrm{f} : \mathbb{Z} \rightarrow \mathbb{Z}\) as follows:

\[ \mathrm{f}(x) = \begin{cases} \frac{x}{2} & \text{if}\hspace{0.5em} x \text{ is even;} \\ 3x + 1 & \text{if}\hspace{0.5em} x \text{ is odd.} \end{cases} \]

Notice that the rule that defines \(\mathrm{f}\) is not a single algebraic expression, but nevertheless, it gives a unique value for the output \(\mathrm{f}(x)\) for every input \(x\) taken from the domain \(D_f = \mathbb{Z}\).

This example is also very interesting in that it is not so direct to obtain the range of \(\mathrm{f}\) by sketching the graph of \(y = \mathrm{f}(x)\). Indeed, you don't even get a continuous curve. Instead, you get a set of dots \((x, y)\), where \(x\) and \(y\) are integers.

One wonders whether \(R_f = \mathbb{Z}\), i.e., whether every integer \(y \in \mathbb{Z}\) is the image of some integer \(x\) under \(\mathrm{f}\)? But this question is not difficult to answer.

Take any random integer \(y\). Then \(y = \frac{2y}{2} = \mathrm{f}(2y)\) based on the fact that \(2y\) is certainly an even integer and the very definition of \(\mathrm{f}\).

Hence, we can be certain that \(R_f = \mathbb{Z}\).

The above function \(f\) is known as the Collatz function. Related to this function is a famous open problem in number theory -- The Collatz Conjecture -- which Paul Erdos once commented that "Mathematics is not ready for it."

The Collatz Conjecture states that for every input \(n \in \mathbb{Z}^+\), there exists an \(m \in \mathbb{Z}^+\) such that
\[ f^{(m)}(n) = 1. \]
Here, \(f^{(m)}\) stands for the \(m\)-fold composition of \(f\), a concept we will see in our ensuing development.

Create a free account to practise similar questions.

Need help? Join our JC Math tuition classes.

Learn more