new_functions

[picture]

3.1.5

Generating New Functions

Introduction

In the previous articles I have attempted to devise a definition for a function general enough to serve almost any purpose we might need it for. Key to this was the notion of a structure. Structures will become very central to our discussion as we progress into the more advanced material, however structures are not, in and of themselves, enough to propel us forward. So far we have relied on a familiarity of basic arithmetic operators to define our functions. This will not be sufficient to move forward. We need to devise new kinds of operators, beyond the elementary operators. How can this be accomplished? We can achieve this by generating new functions from old ones. In this article we will explore various ways in which new functions can be generated from old. These techniques will prepare us for the notion of recursion, to be introduced in the next article.

The Sum and Difference of functions

Recall that functions and operations are synonymous. We can think of all of the conventional operations as functions:

x+y

x-y

x*y

x/y

x^y

logy(x)

rty(x)

Conversely, we can think of any function we could define as an operation, that takes input, x, and produces an output, y:

f(x) = y

Note that we can mix operations to create formulas:

2+3*5 = 2+15 = 17

If functions are themselves just operations, why couldn't we include them with the standard operations to create new kinds of formulas:

ex.

f(5) + 1

f(2) + f(3) - 7

4 + f(6)

etc.

These new formulas can then be used to define new kinds of functions. This can be reiterated, to create a vicious cycle of more and more powerful functions.

We can actually take a set of functions, and combine them to create a new function. The simplest way we could do this is to define the Sum and Difference of functions.

For example, let's say we have the functions, f(x) and g(x). We can define a new function h(x) as the sum of f and g:

h(x) = f(x) + g(x)

I should note that, this statement should be understood to define h(x) only in terms of f and g. However in a more general sense, if any two of the functions are defined in the formula, the third will be dependent upon the other two. For this reason I will use the " := ", defined as, symbol to indicate the direction of the equality. So we can say:

h(x) := f(x) + g(x)

This sum is well defined assuming that f(x) and g(x) are well defined functions whose output is a complex number. We can say this equation actually defines the sum of any two functions. If we want a concrete example we can simply define and f and g, and h will automatically be defined as a consequence. For example:

f(x) = x^2+1

g(x) = 3x+5

We can now compute h(4) as follows:

since

h(x) := f(x) + g(x)

by definition

h(4) = f(4) + g(4) = (4^2+1) + (3*4+5) = 17 + 17 = 34

For any real number we chose, x, we can compute h(x) by this method. We could just as easily define the difference of functions:

h(x) := f(x) - g(x)

Using the same example functions:

since

h(x) := f(x) - g(x)

h(4) = f(4) - g(4) = 17 - 17 = 0

We now have a method for generating new functions from old. We can take the sum and difference of several already generated functions, along with constants, to generate even newer functions.

We might begin with our elementary functions, f(x)=x^2+1 and g(x)=3x+5, and define these functions:

h(x) := f(x) + g(x) + 9

i(x) := f(x) + 25

With these we define further functions:

j(x) := f(x) + g(x) + h(x) + i(x)

k(x) := f(x) + g(x) + h(x) + i(x) + j(x)

Does this help us to produce larger numbers? Let's see. Let's try to compute k(4):

k(4)

=

f(4) + g(4) + h(4) + i(4) + j(4)

=

17 + 17 + f(4) + g(4) + 9 + f(4) + 25 + f(4) + g(4) + h(4) + i(4)

=

34 + 17 + 17 + 9 + 17 + 25 + 17 + 17 + f(4) + g(4) + 9 + f(4) + 25

=

34 + 34 + 26 + 25 + 34 + 17 + 17 + 9 + 17 + 25

=

68 + 51 + 34 + 34 + 9 + 42

=

119 + 68 + 51

=

187 + 51

=

238

As you can see, even k(x) is not a very fast growing function. It's growth can not be much greater than that of f(x). Since our initial functions, f and g, are elementary, the sum and difference of any functions generated from them are also elementary. We can actually derive an elementary formula for k(x), even though it was defined in terms of others functions, because ultimately all the functions were defined from the elementary functions f and g. To do this we simply unpack and simplify:

k(x) = f(x) + g(x) + h(x) + i(x) + j(x)

=

x^2+1 + 3x+5 + f(x) + g(x) + 9 + f(x) + 25 + f(x) + g(x) + h(x) + i(x)

=

x^2 + 3x + 40 + x^2+1 + 3x+5 + x^2+1 + x^2+1 + 3x+5 + f(x) + g(x) + 9 + f(x) + 25

=

4x2 + 9x + 87 + f(x) + f(x) + g(x)

=

