1 Functions as Mappings

Mathematics can be thought of as the study of patterns. In most disciplines, Mathematics is used as a language to express, or codify, relationships between quantities - both algebraically and geometrically - with the ultimate goal of solving real-world problems. The fact that the same algebraic equation which models the growth of bacteria in a petri dish is also used to compute the account balance of a savings account or the potency of radioactive material used in medical treatments speaks to the universal nature of Mathematics. Indeed, Mathematics is more than just about solving a specific problem in a specific situation, it’s about abstracting problems and creating universal tools which can be used by a variety of scientists and engineers to solve a variety of problems.

This power of abstraction has a tendency to create a language that is initially intimidating to students. Mathematical definitions are precise and adherence to that precision is often a source of confusion and frustration. It doesn’t help matters that more often than not very common words are used in Mathematics with slightly different definitions than is commonly expected. The first ‘universal tool’ we wish to highlight - the concept of a ‘function’ - is a perfect example of this phenomenon in that we redefine a word that already has multiple meanings in English.

The grammar here ‘from \(A\) to \(B\,\)’ is important. Thinking of a function as a process, we can view the elements of the set \(A\) as our starting materials, or inputs to the process. The function processes these inputs according to some specified rule and the result is a set of outputs - elements of the set \(B\). In terms of inputs and outputs, Definition 1 says that a function is a process in which each input is matched to one and only one output.

For example, let’s take a look at some of the pets in the Stitz household. Taylor’s pets include White Paw and Cooper (both cats), Bingo (a lizard) and Kennie (a turtle). Let \(N\) be the set of pet names: \(N = \{ \text {White Paw, Cooper, Bingo, Kennie} \}\), and let \(T\) be the set of pet types: \(T = \{ \text {cat, lizard, turtle} \}\). Let \(f\) be the process that takes each pet’s name as the input and returns that pet’s type as the output. Let \(g\) be the reverse of \(f\): that is, \(g\) takes each pet type as the input and returns the names of the pets of that type as the output. Note that both \(f\) and \(g\) are codifying the same given information about Taylor’s pets, but one of them is a function and the other is not.

To help identify which process \(f\) or \(g\) is a function and why the other is not, we create mapping diagrams for \(f\) and \(g\) below. In each case, we organize the inputs in a column on the left and the outputs in a column on the right. We draw an arrow connecting each input to its corresponding output(s). Note that the arrows communicate the grammatical bias: the arrow originates at the input and points to the output.

Figure 1: Mapping diagram for \(f\)

Figure 2: Mapping diagram for \(g\)
Show Alt Text Mapping diagrams illustrating a function and its reverse. In the top diagram, the function \(f\) maps the inputs White Paw, Cooper, Bingo, and Kennie to the outputs cat, cat, lizard, and turtle, respectively. In the bottom diagram, the function \(g\) maps cat to White Paw and Cooper, lizard to Bingo, and turtle to Kennie.

The process \(f\) is a function since \(f\) matches each of its inputs (each pet name) to just one output (the pet’s type). The fact that different inputs (White Paw and Cooper) are matched to the same output (cat) is fine. On the other hand, \(g\) matches the input ‘cat’ to the two different outputs ‘White Paw’ and ‘Cooper’, so \(g\) is not a function. Functions are favored in mathematical circles because they are processes which produce only one answer (output) for any given query (input). In this scenario, for instance, there is only one answer to the question: ‘What type of pet is White Paw?’ but there is more than one answer to the question ‘Which of Taylor’s pets are cats?’

As you might expect, with functions being such an important concept in Mathematics, we need to build a vocabulary to assist us when discussing them. To that end, we have the following definitions.

Some remarks about Definition 2 are in order. First, and most importantly, the notation ‘\(f(a)\)’ in Definition 2 introduces yet another mathematical use for parentheses. Parentheses are used in some cases as grouping symbols, to represent ordered pairs, and to delineate intervals of real numbers. More often than not, the use of parentheses in expressions like ‘\(f(a)\)’ is confused with multiplication. As always, paying attention to the context is key. If \(f\) is a function and ‘\(a\,\)’ is in the domain of \(f\), then ‘\(f(a)\)’ is the output from \(f\) when you input \(a\). The diagram below provides a nice generic picture to keep in mind when thinking of a function as a mapping process with input ‘\(a\,\)’ and output ‘\(f(a)\)’.

