Skip to main content

Section 6.1 Introduction to Functions

Beginning Activity Beginning Activity 1: Functions from Previous Courses

One of the most important concepts in modern mathematics is that of a function. In previous mathematics courses, we have often thought of a function as some sort of input-output rule that assigns exactly one output to each input. So in this context, a function can be thought of as a procedure for associating with each element of some set, called the domain of the function, exactly one element of another set, called the codomain of the function. This procedure can be considered an input-output rule. The function takes the input, which is an element of the domain, and produces an output, which is an element of the codomain. In calculus and precalculus, the inputs and outputs were almost always real numbers. So the notation \(f( x ) = x^2 \sin x\) means the following:

  • \(f\) is the name of the function.

  • \(f( x )\) is a real number. It is the output of the function when the input is the real number \(x\text{.}\) For example,

    \begin{align*} f\left( {\frac{\pi }{2}} \right) \amp = \left( {\frac{\pi }{2}} \right)^2 \sin \left( {\frac{\pi } {2}} \right)\\ \amp = \frac{{\pi ^2 }}{4} \cdot 1\\ \amp = \frac{{\pi ^2 }}{4}\text{.} \end{align*}

For this function, it is understood that the domain of the function is the set \(\R\) of all real numbers. In this situation, we think of the domain as the set of all possible inputs. That is, the domain is the set of all possible real numbers \(x\) for which a real number output can be determined.

This is closely related to the equation \(y = x^2 \sin x\text{.}\) With this equation, we frequently think of \(x\) as the input and \(y\) as the output. In fact, we sometimes write \(y = f( x )\text{.}\) The key to remember is that a function must have exactly one output for each input. When we write an equation such as

\begin{equation*} y = \dfrac{1}{2}x^3 - 1\text{,} \end{equation*}

we can use this equation to define \(y\) as a function of \(x\text{.}\) This is because when we substitute a real number for \(x\) (the input), the equation produces exactly one real number for \(y\) (the output). We can give this function a name, such as \(g\text{,}\) and write

\begin{equation*} y = g( x ) = \frac{1}{2}x^3 - 1\text{.} \end{equation*}

However, as written, an equation such as

\begin{equation*} y^2 = x + 3 \end{equation*}

cannot be used to define \(y\) as a function of \(x\) since there are real numbers that can be substituted for \(x\) that will produce more than one possible value of \(y\text{.}\) For example, if \(x = 1\text{,}\) then \(y^2 = 4\text{,}\) and \(y\) could be \(-2\) or 2.

Which of the following equations can be used to define a function with \(x \in \R\) as the input and \(y \in \R\) as the output?

1.

\(y = x^2 - 2\)

2.

\(y^2 = x + 3\)

3.

\(y = \dfrac{1}{2}x^3 - 1\)

4.

\(y = \dfrac{1}{2} x\sin x\)

5.

\(x^2 + y^2 = 4\)

6.

\(y = 2x - 1\)

7.

\(y = \dfrac{x}{{x - 1}}\)

Beginning Activity Beginning Activity 2: Some Other Types of Functions

The domain and codomain of each of the functions in Beginning Activity 1 are the set \(\R\) of all real numbers, or some subset of \(\R\text{.}\) In most of these cases, the way in which the function associates elements of the domain with elements of the codomain is by a rule determined by some mathematical expression. For example, when we say that \(f\) is the function such that

\begin{equation*} f( x ) = \dfrac{x}{{x - 1}}\text{,} \end{equation*}

then the algebraic rule that determines the output of the function \(f\) when the input is \(x\) is \(\dfrac{x}{{x - 1}}\text{.}\) In this case, we would say that the domain of \(f\) is the set of all real numbers not equal to 1 since division by zero is not defined.

However, the concept of a function is much more general than this. The domain and codomain of a function can be any set, and the way in which a function associates elements of the domain with elements of the codomain can have many different forms. The input-output rule for a function can be a formula, a graph, a table, a random process, or a verbal description. We will explore two different examples in this activity.

1.

Let \(b\) be the function that assigns to each person his or her birthday (month and day). The domain of the function \(b\) is the set of all people and the codomain of \(b\) is the set of all days in a leap year (i.e., January 1 through December 31, including February 29).

(a)

Explain why \(b\) really is a function. We will call this the birthday function.

(b)