4x2 + 9x + 87 + x2 + 1 + x2 + 1 + 3x + 5

=

6x2 + 12x + 94

This elementary formula can then be used to more efficiently compute values of k(x). For example:

k(4) = 6*42 + 12*4 + 54 = 6*16 + 48 + 94 = 96 + 48 + 94 = 238

We can now easily compute larger values for k:

k(5) = 304

k(6) = 382

k(7) = 472

k(8) = 574

...

k(100) = 61,294

The growth rate of k is still that of any elementary equation. We will not be able to produce radical new kinds of numbers by simply taking the sum and difference of functions. Why not instead try to use higher operations on functions:

The Product and Quotient of Functions

Just as we defined the sum and difference of functions, we can also define the product and quotient of functions. For example, let f and g be elementary functions. We can define:

h(x) := f(x) * g(x)

i(x) := f(x) / g(x)

We will use f(x) = x^2+1 and g(x) = 3x+5 as in our previous examples. To compute h(4):

h(4) = f(4) * g(4) = (4^2+1)*(3*4+5) = 17*17 = 289

To compute i(4):

i(4) = f(4)/g(4) = 17/17 = 1

Since our goal is to generate large numbers, we will never really have much use for quotients of functions. If the function in the denominator is a fast growing function it will only slow down the quotient function as a result. The product of f and g however is a slightly faster function than either f or g. If we work out an elementary formula for h we will see why:

h(x) = f(x)*g(x) = (x^2+1)(3x+5) = 3x3 +5x2 + 3x + 5

While g is a linear equation, and f is a quadratic equation, h is a cubic equation. Compare the values of h(x) to those of k from the previous heading:

h(5) = 520

h(6) = 851

h(7) = 1300

h(8) = 1885

...

h(100) = 3,050,305

Although this is an improvement, h is still just an elementary function. It can be defined explicitly with just elementary operations. What if we allow exponentiation of functions?

The Exponentiation of functions

We can again use f and g as previously and define a new function h as:

h(x) := f(x)^g(x)

Let's compute h(4):

h(4) = f(4)^g(4) = (4^2+1)^(3*4+5) = 17^17 =

827,240,261,886,336,764,177

That's quite a leap from our previous functions! It should be noted that the function h grows a little faster than the exponential functions, since it's exponent is itself a function ( we will develop a more rigorous definition of "grows faster" later in Section III). Let's see what kinds of values we get:

h(5) = 26^20 = 19,928,148,895,209,409,152,340,197,376

h(6) = 37^23 ~ 1.17122316517E36

h(7) = 50^26 ~ 1.49011611938E44

h(8) = 65^29 ~ 3.7539E52

...

h(100) = (100^2+1)^(3*100+5) = 10,001^305 ~ 1.0309E1220

We are now back in familiar territory. We can make an even faster function by reversing the order of f and g:

i(x) := g(x)^f(x)

i(4) = 17^17 = 827,240,261,886,336,764,177

i(5) = 20^26 ~ 6.7108E33

i(6) = 23^37 ~ 2.42E50

i(7) = 26^50 ~ 5.606E70

i(8) = 29^65 ~ 1.1372E95

...

i(100) = 305^10,001 ~ 3.0387E24,845

We can go further with stacked exponents, exponents within exponents, and so on, but the resulting functions are still just elementary functions. So how else can we combine functions to create new ones ...

Composite Functions

This last section is crucial as the method shown here will eventually lead to recursion. We have tried adding, subtracting, multiplying, dividing, and exponentiating functions yet we have not created any numbers substantially larger than those generated without functions. The key however is to recognize that in each of these cases we have really just placed functions as arguments for other functions. For example when we say:

h(x) := f(x) + g(x)

We are really just saying that the binary operation of addition is taking the outputs of f and g as arguments. If we use the notation:

+(x,y) = x + y

Then we can say:

h(x) := +(f(x),g(x))

This is known as the Composite of functions. So really all of our various methods, were really all part of a single method for generating functions: that of placing some functions inside others as arguments. With this idea now recognized we can actually do something new we haven't done before. We can place g inside f:

h(x) := f(g(x))

If f(x) = x^2+1 and g(x) = 3x+5 Then we can say that:

h(x) = f(g(x)) = f(3x+5) = (3x+5)^2+1 = 9x^2 + 30x + 26

Even the composite of elementary functions however will be an elementary function. How do we get something radically new then from elementary functions?! It might seem at this point that the concept of a function has added nothing to our ability to define large numbers, that we couldn't have done using exponents. However in the next article I will introduce the concept of recursion. This will quickly repay our efforts in carefully developing the concept of a function and we will finally get a glimpse of what lies beyond.