Functions are rules that map input values to output values in a well determined way. They come in many guises, depending on what is mapped on what. Generally, a function is specified as
where D is the domain of the function, i.e., the set of possible input values on which the function is defined, and I is the image or range of the function, i.e., the set of values that we obtain by applying the function to each x in the domain D.
In this book, we are essentially interested in numerical functions like
This is an example of a single-variable function mapping real numbers into real numbers; formally, this is denoted by . Sometimes, we have to restrict the domain to integer values. Consider, for instance, a function mapping the number of electric motors we buy to the purchasing cost. Obviously, we can only buy a nonnegative and integer number of motors; hence, we should specify a function where, as we said, and denote the set of nonnegative integer and nonnegative real numbers, respectively.6 If the number of items we buy is large, it may be convenient to express a function , which is a sensible approximation and may be easier to work with from a computational perspective, as we shall see.
In other cases, the domain D is restricted because of conditions that ensure the proper definition of the function.
Example 2.4 Consider the function . The square root function is defined on nonnegative real numbers;7 hence, the domain of f is restricted by the condition:
The domain restriction is reflected by denoting the function as . In the case of g(x) = 1/x, we have , where we use A\B to denote set difference, i.e., the set consisting of elements of A that are not elements of B. In fact, function g is not defined for x = 0, and there is no solution to the equation 1/x = 0, as the function tends to zero for x → ±∞, but it is never exactly zero. Hence, both domain and range of g are the set of real numbers minus the singleton {0}. The domain of g could also be denoted by .
Fig. 2.5 Surface plot for the function of Example 2.5.
We also use functions with multiple input values, such as function f(x, y). Here, the domain is the set of pairs of real numbers, (x, y), denoted as the Cartesian product . We defer a study of multivariable functions. Even the very basic task of plotting a multivariable function has no obvious solution, as shown in the example below.
Example 2.5 (Plotting functions of multiple variables) Drawing the graph of a single-variable function is, at least conceptually, a straightforward task. The case of multiple variables is not that easy and there are different ways of representing them. Since we are just able to draw in three dimensions, we can only draw a surface corresponding to a function of two variables. For instance, the surface plot corresponding to function
is illustrated in Fig. 2.5. The surface plot is obtained by drawing points in three dimensions, where the vertical coordinate z is associated with function values, z = f(x, y). Another useful plotting tool is the contour plot; Fig. 2.6 shows the contour plot for the function above. This is a two-dimensional plot displaying a set of level curves. A level curve consists of points on the plane (x, y), such that the function value is constant on the curve; there is a level curve for each value of the function. More formally, to draw a set of level curves we fix a set of function values z1, z2, z3, …, and plot curves defined by equations
Fig. 2.6 Contour plot for the function of Example 2.5.
Sometimes, level curves may provide us with a clearer view of how a function behaves.
From the example, we can immediately appreciate the limitations in our ability to “see” a function of multiple variables. This is why we need to develop tools that are useful in characterizing functions of many variables, even though we are not able to visualize them. Those tools are also the foundations of numerical methods to solve complicated equations and to find optimal sets of decisions when many of them are involved. Luckily, we may build the intuition and the essential concepts that we need by dealing with the single-variable case. In the remainder of this section we illustrate the most common function classes, limiting our attention to those that are more relevant in a business setting.8
Leave a Reply