In 1995, Andrew Wiles became famous for publishing a proof of Fermat's Last Theorem. (See A. D. Aczel, Fermat's Last Theorem: Unlocking the Secret of an Ancient Mathematical Problem, Dell Publishing, New York, 1996.) Andrew Wiles's birthday is April 11, 1953. Translate this fact into functional notation using the ā€œbirthday functionā€ \(b\text{.}\) That is, fill in the spaces for the following question marks:

\begin{equation*} b( {\,?\,} ) = \,?\text{.} \end{equation*}
(c)

Is the following statement true or false? Explain.

For each day \(D\) of the year, there exists a person \(x\) such that \(b( x ) = D\text{.}\)
(d)

Is the following statement true or false? Explain.

For any people \(x\) and \(y\text{,}\) if \(x\) and \(y\) are different people, then \(b( x ) \ne b( y )\text{.}\)

2.

Let \(s\) be the function that associates with each natural number the sum of its distinct natural number divisors. This is called the sum of the divisors function. For example, the natural number divisors of 6 are 1, 2, 3, and 6, and so

\begin{align*} s( 6 ) \amp = 1 + 2 + 3 + 6\\ \amp = 12\text{.} \end{align*}
(a)

Calculate \(s( k )\) for each natural number \(k\) from 1 through 15.

(b)

Does there exist a natural number \(n\) such that \(s( n ) = 5\text{?}\) Justify your conclusion.

(c)

Is it possible to find two different natural numbers \(m\) and \(n\) such that \(s( m ) = s( n )\text{?}\) Explain.

(d)

Use your responses in TaskĀ 2.b TaskĀ 2.c to determine the truth value of each of the following statements.

(i)

For each \(m \in \mathbb{N}\text{,}\) there exists a natural number \(n\) such that \(s( n ) = m\text{.}\)

(ii)

For all \(m, n \in \mathbb{N}\text{,}\) if \(m \ne n\text{,}\) then \(s( m ) \ne s( n )\text{.}\)

Subsection The Definition of a Function

The concept of a function is much more general than the idea of a function used in calculus or precalculus. In particular, the domain and codomain do not have to be subsets of \(\mathbb{R}\text{.}\) In addition, the way in which a function associates elements of the domain with elements of the codomain can have many different forms. This input-output rule can be a formula, a graph, a table, a random process, a computer algorithm, or a verbal description. Two such examples were introduced in Beginning Activity 2.

For the birthday function, the domain would be the set of all people and the codomain would be the set of all days in a leap year. For the sum of the divisors function, the domain is the set \(\mathbb{N}\) of natural numbers, and the codomain could also be \(\mathbb{N}\text{.}\) In both of these cases, the input-output rule was a verbal description of how to assign an element of the codomain to an element of the domain.

We formally define the concept of a function as follows:

Definition.

A function from a set \(A\) to a set \(B\) is a rule that associates with each element \(x\) of the set \(A\) exactly one element of the set \(B\text{.}\) A function from \(A\) to \(B\) is also called a mapping from \(A\) to \(B\text{.}\)

Function Notation.

When we work with a function, we usually give it a name. The name is often a single letter, such as \(f\) or \(g\text{.}\) If \(f\) is a function from the set \(A\) to the set \(B\text{,}\) we will write \(f \colon A \to B\text{.}\) This is simply shorthand notation for the fact that \(f\) is a function from the set \(A\) to the set \(B\text{.}\) In this case, we also say that \(f\) maps \(A\) to \(B\text{.}\)

Definition.

Let \(f \colon A \to B\text{.}\) (This is read, ā€œLet \(f\) be a function from \(A\) to \(B\text{.}\)ā€ ) The set \(A\) is called the domain of the function \(f\text{,}\) and we write \(A = \text{ dom} ( f )\text{.}\) The set \(B\) is called the codomain of the function \(f\text{,}\) and we write \(B = \text{ codom} ( f )\text{.}\) If \(a \in A\text{,}\) then the element of \(B\) that is associated with \(a\) is denoted by \(f( a )\) and is called the image of \(\boldsymbol{a}\) under \(\boldsymbol{f}\). If \(f( a ) = b\text{,}\) with \(b \in B\text{,}\) then \(a\) is called a preimage of \(\boldsymbol{b}\) for \(\boldsymbol{f}\).

Some Function Terminology with an Example.

.