Figure 3: Diagrammatic representation of a function
Show Alt Text Diagram illustrating the concept of a function. An element labeled \(a\) in set \(A\) is mapped by the function \(f\) to the element labeled \(f(a)\) in set \(B\). The element \(a\) is identified as the input, and \(f(a)\) is identified as the output.

In the preceding pet example, the symbol \(f(\text {Bingo})\), read ‘\(f\) of Bingo’, is asking what type of pet Bingo is, so \(f(\text {Bingo}) = \text {lizard}\). The fact that \(f\) is a function means \(f(\text {Bingo})\) is unambiguous because \(f\) matches the name ‘Bingo’ to only one pet type, namely ‘lizard’. In contrast, if we tried to use the notation ‘\(g(\text {cat})\)’ to indicate what pet name \(g\) matched to ‘cat’, we have two possibilities, White Paw and Cooper, with no way to determine which one (or both) is indicated.

Continuing to apply Definition 2 to our pet example, we find that the domain of the function \(f\) is \(N\), the set of pet names. Finding the range takes a little more work, mostly because it’s easy to be caught off guard by the notation used in the definition of ‘range’. The description of the range as ‘\(\{ f(a) \, | \, a \in A \}\)’ is an example of ‘set-builder’ notation. In English, ‘\(\{ f(a) \, | \, a \in A \}\)’ reads as ‘the set of \(f(a)\) such that \(a\) is in \(A\)’. In other words, the range consists of all of the outputs from \(f\) - all of the \(f(a)\) values - as \(a\) varies through each of the elements in the domain \(A\). Note that while every element of the set \(A\) is, by definition, an element of the domain of \(f\), not every element of the set \(B\) is necessarily part of the range of \(f\).

In our pet example, we can obtain the range of \(f\) by looking at the mapping diagram or by constructing the set \(\{ f(\text {White Paw}), f(\text {Cooper}), f(\text {Bingo}), f(\text {Kennie}) \}\) which lists all of the outputs from \(f\) as we run through all of the inputs to \(f\). Keep in mind that we list each element of a set only once so the range of \(f\) is:

\[ \{ f(\text {White Paw}), f(\text {Cooper}), f(\text {Bingo}), f(\text {Kennie}) \} = \{ \text {cat}, \text {lizard}, \text {turtle} \} = T.\]

If we let \(n\) denote a generic element of \(N\) then \(f(n)\) is some element \(t\) in \(T\), so we write \(t = f(n)\). In this equation, \(n\) is called the independent variable and \(t\) is called the dependent variable. Moreover, we say ‘\(t\) is a function of \(n\,\)’, or, more specifically, ‘the type of pet is a function of the pet name’ meaning that every pet name \(n\) corresponds to one, and only one, pet type \(t\). Even though \(f\) and \(t\) are different things, it is very common for the function and its outputs to become more-or-less synonymous, even in what are otherwise precise mathematical definitions. We will endeavor to point out such ambiguities as we move through the text.

While the concept of a function is very general in scope, we will be focusing primarily on functions of real numbers because most disciplines use real numbers to quantify data. Our next example explores a function defined using a table of numerical values.

A few remarks about Example 1 are in order. First, note that \(f(2+4)\), \(f(2)+f(4)\) and \(f(2)+4\) all work out to be numerically different, and more importantly, all represent different things. One of the common mistakes students make is to misinterpret expressions like these, so it’s important to pay close attention to the syntax here.

Next, when solving \(f(t) = 83\), the variable ‘\(t\,\)’ is being used as a convenient ‘dummy’ variable or placeholder in the sense that solving \(f(t) = 83\) produces the same solutions as solving \(f(x) = 83\), \(f(w) = 83\), or even \(f(?) = 83\). All of these equations are asking for the same thing: what inputs to \(f\) produce an output of \(83\). The choice of the letter ‘\(t\,\)’ here makes sense since the inputs are time values. Throughout the text, we will endeavor to use meaningful labels when working in applied situations, but the fact remains that the choice of letters (or symbols) is completely arbitrary.

