Recursion
In mathematical logic and computer science, a recursive definition, or inductive definition, is used to define an object in terms of itself. A recursive definition of a function defines values of the function for some inputs in terms of the values of the same function for other inputs.
For example, the factorial function
This definition is valid because, for all
For example, we can compute
Putting this all together we get:
Recursive Formulas for Sequences
When discussing arithmetic sequences, you may have noticed that the difference between two consecutive terms in the sequence could be written in a general way:
The above equation is an example of a recursive equation since the
In this equation, one can directly calculate the nth-term of the arithmetic sequence without knowing the previous terms. Depending on how the sequence is being used, either the recursive definition or the non-recursive one might be more useful.
A recursive geometric sequence follows the formula:
An applied example of a geometric sequence involves the spread of the flu virus. Suppose each infected person will infect two more people, such that the terms follow a geometric sequence.
The flu virus is a geometric sequence
Each person infects two more people with the flu virus, making the number of recently-infected people the nth term in a geometric sequence.
Using this equation, the recursive equation for this geometric sequence is:
Recursive equations are extremely powerful. One can work out every term in the series just by knowing previous terms. As can be seen from the examples above, working out and using the previous term