When we have a function \(f \colon A \to B\text{,}\) we often write \(y = f(x)\text{.}\) In this case, we consider \(x\) to be an unspecified object that can be chosen from the set \(A\text{,}\) and we would say that \(x\) is the independent variable of the function \(f\) and \(y\) is the dependent variable of the function \(f\text{.}\)

For a specific example, consider the function \(g \x \mathbb{R} \to \mathbb{R}\text{,}\) where \(g( x )\) is defined by the formula

\begin{equation*} g( x ) = x^2 - 2\text{.} \end{equation*}

Note that this is indeed a function since given any input \(x\) in the domain, \(\R\text{,}\) there is exactly one output \(g( x )\) in the codomain, \(\R\text{.}\) For example,

\begin{align*} g( { - 2} ) \amp = \left( { - 2} \right)^2 - 2 = 2,\\ g( 5 ) \amp = 5^2 - 2 = 23,\\ g( {\sqrt 2 } ) \amp = \left( {\sqrt 2 } \right)^2 - 2 = 0,\\ g( { - \sqrt 2 } ) \amp = \left( { - \sqrt 2 } \right)^2 - 2 = 0\text{.} \end{align*}

So we say that the image of \(-2\) under \(g\) is 2, the image of 5 under \(g\) is 23, and so on.

Notice in this case that the number 0 in the codomain has two preimages, \(- \sqrt 2 \text{ and } \sqrt 2\text{.}\) This does not violate the mathematical definition of a function since the definition only states that each input must produce one and only one output. That is, each element of the domain has exactly one image in the codomain. Nowhere does the definition stipulate that two different inputs must produce different outputs.

Finding the preimages of an element in the codomain can sometimes be difficult. In general, if \(y\) is in the codomain, to find its preimages, we need to ask, ā€œFor which values of \(x\) in the domain will we have \(y = g( x )\text{?}\)ā€ For example, for the function \(g\text{,}\) to find the preimages of 5, we need to find all \(x\) for which \(g( x ) = 5\text{.}\) In this case, since \(g( x ) = x^2 - 2\text{,}\) we can do this by solving the equation

\begin{equation*} x^2 - 2 = 5\text{.} \end{equation*}

The solutions of this equation are \(- \sqrt 7\) and \(\sqrt 7\text{.}\) So for the function \(g\text{,}\) the preimages of 5 are \(- \sqrt 7\) and \(\sqrt 7\text{.}\) We often use set notation for this and say that the set of preimages of 5 for the function \(g\) is \(\left\{ -\sqrt{7}, \sqrt{7} \right\}\text{.}\)

Also notice that for this function, not every element in the codomain has a preimage. For example, there is no input \(x\) such that \(g\left( x \right) = - 3\text{.}\) This is true since for all real numbers \(x\text{,}\) \(x^2 \geq 0\) and hence \(x^2 - 2 \geq - 2\text{.}\) This means that for all \(x\) in \(\mathbb{R}\text{,}\) \(g\left( x \right) \geq - 2\text{.}\)

Finally, note that we introduced the function \(g\) with the sentence, ā€œConsider the function \(g\x \mathbb{R} \to \mathbb{R}\text{,}\) where \(g( x )\) is defined by the formula \(g( x ) = x^2 - 2\text{.}\)ā€ This is one correct way to do this, but we will frequently shorten this to, ā€œLet \(g\x \mathbb{R} \to \mathbb{R}\) be defined by \(g( x ) = x^2 - 2\)ā€, or ā€œLet \(g\x \mathbb{R} \to \mathbb{R}\text{,}\) where \(g( x ) = x^2 - 2\text{.}\)ā€

Progress Check 6.1. Images and Preimages.

Let \(f\x \R \to \R\) be defined by \(f(x) = x^2 - 5x\) for all \(x \in \R\text{,}\) and let \(g\x \Z \to \Z\) be defined by \(g(m) = m^2 - 5m\) for all \(m \in \Z\text{.}\)

(a)

Determine \(f ( -3 )\) and \(f \left( \sqrt 8 \right)\text{.}\)

Solution.

\(f ( -3 ) = 24\) \(f ( \sqrt{8} ) = 8 - 5 \sqrt{8}\)

(b)

Determine \(g ( 2 )\) and \(g ( -2 )\text{.}\)

Solution.

\(g ( 2 ) = -6\text{,}\) \(g ( -2 ) = 14\)

(c)

Determine the set of all preimages of 6 for the function \(f\text{.}\)

Solution.

