In this notebook we will look at how you as the user can create your own recursive functions in Mathematica.
Review: Certain ideas in mathematics are best expressed recursively. One situation that frequently uses the idea of recursion is that of constructing sequences. Obviously not all sequences require recursion in their definition, but some of the more interesting ones do.
One way of looking at the idea of sequences it to consider them to be functions which take the set of natural numbers as their domain. For example, the non-recursive sequence:
1, 4, 9, 16, 25, 36, 49, 64,...
can be thought of as shorthand (or should that be longhand?) for the function:
f(n) = n2, n=1, 2, 3, 4, 5, 6, 7, 8,...
And the famous Fibonacci sequence:
1, 1, 2, 3, 5, 8, 13, 21, 34,...
can be thought of as the recursive function:
fib(n) = fib(n-1) + fib(n-2)
fib(1) = fib(2) = 1
the latter two equations are referred to as the initial values of the sequence or function.
Remember, as we said in the introduction to the first notebook, in order to tell Mathematica that you want it to actually evaluate what you have typed, hit the ENTER key over on the extreme right side of your keyboard on the numeric keypad. Again, don't confuse this with the RETURN key, which merely starts a new line of text.
Welcome back! Hopefully everything went well. You may now go to the Table of Contents for the Mathematica Basics Labs, or simply quit.