Finally, given that the range in this example was a finite set of real numbers, we could find the smallest and largest elements of it. Here, they correspond to the coolest and warmest temperatures of the day, respectively, but the meaning would change if the function related different quantities. In many applications involving functions, the end goal is to find the minimum or maximum values of the outputs of those functions (called optimizing the function) so for that reason, we have the following definition.

Definition 3 is an example where the name of the function, \(f\), is being used almost synonymously with its outputs in that when we speak of ‘the minimum and maximum of the function \(f\,\)’ we are really talking about the minimum and maximum values of the outputs \(f(x)\) as \(x\) varies through the domain of \(f\). Thus we say that the maximum of \(f\) is \(83\) and the minimum of \(f\) is \(64\) when referring to the highest and lowest recorded temperatures in the previous example.

2 Algebraic Representations of Functions

By focusing our attention to functions that involve real numbers, we gain access to all of the structures and tools from prior courses in Algebra. In this subsection, we discuss how to represent functions algebraically using formulas and begin with the following example.

A few remarks about Example 2 are in order. First, note that \(h(2x)\) and \(2 h(x)\) are different expressions. In the former, we are multiplying the input by \(2\); in the latter, we are multiplying the output by \(2\). The same goes for \(h(t + 2)\), \(h(t) + 2\) and \(h(t) + h(2)\). The expression \(h(t + 2)\) calls for adding \(2\) to the input \(t\) and then performing the function \(h\). The expression \(h(t) + 2\) has us performing the process \(h\) first, then adding \(2\) to the output \(h(t)\). Finally, \(h(t) + h(2)\) directs us to first find the outputs \(h(t)\) and \(h(2)\) and then add the results. As we saw in Example 1, we see here again the importance paying close attention to syntax.

Let us return for a moment to the function \(f\) in Example 2 which we ultimately represented using the formula \(f(x) = 3x+5\). If we introduce the dependent variable \(y\), we get the equation \(y = f(x) = 3x + 5\), or, more simply \(y = 3x + 5\). To say that the equation \(y = 3x + 5\) describes \(y\) as a function of \(x\) means that for each choice of \(x\), the formula \(3x + 5\) determines only one associated \(y\)-value.

We could turn the tables and ask if the equation \(y=3x+5\) describes \(x\) as a function of \(y\). That is, for each value we pick for \(y\), does the equation \(y = 3x+5\) produce only one associated \(x\) value? One way to proceed is to solve \(y = 3x+5\) for \(x\) and get \(x= \frac {1}{3} (y-5)\). We see that for each choice of \(y\), the expression \(\frac {1}{3} (y-5)\) evaluates to just one number, hence, \(x\) is a function of \(y\). If we give this function a name, say \(g\), we have \(x = g(y) = \frac {1}{3}(y-5)\), where in this equation, \(y\) is the independent variable and \(x\) is the dependent variable. We explore this idea in the next example.

We’ll have more to say about using equations to describe functions in Section ??. For now, we turn our attention to a geometric way to represent functions.

3 Geometric Representations of Functions

In this section, we introduce how to graph functions. As we’ll see in this and later sections, visualizing functions geometrically can assist us in both analyzing them and using them to solve associated application problems. Our playground, if you will, for the Geometry in this course is the Cartesian Coordinate Plane. The reader would do well to review Section ?? as needed.

Our path to the Cartesian Plane requires ordered pairs. In general, we can represent every function as a set of ordered pairs. Indeed, given a function \(f\) with domain \(A\), we can represent \(f = \{ (a, f(a)) \, | \, a \in A\}\). That is, we represent \(f\) as a set of ordered pairs \((a, f(a))\), or, more generally, \((\text {input}, \text {output})\). For example, the function \(f\) which matches Taylor’s pet’s names to their associated pet type can be represented as:

\[ f = \{ (\text {White Paw}, \text {cat}), (\text {Cooper}, \text {cat}), (\text {Bingo}, \text {lizard}), (\text {Kennie}, \text {turtle}) \} \]