\(\left\{ -1, 6 \right\}\)

(d)

Determine the set of all preimages of 6 for the function \(g\text{.}\)

Solution.

\(\left\{ -1, 6 \right\}\)

(e)

Determine the set of all preimages of 2 for the function \(f\text{.}\)

Solution.

\(\left\{ \dfrac{5 + \sqrt{33}}{2}, \dfrac{5 - \sqrt{33}}{2} \right\}\)

(f)

Determine the set of all preimages of 2 for the function \(g\text{.}\)

Solution.

\(\emptyset\)

Subsection The Codomain and Range of a Function

Besides the domain and codomain, there is another important set associated with a function. The need for this was illustrated in the example of the function \(g\) in Some Function Terminology with an Example. For this function, it was noticed that there are elements in the codomain that have no preimage or, equivalently, there are elements in the codomain that are not the image of any element in the domain. The set we are talking about is the subset of the codomain consisting of all images of the elements of the domain of the function, and it is called the range of the function.

Definition.

Let \(f\x A \to B\text{.}\) The set \(\left\{ {f( x ) \mid x \in A} \right\}\) is called the range of the function \(\boldsymbol{f}\) and is denoted by \(\text{ range} \left( f \right)\text{.}\) The range of \(f\) is sometimes called the image of the function \(\boldsymbol{f}\) (or the image of \(\boldsymbol{A}\) under \(\boldsymbol{f}\)).

The range of \(f\x A \to B\) could equivalently be defined as follows:

\begin{equation*} \text{ range} ( f ) = \left\{ { {y \in B} \mid y = f\left( x \right)\text{ for some } x \in A} \right\}\!\text{.} \end{equation*}

Notice that this means that \(\text{ range} (f) \subseteq \text{ codom} (f)\) but does not necessarily mean that \(\text{ range} (f) = \text{ codom} (f)\text{.}\) Whether we have this set equality or not depends on the function \(f\text{.}\) More about this will be explored in SectionĀ 6.3.

Progress Check 6.2. Codomain and Range.

(a)

Let \(b\) be the function that assigns to each person his or her birthday (month and day).

(i)

What is the domain of this function?

Solution.

The domain of the function \(f\) is the set of all people.

(ii)

What is a codomain for this function?

Solution.

A codomain for the function \(f\) is the set of all days in a leap year.

(iii)

In Beginning Activity 2, we determined that the following statement is true: For each day \(D\) of the year, there exists a person \(x\) such that \(b( x ) = D\text{.}\) What does this tell us about the range of the function \(b\text{?}\) Explain.

Solution.

This means that the range of the function \(f\) is equal to its codomain.

(b)

Let \(s\) be the function that associates with each natural number the sum of its distinct natural number factors.

(i)

What is the domain of this function?

Solution.

The domain of the function \(s\) is the set of natural numbers.

(ii)

What is a codomain for this function?

Solution.

A codomain for the function \(s\) is the set of natural numbers.

(iii)

In Beginning Activity 2, we determined that the following statement is false:

For each \(m \in \mathbb{N}\text{,}\) there exists a natural number \(n\) such that \(s( n ) = m\text{.}\)
Give an example of a natural number \(m\) that shows this statement is false, and explain what this tells us about the range of the function \(s\text{.}\)

Solution.

This means that the range of \(s\) is not equal to the set of natural numbers.

Subsection The Graph of a Real Function

We will finish this section with methods to visually communicate information about two specific types of functions. The first is the familiar method of graphing functions that was a major part of some previous mathematics courses. For example, consider the function \(g \x \R \to \R\) defined by \(g(x) = x^2 - 2x - 1\text{.}\)

Graph of a parabola opening up extending from x = -2 to x = 4 and y = -2 to y = 6.
Figure 6.3. Graph of \(y = g( x )\text{,}\) where \(g( x ) = x^2 - 2x - 1\)

