
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

MAT 300, Spielberg Notes on Recursion Fall, 2006
Consider the sequence 1, 2, 4, 8, 16,.. .. If we let an denote the nth term of this sequence, we have a 1 = 1, a 2 = 2, a 3 = 4, a 4 = 8, and so on. With a bit of guesswork we realize that an can be given by a formula: an = 2n−^1. Sometimes it isn’t so easy to guess a formula for a sequence. What makes it feasible to guess in this instance is the way each term of the sequence is built from the preceding term: a 2 = 2a 1 , a 3 = 2a 2 , a 4 = 2a 3 , etc. In fact, the ellipsis “.. .” is just an abbreviation for “continue in the same way” — it isn’t really useful unless we are able to guess the pattern. A better definition for this sequence would be: let a 1 = 1, and for each n ∈ N let an+1 = 2an. A moment’s thought will convince you that this does define the sequence, and it doesn’t leave us wondering if we are seeing the correct pattern. A definition like this, where the initial term, or terms, of a sequence are specified, and each later term is defined as a function of the preceding terms, is called a recursive definition of the sequence. It is precisely the kind of definition that allows us to prove facts about the sequence using induction. For example, if the above sequence is defined recursively by a 1 = 1, and an+1 = 2an for n ∈ N, we can use induction to prove that for all n ∈ N, an = 2n−^1. Here is the proof. When n = 1 we have a 1 = 1 = 2^0 = 2^1 −^1 , so the formula is valid when n = 1. Let n ∈ N, and suppose that the formula is valid for n: an = 2n−^1. Then
an+1 = 2an, by the recursive definition, = 2(2n−^1 ), by the inductive hypothesis, = 2n = 2(n+1)−^1.
By induction, the formula is true for all n. Another very important example of a sequence defined recursively is the factorial. The usual definition of n-factorial is: n! = 1 · 2 · 3 · · · n. As we saw above, the · · · is hiding a recursive definition. Here it is:
1! = 1, and for n ∈ N, (n + 1)! = (n + 1) · n!.
Here is an example using factorial: prove that for n ≥ 4, n! > 2 n. For the proof, first consider the case n = 4: 4! = 1 · 2 · 3 · 4 = 24 > 16 = 2^4.
Now let n ≥ 4 and suppose that n! > 2 n. We have
(n + 1)! = (n + 1)n!
(n + 1)2n 2 · 2 n, since n + 1 ≥ 4 + 1 = 5 > 2 , = 2n+1.
Many innocent-seeming induction problems have a recursively defined sequence hidden inside. For example, consider the formula
1 + 2 + 3 + 4 + · · · + n =
n(n + 1).
The · · · on the left side is hiding a recursion. Let’s make it explicit. Define a sequence an by a 1 = 1, and for n ∈ N, an+1 = an + n + 1. This captures precisely what the left-hand side is merely suggesting. This problem is really claiming that if an is defined recursively as above, then an = 12 n(n + 1). If you look back at the proof of this formula (the first formula that everyone proves with induction), you will see that the recursive definition of the left-hand side is what is actually used.