Moving on, we next consider the function \(f\) from Example 1 which relates time to temperature. In this case, \(f = \{ (0, 64), (2, 67), (4, 75), (6, 80), (8, 83), (10, 83), (12, 82) \}\). This function has numerical values for both the domain and range so we can identify these ordered pairs with points in the Cartesian Plane. The first coordinates of these points (the abscissae) represent time values so we’ll use \(t\) to label the horizontal axis. Likewise, we’ll use \(T\) to label the vertical axis since the second coordinates of these points (the ordinates) represent temperature values. Note that labeling these axes in this way determines our independent and dependent variable names, \(t\) and \(T\), respectively.

The plot of these points is called ‘the graph of \(f\,\)’. More specifically, we could describe this plot as ‘the graph of \(f(t)\)’, because we have decided to name the independent variable \(t\). Most specifically, we could describe the plot as ‘the graph of \(T = f(t)\)’, given that we have named the independent variable \(t\) and the dependent variable \(T\).

Below we present two plots, both of which are graphs of the function \(f\). In both cases, the vertical axis has been scaled in order to save space. In our first graph, the same increment on the horizontal axis to measure \(1\) unit measures \(10\) units on the vertical axis.

Figure 4: The graph of \(T=f(t)\)
Show Alt Text Scatter plot of temperature \(T\) versus time \(t\). The plotted points are approximately \((0,64)\), \((2,67)\), \((4,75)\), \((6,80)\), \((8,83)\), \((10,83)\), and \((12,82)\). The temperature generally increases over time, reaches a high value near \(83\), and then levels off.

In our second graph, the same increment which measures \(1\) unit on the horizontal axis measures \(2\) on the vertical axis. The ‘\(\asymp \)’ symbol on the vertical axis in the graph below is used to indicate a jump in the vertical labeling.

Figure 5: The graph of \(T=f(t)\)
Show Alt Text Scatter plot of temperature \(T\) versus time \(t\). The plotted points are \((0,64)\), \((2,67)\), \((4,75)\), \((6,80)\), \((8,83)\), \((10,83)\), and \((12,82)\). The temperature increases from \(64\) to a maximum of \(83\), remains near \(83\), and then decreases slightly to \(82\).

Both are perfectly accurate data plots, but they have different visual impacts. Note here that the extrema of \(f\), \(64\) and \(83\), correspond to the lowest and highest points on the graph, respectively: \((0, 64)\), \((8, 83)\) and \((10,83)\). More often than not, we will use the graph of a function to help us optimize that function.

If you found yourself wanting to connect the dots in the graphs above, you’re not alone. As it stands, however, the function \(f\) matches only seven inputs to seven outputs, so those seven points - and just those seven points - comprise the graph of \(f\). That being said, common everyday experience tells us that while the data Skippy collected in his table gives some good information about the relationship between time and temperature on a given day, it is by no means a complete description of the relationship.

For example, Skippy’s data cannot tell us what the temperature was at 7 a.m. or 12:13 p.m, although we are pretty sure there were outdoor temperatures at those times. Also, given that at some point it was \(64^{\circ }\)F and later on it was \(83^{\circ }\)F, it seems reasonable to assume that at some point it was \(70^{\circ }\)F or even \(79.923^{\circ }\)F.

Skippy’s temperature function \(f\) is an example of a discrete function in the sense that each of the data points are ‘isolated’ with measurable gaps in between. The idea of ‘filling in’ those gaps is a quest to find a continuous function to model this same phenomenon. We’ll return to this example in Sections ??, ?? and ?? in an attempt to do just that.

In the meantime, our next example involves a function whose domain is (almost) an interval of real numbers and whose graph consists of a (mostly) connected arc.

It cannot be stressed enough that when given a graphical representation of a function, certain assumptions must be made. In the previous example, for all we know, the minimum of the graph is at \((0.001, -4.0001)\) instead of \((0,-4)\). If we aren’t given an equation or table of data, or if specific points aren’t labeled, we really have no way to tell. We also are assuming that the graph depicted in the example, while ultimately made of infinitely many points, has no gaps or holes other than those noted. This allows us to make such bold claims as the existence of a point on the graph with a \(w\)-coordinate of \(-3\).