Every point on this graph corresponds to an ordered pair \(\left( {x,\;y} \right)\) of real numbers, where \(y = g( x ) = x^2 - 2x - 1\text{.}\) Because we use the Cartesian plane when drawing this type of graph, we can only use this type of graph when both the domain and the codomain of the function are subsets of the real numbers \(\R\text{.}\) Such a function is sometimes called a real function. The graph of a real function is a visual way to communicate information about the function. For example, the range of \(g\) is the set of all \(y\)-values that correspond to points on the graph. In this case, the graph of \(g\) is a parabola and has a vertex at the point \((1, -2)\text{.}\) (Note: The \(x\)-coordinate of the vertex can be found by using calculus and solving the equation \(f ' (x) = 0\text{.}\)) Since the graph of the function \(g\) is a parabola, we know that the pattern shown on the left end and the right end of the graph continues and we can conclude that the range of \(g\) is the set of all \(y \in \R\) such that \(y \geq -2\text{.}\) That is,

\begin{equation*} \text{ range} (g) = \{ y \in \R \mid y \geq -2 \}\text{.} \end{equation*}

Progress Check 6.4. Using the Graph of a Real Function.

The graph in FigureĀ 6.5 shows the graph of (slightly more than) two complete periods for a function \(f \x \R \to \R\text{,}\) where \(f(x) = A \sin (Bx)\) for some positive real number constants \(A\) and \(B\text{.}\)

Figure 6.5. Graph of \(y = f( x )\)
(a)

We can use the graph to estimate the output for various inputs. This is done by estimating the \(y\)-coordinate for the point on the graph with a specified \(x\)-coordinate. On the graph, draw vertical lines at \(x = - 1\) and \(x = 2\) and estimate the values of \(f( { - 1} )\) and \(f( 2 )\text{.}\)

Solution.

\(f(-1) \approx -3\) and \(f(2) \approx -2.5\text{.}\)

(b)

Similarly, we can estimate inputs of the function that produce a specified output. This is done by estimating the \(x\)-coordinates of the points on the graph that have a specified \(y\)-coordinate. Draw a horizontal line at \(y = 2\) and estimate at least two values of \(x\) such that \(f( x ) = 2\text{.}\)

Solution.

Values of \(x\) for which \(f(x) = 2\) are approximately \(-2.8, -1.9, 0.3, 1.2\text{,}\) and 3.5.

(c)

Use the graph in FigureĀ 6.5 to estimate the range of the function \(f\text{.}\)

Solution.

The range of \(f\) appears to be the closed interval \([-3.2, 3.2]\) or \(\{ y \in \R \mid -3.2 \leq y \leq 3.2 \}\text{.}\)

Subsection Arrow Diagrams

Sometimes the domain and codomain of a function are small, finite sets. When this is the case, we can define a function simply by specifying the outputs for each input in the domain. For example, if we let \(A = \left\{ {1, 2, 3} \right\}\) and let \(B = \left\{ {a, b} \right\}\text{,}\) we can define a function \(F\x A \to B\) by specifying that

\begin{equation*} F( 1 ) = a, F( 2 ) = a, \text{ and } F( 3 ) = b\text{.} \end{equation*}

This is a function since each element of the domain is mapped to exactly one element in \(B\text{.}\) A convenient way to illustrate or visualize this type of function is with a so-called arrow diagram as shown in FigureĀ 6.6.

Arrow diagram showing function F, A to B.
Figure 6.6. Arrow Diagram for a Function

An arrow diagram can be used when the domain and codomain of the function are finite (and small). We represent the elements of each set with points and then use arrows to show how the elements of the domain are associated with elements of the codomain. For example, the arrow from the point 2 in \(A\) to the point \(a\) in \(B\) represents the fact that \(F( 2 ) = a\text{.}\) In this case, we can use the arrow diagram in FigureĀ 6.6 to conclude that \(\text{ range} (F) = \{ a, b \}\text{.}\)

Progress Check 6.7. Working with Arrow Diagrams.

Let \(A = \left\{ {1, 2, 3, 4} \right\}\) and let \(B = \left\{ {a, b, c} \right\}\text{.}\)

Figure 6.8. Arrow Diagrams
(a)

Which of the arrow diagrams in FigureĀ 6.8 can be used to represent a function from \(A\) to \(B\text{?}\) Explain.

(b)

For those arrow diagrams that can be used to represent a function from \(A\) to \(B\text{,}\) determine the range of the function.

Solution.

Only the arrow diagram in FigureĀ (a) can be used to represent a function from \(A\) to \(B\text{.}\) The range of this function is the set \(\{ a, b \}\text{.}\)

Exercises Exercises

1.

Let \(f\x \mathbb{R} \to \mathbb{R}\) be defined by \(f\left( x \right) = x^2 - 2x\text{.}\)

(a)

Evaluate \(f( { - 3} ), f( { - 1} ), f( 1 ), \text{ and } f( 3 )\text{.}\)

Answer.

\(f(-3) = 15\text{,}\) \(f(-1) = 3\text{,}\) \(f(1) = -1\text{,}\) \(f(3) = 3\text{.}\)

(b)

Determine the set of all of the preimages of 0 and the set of all of the preimages of 4.

Answer.

The set of preimages of 0 is \(\left\{ 0, 2 \right\}\text{.}\) The set of preimages of 4 is \(\left\{ \dfrac{{2 - \sqrt {20} }}{2}, \dfrac{{2 + \sqrt {20} }}{2} \right\}\text{.}\) (Use the quadratic formula.)

(c)

Sketch a graph of the function \(f\text{.}\)

(d)

Determine the range of the function \(f\text{.}\)

Answer.

\(\text{ range} ( f ) = \left\{ y \in \mathbb{R} \mid y \geq - 1 \right\}\)

2.

Let \(\mathbb{R}^* = \left\{ { {x \in \mathbb{R}} \mid x \geq 0} \right\}\text{,}\) and let \(s\x \mathbb{R} \to \mathbb{R}^*\) be defined by \(s( x ) = x^2\text{.}\)

(a)

Evaluate \(s( { - 3} ), s( { - 1} ), s( 1 ), \text{ and } s( 3 )\text{.}\)

(b)

Determine the set of all of the preimages of 0 and the set of all preimages of 2.

(c)

Sketch a graph of the function \(s\text{.}\)

(d)

Determine the range of the function \(s\text{.}\)

3.

Let \(f\x \mathbb{Z} \to \mathbb{Z}\) be defined by \(f( m ) = 3 - m\text{.}\)

(a)

Evaluate \(f( { - 7} ), f( { - 3} ), f( 3 ), \text{ and } f( 7 )\text{.}\)

Answer.

\(f \left( -7 \right) = 10\text{,}\) \(f \left( -3 \right) = 6\text{,}\) \(f \left( 3 \right) = 0\text{,}\) \(f \left( 7 \right) = -4\text{.}\)

(b)

Determine the set of all of the preimages of 5 and the set of all of the preimages of 4.

Answer.

The set of preimages of 5 is \(\left\{ -2 \right\}\text{.}\) There set of preimages of 4 is \(\{-1\}\text{.}\)

(c)

Determine the range of the function \(f\text{.}\)

Answer.

\(\text{ range} \left( f \right) = \Z\text{.}\) Notice that for all \(y \in \Z\) (codomain), \(f(3 - y) = y\) and \((3 - y) \in \Z\) (domain).

(d)

This function can be considered a real function since \(\Z \subseteq \R\text{.}\) Sketch a graph of this function. Note: The graph will be an infinite set of points that lie on a line. However, it will not be a line since its domain is not \(\R\) but is \(\Z\text{.}\)

4.

Let \(f\x \mathbb{Z} \to \mathbb{Z}\) be defined by \(f( m ) = 2m + 1\text{.}\)

(a)

Evaluate \(f( { - 7} ), f( { - 3} ), f( 3 ), \text{ and } f( 7 )\text{.}\)

(b)

Determine the set of all of the preimages of 5 and the set of all of the preimages of 4.

Answer.

The set of preimages of 5 is \(\left\{ 2 \right\}\text{.}\) There set of preimages of 4 is \(\emptyset\text{.}\)

(c)

Determine the range of the function \(f\text{.}\)

Answer.

The range of the function \(f\) is the set of all odd integers.

(d)

Sketch a graph of the function \(f\text{.}\) See the comments in TaskĀ 3.d.

Answer.

The graph of the function \(f\) consists of an infinite set of discrete points.

5.

Recall that a real function is a function whose domain and codomain are subsets of the real numbers \(\R\text{.}\) (See The Graph of a Real Function.) Most of the functions used in calculus are real functions. Quite often, a real function is given by a formula or a graph with no specific reference to the domain or the codomain. In these cases, the usual convention is to assume that the domain of the real function \(f\) is the set of all real numbers \(x\) for which \(f( x )\) is a real number, and that the codomain is \(\mathbb{R}\text{.}\) For example, if we define the (real) function \(f\) by

\begin{equation*} f( x ) = \frac{x}{{x - 2}}\text{,} \end{equation*}

we would be assuming that the domain is the set of all real numbers that are not equal to 2 and that the codomain is \(\R\text{.}\)

Determine the domain and range of each of the following real functions. It might help to use a graphing calculator to plot a graph of the function.

(a)

The function \(k\) defined by \(k( x ) = \sqrt {x - 3}\)

(b)

The function \(F\) defined by \(F( x ) = \ln \left( {2x - 1} \right)\)

Answer.

\(\text{ dom} ( F ) = \left\{ {x \in \mathbb{R} \mid x > \dfrac{1}{2}} \right\}\text{,}\) \(\text{ range} ( F ) = \mathbb{R}\)

(c)

The function \(f\) defined by \(f( x ) = 3\sin( {2x} )\)

(d)

The function \(g\) defined by \(g( x ) = \dfrac{4}{{x^2 - 4}}\)

Answer.

\(\text{ dom} ( g ) = \left\{ {x \in \mathbb{R} \mid x \ne 2\text{ and } x \ne - 2} \right\}\text{,}\) \(\text{ range} ( g ) = \left\{ { {y \in \mathbb{R} } \mid y > 0} \right\} \cup \left\{ {y \in \mathbb{R} \mid y \leq - 1} \right\}\)

(e)

The function \(G\) defined by \(G(x) = 4 \cos \left( \pi x \right) + 8\)

6. The number of divisors function.

Let \(d\) be the function that associates with each natural number the number of its natural number divisors. That is, \(d\x \mathbb{N} \to \mathbb{N}\) where \(d( n )\) is the number of natural number divisors of \(n\text{.}\) For example, \(d( 6 ) = 4\) since 1, 2, 3, and 6 are the natural number divisors of 6.

(a)

Calculate \(d( k )\) for each natural number \(k\) from 1 through 12.

Answer.

\(d ( 1 ) = 1\text{,}\) \(d ( 2 ) = 2\text{,}\) \(d ( 3 ) = 2\text{,}\) \(d ( 4 ) = 3\text{,}\) \(d(5) = 2\text{,}\) \(d(6) = 4\text{,}\) \(d(7) = 2\text{,}\) \(d ( 8 ) = 4\text{,}\) \(d ( 9 ) = 3\text{,}\) \(d(10) = 4\text{,}\) \(d(11) = 2\text{,}\) \(d(12) = 6\text{.}\)

(b)

Does there exist a natural number \(n\) such that \(d( n ) = 1\text{?}\) What is the set of preimages of the natural number 1?

Answer.

There is no natural number \(n\) other than 1 such that \(d ( n ) = 1\) since every natural number greater than one has at least two divisors. The set of preimages of 1 is \(\{1 \}\text{.}\)

(c)

Does there exist a natural number \(n\) such that \(d( n ) = 2\text{?}\) If so, determine the set of all preimages of the natural number 2.

Answer.

The only natural numbers \(n\) such that \(d( n ) = 2\) are the prime numbers. The set of preimages of the natural number 2 is the set of prime numbers.

(d)

Is the following statement true or false? Justify your conclusion.

For all \(m, n \in \mathbb{N}\text{,}\) if \(m \ne n\text{,}\) then \(d( m ) \ne d( n )\text{.}\)

Answer.

The statement is false. A counterexample is \(m = 2\) and \(n = 3\) since \(d( 2 ) = 2\) and \(d( 3 ) = 2\text{.}\)

(e)

Calculate \(d\!\left( {2^k } \right)\) for \(k = 0\) and for each natural number \(k\) from 1 through 6.

Answer.

\(d \left( 2^0 \right) = 1\text{,}\) \(d \left( 2^1 \right) = 2\text{,}\) \(d \left( 2^2 \right) = 3\text{,}\) \(d \left( 2^3 \right) = 4\text{,}\) \(d \left( 2^4 \right) = 5\text{,}\) \(d \left( 2^5 \right) = 6\text{,}\) and \(d \left( 2^6 \right) = 7\text{.}\)

(f)

Based on your work in TaskĀ 6.e, make a conjecture for a formula for \(d\!\left( {2^n } \right)\) where \(n\) is a nonnegative integer. Then explain why your conjecture is correct.

Answer.

For each nonnegative integer \(n\text{,}\) the divisors of \(2^n\) are \(2^0, 2^1, 2^2, \ldots, 2^{n-1}\text{,}\) and \(2^n\text{.}\) This is a list of \(n+1\) natural numbers and so \(d(2^n) = n+1\text{.}\)

(g)

Is the following statement is true or false?

For each \(n \in \mathbb{N}\text{,}\) there exists a natural number \(m\) such that \(d( m ) = n\text{.}\)

Answer.

The statement is true. To prove this, let \(n\) be a natural number. Then \(2^{n-1} \in \N\) and \(d \left( 2^{n-1} \right) = (n - 1) + 1 = n\text{.}\)

7.

\(d\)

In ExerciseĀ 6, we introduced the number of divisors function. For this function, \(d\x \mathbb{N} \to \mathbb{N}\text{,}\) where \(d( n )\) is the number of natural number divisors of \(n\text{.}\) A function that is related to this function is the so-called set of divisors function. This can be defined as a function \(S\) that associates with each natural number the set of its distinct natural number factors. For example, \(S( 6 ) = \left\{ {1, 2, 3, 6} \right\}\) and \(S(10) = \{1, 2, 5, 10 \}\text{.}\)

(a)

Discuss the function \(S\) by carefully stating its domain, codomain, and its rule for determining outputs.

Answer.

The domain of \(S\) is \(\N\text{.}\) The power set of \(\N\text{,}\) \(\mathcal{P} ( \N )\text{,}\) can be the codomain. The rule for determining outputs is that for each \(n \in \N\text{,}\) \(S(n)\) is the set of all distinct natural number factors of \(n\text{.}\)

(b)

Determine \(S( n )\) for at least five different values of \(n\text{.}\)

Answer.

For example, \(S( 8 ) = \left\{ {1, 2, 4, 8} \right\}\text{,}\) \(S( {15} ) = \left\{ {1, 3, 5, 15} \right\}\text{.}\)

(c)

Determine \(S( n )\) for at least three different prime number values of \(n\text{.}\)

Answer.

For example, \(S( 2 ) = \left\{ {1, 2} \right\}\text{,}\) \(S( 3 ) = \left\{ {1, 3} \right\}\text{,}\) \(S( {31} ) = \left\{ {1, 31} \right\}\text{.}\)

(d)

Does there exist a natural number \(n\) such that \(\card (S(n)) = 1\text{?}\) Explain. [Recall that \(\card (S(n))\) is the number of elements in the set \(S( n )\text{.}\)]

(e)

Does there exist a natural number \(n\) such that \(\card (S(n)) = 2\text{?}\) Explain.

(f)

Write the output for the function \(d\) in terms of the output for the function \(S\text{.}\) That is, write \(d( n )\) in terms of \(S( n )\text{.}\)

(g)

Is the following statement true or false? Justify your conclusion.

For all natural numbers \(m\) and \(n\text{,}\) if \(m \ne n\text{,}\) then \(S ( m ) \ne S ( n )\text{.}\)

(h)

Is the following statement true or false? Justify your conclusion.

For all sets \(T\) that are subsets of \(\mathbb{N}\text{,}\) there exists a natural number \(n\) such that \(S( n ) = T\text{.}\)

Activity 34. Creating Functions with Finite Domains.

Let \(A = \left\{ {a,b,c,d} \right\}\text{,}\) \(B = \left\{ {a,b,c} \right\}\text{,}\) and \(C = \left\{ {s,t,u,v} \right\}\text{.}\) In each of the following exercises, draw an arrow diagram to represent your function when it is appropriate.

(a)

Create a function \(f\x A \to C\) whose range is the set \(C\) or explain why it is not possible to construct such a function.

(b)

Create a function \(f\x A \to C\) whose range is the set \(\left\{ {u, v} \right\}\) or explain why it is not possible to construct such a function.

(c)

Create a function \(f\x B \to C\) whose range is the set \(C\) or explain why it is not possible to construct such a function.

(d)

Create a function \(f\x A \to C\) whose range is the set \(\left\{ u \right\}\) or explain why it is not possible to construct such a function.

(e)

If possible, create a function \(f\x A \to C\) that satisfies the following condition:

For all \(x, y \in A\text{,}\) if \(x \ne y\text{,}\) then \(f( x ) \ne f( y )\text{.}\)
If it is not possible to create such a function, explain why.

(f)

If possible, create a function \(f\x A \to \left\{ {s, t, u} \right\}\) that satisfies the following condition:

For all \(x, y \in A\text{,}\) if \(x \ne y\text{,}\) then \(f( x ) \ne f( y )\text{.}\)
If it is not possible to create such a function, explain why.