Before moving on to our next example, it is worth noting that the geometric argument made in Example 4 to establish that \(w\) is a function of \(v\) can be generalized to any graph. This result is the celebrated Vertical Line Test and it enables us to detect functions geometrically. Note that the statement of the theorem resorts to the ‘default’ \(x\) and \(y\) labels on the horizontal and vertical axes, respectively.

Let’s take a minute to discuss the phrase ‘if and only if’ used in Theorem 1. The statement ‘the graph represents \(y\) as a function of \(x\) if and only if no vertical line intersects the graph more than once’ is actually saying two things. First, it’s saying ‘the graph represents \(y\) as a function of \(x\) if no vertical line intersects the graph more than once’ and, second, ‘the graph represents \(y\) as a function of \(x\) only if no vertical line intersects the graph more than once’.

Logically, these statements are saying two different things. The first says that if no vertical line crosses the graph more than once, then the graph represents \(y\) as a function of \(x\). But the question remains: could a graph represent \(y\) as a function of \(x\) and yet there be a vertical line that intersects the graph more than once? The answer to this is ‘no’ because the second statement says that the only way the graph represents \(y\) as a function of \(x\) is the case when no vertical line intersects the graph more than once.

Applying the Vertical Line Test to the graph given in Example 4, we see below that all of the vertical lines meet the graph at most once (several are shown for illustration) showing \(w\) is a function of \(v\). Notice that some of the lines (\(x = -3\) and \(x = 1\), for example) don’t hit the graph at all. This is fine because the Vertical Line Test is looking for lines that hit the graph more than once. It does not say exactly once so missing the graph altogether is permitted.

Figure 6: Vertical line test
Show Alt Text Graph of the function \(F\). The graph forms a U-shaped curve with \(v\)-intercepts at \((-2,0)\) and \((2,0)\) and a minimum at \((0,-4)\). An open circle at \((1,-3)\) indicates that this point is excluded from the graph. Several vertical lines are drawn across the graph to illustrate the Vertical Line Test. Each vertical line intersects the graph at most once.

There is also a geometric test to determine if the graph above represents \(v\) as a function of \(w\). We introduce this aptly-named Horizontal Line Test in Exercise ?? and revisit it in Sections ?? and ??.

Our next example revisits the function \(h\) from Example 2 from a graphical perspective.

Our last example of the section uses the interplay between algebraic and graphical representations of a function to solve a real-world problem.

Example 6 typifies the interplay between Algebra and Geometry which lies ahead. Both the algebraic description of \(V\): \(V(x) = x^2 (130 - 4x)\) for \(0 < x \leq 26\), and the graph of \(y=V(x)\) were useful in describing aspects of the physical situation at hand. Wherever possible, we’ll use the algebraic representations of functions to analytically produce exact answers to certain problems and use the graphical descriptions to check the reasonableness of our answers.

That being said, we’ll also encounter problems which we simply cannot answer analytically (such as determining the maximum volume in the previous example), so we will be forced to resort to using technology (specifically graphing technology) in order to find approximate solutions. The most important thing to keep in mind is that while technology may suggest a result, it is ultimately Mathematics that proves it.

We close this section with a summary of the different ways to represent functions.

Ways to Represent a Function

Suppose \(f\) is a function with domain \(A\). Then \(f\) can be represented:

  • verbally; that is, by describing how the inputs are matched with their outputs.
  • using a mapping diagram.
  • as a set of ordered pairs of the form \((\text {input}, \text {output})\): \(\{ (a, f(a)) \, | \, a \in A \}\).

If \(f\) is a function whose domain and range are subsets of real numbers, then \(f\) can be represented:

  • algebraically as a formula for \(f(a)\).
  • graphically by plotting the points \(\{ (a, f(a)) \, | \, a \in A \}\) in the plane.

Note: An important consequence of the last bulleted item is that the point \((a, b)\) is on the graph of \(y = f(x)\) if and only if \(f(a) = b.\)