4.3: Induction and Recursion
- Last updated
- Sep 29, 2021
- Save as PDF
- Page ID
- 86119
( \newcommand{\kernel}{\mathrm{null}\,}\)
Preview Activity 4.3.1: Recursively Defined Sequences
In a proof by mathematical induction, we “start with a first step” and then prove that we can always go from one step to the next step. We can use this same idea to define a sequence as well. We can think of a sequence as an infinite list of numbers that are indexed by the natural numbers (or some infinite subset of N∪{0}). We often write a sequence in the following form:
a1,a2,...,an,...
The number an is called the nth term of the sequence. One way to define a sequence is to give a specific formula for the nth term of the sequence such as an=1n.
Another way to define a sequence is to give a specific definition of the first term (or the first few terms) and then state, in general terms, how to determine an+1 in terms of n and the first n terms a1,a2,...,an. This process is known as definition by recursion and is also called a recursive definition. The specific definition of the first term is called the initial condition, and the general definition of an+1 in terms of n and the first n terms a1,a2,...,an is called the recurrence relation. (When more than one term is defined explicitly, we say that these are the initial conditions.) For example, we can define a sequence recursively as follows:
b1=16, and for each n∈N, bn+1=12bn.
Using n=1 and then n=2, we then see that
b2=12b1 b3=12b2=12⋅16=12⋅8=8=4
- Calculate b4 through b10. What seems to be happening to the values of bn as n gets larger?
- Define a sequence recursively as follows:
T1=16, and for each n∈N, Tn+1=16+12Tn.
Then T2=16+12T1=16+8=24. Caluculate T3 through T10. What seems to be happening to the values of Tn as n gets larger?
The sequences in Parts (1) and (2) can be generalized as follows: Let a and r be real numbers. Define two sequences recursively as follows:
a1=a, and for each n∈N, an+1=r⋅an.
S1=a, and for each n∈N, Sn+1=a+r⋅Sn.
- Determine formulas (in terms of a and r) for a2 through a6. What do you think an is equal to (in terms of a, r, and n)?
- Determine formulas (in terms of a and r) for S2 through S6. What do you think an is equal to (in terms of a, r, and n)?
In Preview Activity 4.3.1 in Section 4.2, for each natural number n, we defined n!, read n factorial, as the product of the first n natural numbers. We also defined 0! to be equal to 1. Now recursively define a sequence of numbers a0, a1, a2, ... as follows:
a0=1, and
for each nonnegative integer n, an+1=(n+1)⋅an.
Using n=0, we see that this implies that a1=1⋅a0=1⋅1=1, Then using n=1, we see that
a2=2a1=2⋅1=2. - Calculate a3, a4, a5 and a6.
- Do you think that it is possible to calculate a20 and a100? Explain.
- Do you think it is possible to calculate an for any natural number n? Explain.
- Compare the values of a0, a1, a2, a3, a4, a5, and a6 with those of 0!, 1!, 2!, 3!, 4!, 5!, and 6!. What do you observe? We will use mathematical induction to prove a result about this sequence in Exercise (1).
Preview Activity 4.3.1: The Fibonacci Numbers
The Fibonacci numbers are a sequence of natural numbers f1, f2, f3, ..., fn, ... defined recursively as follows:
- f1=1 and f2=1, and
- For each natural number n, fn+2=fn+1+fn.
In words, the recursion formula states that for any natural number n with n≥3, the nth Fibonacci number is the sum of the two previous Fibonacci numbers. So we see that
f3=f2+f1=1+1=2,f4=f3+f2=2+1=3, andf5=f4+f3=3+2=5,
- Calculate f6 through f20.
- Which of the Fibonacci numbers f1 through f20 are even? Which are multiples of 3?
- For n=2, n=3, n=4, and n=5, how is the sum of the first (n−1) Fibonacci numbers related to the (n+1)st Fibonacci number?
- Record any other observations about the values of the Fibonacci numbers or any patterns that you observe in the sequence of Fibonacci numbers. If necessary, compute more Fibonacci numbers.
The Fibonacci Numbers
The Fibonacci numbers form a famous sequence in mathematics that was investigated by Leonardo of Pisa (1170 – 1250), who is better known as Fibonacci. Fibonacci introduced this sequence to the Western world as a solution of the following problem:
Suppose that a pair of adult rabbits (one male, one female) produces a pair of rabbits (one male, one female) each month. Also, suppose that newborn rabbits become adults in two months and produce another pair of rabbits. Starting with one adult pair of rabbits, how many pairs of rabbits will be produced each month for one year?
Since we start with one adult pair, there will be one pair produced the first month, and since there is still only one adult pair, one pair will also be produced in the second month (since the new pair produced in the first month is not yet mature). In the third month, two pairs will be produced, one by the original pair and one by the pair which was produced in the first month. In the fourth month, three pairs will be produced, and in the fifth month, five pairs will be produced.
The basic rule is that in a given month after the first two months, the number of adult pairs is the number of adult pairs one month ago plus the number of pairs born two months ago. This is summarized in Table 4.1, where the number of pairs produced is equal to the number of adult pairs, and the number of adult pairs follows the Fibonacci sequence of numbers that we developed in Preview Activity 4.3.2.
Months | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
Adult Pairs | 1 | 1 | 2 | 3 | 5 | 8 | 13 | 21 | 34 | 55 |
Newborn Pairs | 1 | 1 | 2 | 3 | 5 | 8 | 13 | 21 | 34 | 55 |
Month-Old Pairs | 0 | 1 | 1 | 2 | 3 | 5 | 8 | 13 | 21 | 34 |
Historically, it is interesting to note that Indian mathematicians were studying these types of numerical sequences well before Fibonacci. In particular, about fifty years before Fibonacci introduced his sequence, Acharya Hemachandra (1089 – 1173) considered the following problem, which is from the biography of Hemachandra in the MacTutor History of Mathematics Archive:
Suppose we assume that lines are composed of syllables which are either short or long. Suppose also that each long syllable takes twice as long to articulate as a short syllable. A line of length n contains n units where each short syllable is one unit and each long syllable is two units. Clearly a line of length n units takes the same time to articulate regardless of how it is composed. Hemchandra asks: How many different combinations of short and long syllables are possible in a line of length n?
This is an important problem in the Sanskrit language since Sanskrit meters are based on duration rather than on accent as in the English Language. The answer to this question generates a sequence similar to the Fibonacci sequence. Suppose that hn is the number of patterns of syllables of length n. We then see that h1=1 and h2=2. Now let n be a natural number and consider pattern of length n+2. This pattern either ends in a short syllable or a long syllable. If it ends in a short syllable and this syllable is removed, then there is a pattern of length n+1, and there are hn+1 such patterns. Similarly, if it ends in a long syllable and this syllable is removed, then there is a pattern of length n, and there are hn such patterns. From this, we conclude that
hn+2=hn+1+hn.
This actually generates the sequence 1, 2, 3, 5, 8, 13, 21, .... For more information about Hemachandra, see the article Math for Poets and Drummers by Rachel Wells Hall in the February 2008 issue of Math Horizons.
We will continue to use the Fibonacci sequence in this book. This sequence may not seem all that important or interesting. However, it turns out that this sequence occurs in nature frequently and has applications in computer science. There is even a scholarly journal, The Fibonacci Quarterly, devoted to the Fibonacci numbers.
The sequence of Fibonacci numbers is one of the most studied sequences in mathematics, due mainly to the many beautiful patterns it contains. Perhaps one observation you made in Preview Activity 4.3.2 is that every third Fibonacci number is even. This can be written as a proposition as follows:
For each natural number n, f3n is an even natural number.
As with many propositions associated with definitions by recursion, we can prove this using mathematical induction. The first step is to define the appropriate open sentence. For this, we can let P(n) be, “f3n is an even natural number.”
Notice that P(1) is true since f3n=2. We now need to prove the inductive step. To do this, we need to prove that for each k∈N,
if P(k) is true, then P(k+1) is true.
That is, we need to prove that for each k∈N, if f3k is even, then f3(k+1) is even.
So let’s analyze this conditional statement using a know-show table.
Step | Know | Reason |
P | f3k is even | Inductive hypothesis |
P1 | (∃m∈N)(f3k=2m) | Definition of "even integer" |
... | ... | ... |
Q1 | (∃q∈N)(f3(k+1)=2q) | |
Q | f3(k+1) is even. | Definition of "even integer" |
Step | Show | Reason |
The key question now is, “Is there any relation between f3(k+1) and fk?” We can use the recursion formula that defines the Fibonacci sequence to find such a relation.
The recurrence relation for the Fibonacci sequence states that a Fibonacci number (except for the first two) is equal to the sum of the two previous Fibonacci numbers. If we write 3(k+1)=3k+3, then we get f3(k+1)=f3k+3. For f3k+3, the two previous Fibonacci numbers are f3k+2 and f3k+1. This means that
f3k+3=f3k+2+f3k+1.
Using this and continuing to use the Fibonacci relation, we obtain the following:
f3(k+1)=f3k+3=f3k+2+f3k+1=(f3k+1+f3k)+f3k+1.
The preceding equation states that f3(k+1)=2f3k+1+f3k. This equation can be used to complete the proof of the induction step.
Progress Check 4.12 (Every Third Fibonacci Number Is Even)
Complete the proof of Proposition 4.13.
Proposition 4.13.
For each natural number n, the Fibonacci number f3n is an even natural number.
Hint: We have already defined the predicate P(n) to be used in an induction proof and have proved the basis step. Use the information in and after the preceding know-show table to help prove that if f3k is even, then f3(k+1) is even.
- Answer
-
Add texts here. Do not delete this text first.
Geometric Sequences and Geometric Series
Let a, r∈R. The following sequence was introduced in Preview Activity 4.3.1.
Initial condition:a1=a.Recurrence relation:For each n∈N,an+1=r⋅an.
This is a recursive definition for a geometric sequence with initial term a and (common) ratio r. The basic idea is that the next term in the sequence is obtained by multiplying the previous term by the ratio r. The work in Preview Activity 4.3.1 suggests that the following proposition is true.
Theorem 4.14
Let a, r∈R, If a geometric sequence is defined by a1=a and for each n∈N, an+1=r⋅an, then for each n∈N, an=a⋅rn−1.
- Proof
-
The proof of this proposition is Exercise (6).
Another sequence that was introduced in Preview Activity 4.3.1 is related to geometric series and is defined as follows:
Initial condition:S1=a.Recurrence relation:For each n∈N,Sn+1=r⋅Sn.
For each n∈N, the term Sn is a (finite) geometric series with initial term a and (common) ratio r. The work in Preview Activity 4.3.1 suggests that the following proposition is true.
Theorem 4.15
Let a, r∈R. If the sequence S1,S2,...,Sn,... is defined by S1=a and for each n∈N, Sn+1=a+r⋅Sn, then for each n∈N, Sn=a+a⋅r+a⋅r2+⋅⋅⋅+a⋅rn−1. That is, the geometric series Sn is the sum of the first n terms of the corresponding geometric sequence.
- Proof
-
Add proof here and it will automatically be hidden if you have a "AutoNum" template active on the page.
The proof of Proposition 4.15 is Exercise (7). The recursive definition of a geometric series and Proposition 4.15 give two different ways to look at geometric series. Proposition 4.15 represents a geometric series as the sum of the first nterms of the corresponding geometric sequence. Another way to determine this sum a geometric series is given in Theorem 4.16, which gives a formula for the sum of a geometric series that does not use a summation.
Theorem 4.16
Let a, r∈R and r≠1. If the sequence S1,S2,...,Sn,... is defined by S1=a and for each n∈N, Sn+1=a+r⋅Sn, then for each n∈N, Sn=a(1−rn1−r).
- Proof
-
The proof of Proposition 4.16 is Exercise (8).
Exercises for Section 4.3
- For the sequence a0,a1,a2,...,an,..., assume that a0=1 and that for each n∈N∪{0}, an+1=(n+1)an. Use mathematical induction to prove that for each n∈N∪{0}, an=n!.
- Assume that f1,f2,...,fn,... are the Fibonacci numbers. Prove each of the following:
(a) For each n∈N, f4n is a multiple of 3.
(b) For each n∈N, f5n is a multiple of 5.
(c) For each n∈N, with n≥2, f1+f2+⋅⋅⋅+fn−1=fn+1−1.
(d) For each n∈N, f1+f3+⋅⋅⋅+f2n−1=f2n.
(e) For each n∈N, f2+f4+⋅⋅⋅+f2n=f2n+1−1.
(f) For each n∈N, f21+f22+⋅⋅⋅+f2n=fnfn+1.
(g) For each n∈N such that n≢0 (mod 3), fn is an odd integer. - Use the result in Part (f) of Exercise (2) to prove that
f21+f22+⋅⋅⋅+f2n+f2n+1f21+f22+⋅⋅⋅+f2n=1+fn+1fn - The quadratic formula can be used to show that α=1+√52 and β=1−√52 are the two real number solutions of the quadratic equation x2−x−1=0. Notice that this implies that
α2=α+1, andβ2=β+1.
It may be surprising to find out that these two irrational numbers are closely related to the Fibonacci numbers.
(a) Verify that f1=α1−β1α−β and that f2=α2−β2α−β
(b) (This part is optional, but it may help with the induction proof in part (c).) Work with the relation f3=f2+f1 and substitute the expressions for f1 and f2 from part (a). Rewrite the expression as a single fraction and then in the numerator use α2+α=α(α+1) and a similar equation involving β. Now prove that f3=α3−β3α−β.
(c) Use induction to prove that for each natural number n, if α=1+√52 and β=1−√52, then fn=αn−βnα−β. Note: This formula for the nth Fibonacci number is known as Binet's formula, named after the French mathematician Jacques Binet (1786 - 1856). - Is the following conjecture true or false? Justify your conclusion.
Conjecture. Let f1,f2,...,fm,... be the sequence of the Fibonacci numbers. For each natural number n, the numbers fnfn+3, 2fn+1fn+2, and (f2n+1+f2n+2) form a Pythagorean triple. - Prove Proposition 4.14. Let a, r∈R, If a geometric sequence is defined by a1=a and for each n∈N, an+1=r⋅an, then for each n∈N, an=a⋅rn−1.
- Prove Proposition 4.15. Let a, r∈R. If the sequence S1,S2,...,Sn,... is defined by S1=a and for each n∈N, Sn+1=a+r⋅Sn, then for each n∈N, Sn=a+a⋅r+a⋅r2+⋅⋅⋅+a⋅rn−1. That is, the geometric series Sn is the sum of the first n terms of the corresponding geometric sequence.
- Prove Proposition 4.16. Let a, r∈R and r≠1. If the sequence S1,S2,...,Sn,... is defined by S1=a and for each n∈N, Sn+1=a+r⋅Sn, then for each n∈N, Sn=a(1−rn1−r).
- For the sequence a1,a2,...,an,..., assume that a1=2 and that for each n∈N, an+1=an+5.
(a) Calculate a2 through a6.
(b) Make a conjecture for a formula for an for each n for each n∈N.
(c) Prove that your conjecture in Exercise (9b) is correct. - The sequence in Exercise (9) is an example of an arithmetic sequence. An arithmetic sequence is defined recursively as follows:
Let c and d be real numbers. Define the sequence a1,a2,...,an,... by a1=c and for each n∈N, an+1=an+d.
(a) Determine formulas for a3 through a8.
(b) Make a conjecture for a formula for an for each n for each n∈N.
(c) Prove that your conjecture in Exercise (10b) is correct. - For the sequence a1,a2,...,an,..., assume that a1=1, a2=5, and that for each n∈N, an+1=an+2an−1. Prove that for each natural number n, an=2n+(−1)n.
- For the sequence a1,a2,...,an,..., assume that a1=1 and that for each n∈N, an+1=√5+an.
(a) Calculate, or approximate, a2 through a6.
(b) Prove that for each n∈N, an<3. - For the sequence a1,a2,...,an,..., assume that a1=1, a2=3, and that for each n∈N, an+2=3an+1−2an.
(a) Calculate a3 through a6.
(b) Make a conjecture for a formula for an for each n for each n∈N.
(c) Prove that your conjecture in Exercise (13b) is correct. - For the sequence a1,a2,...,an,..., assume that a1=1, a2=1, and that for each n∈N, an+2=12(an+1+2an).
(a) Calculate a3 through a6.
(b) Prove that for each n∈N, 1≤an≤2. - For the sequence a1,a2,...,an,..., assume that a1=1, a2=1, a3=1, and for that each natural number n,
an+3=an+2+an+1+an.
(a) Compute a4, a5, a6, and a7.
(b) Prove that for each natural number n with n>1, an≤2n−2. - For the sequence a1,a2,...,an,..., assume that a1=1, and for each natural number n,
an+1=an+n⋅n!.
(a) Compute n! for the first 10 natural numbers.
(b) Compute an for the first 10 natural numbers.
(c) Make a conjecture about a formula for an in terms of n that does not involve a summation or a recursion.
(d) Prove your conjecture in Part (c). - For the sequence a1,a2,...,an,..., assume that a1=1, a2=1, and for each n∈N, an+2=an+1+3an. Determine which terms in this sequence are divisible by 4 and prove that your answer is correct.
- The Lucas numbers are a sequence of natural numbers L1,L2,L3,...,Ln,..., which are defined recursively as follows:
bullet L1=1 and L2=3, and
bullet For each natural number n, Ln+2=Ln+1+Ln.
List the first 10 Lucas numbers and the first ten Fibonacci numbers and then prove each of the following propositions. The Second Principle of Mathematical Induction may be needed to prove some of these propositions.
(a) For each natural number n, Ln=2fn+1−fn.
(b) For each n∈N with n≥2, 5fn=Ln−1+Ln+1.
(c) For each n∈N with n≥3, Ln=fn+1−fn−2. - There is a formula for the Lucas number similar to the formula for the Fibonacci numbers in Exercise (4). Let α=1+√52 and β=1−√52. Prove that for each n∈N, Ln=αn+βn.
- Use the result in Exercise (19), previously proven results from Exercise (18), or mathematical induction to prove each of the following results about Lucas numbers and Fibonacci numbers.
(a) For each n∈N, Ln=f2nfn
(b) For each n∈N, fn+1=fn+Ln2.
(c) For each n∈N, Ln+1=Ln+5fn2.
(d) For each n∈N with n≥2, Ln=fn+1+fn−1. - Evaluation of proofs
See the instructions for Exercise (19) on page 100 from Section 3.1.Explorations and Activities(a)
Let fn be the nth Fibonacci number, and let α be the positive solution of the equation x2=x+1. So α=1+√52. For each natural number n, fn≤αn−1.
- Proof
-
We will use a proof by mathematical induction. For each natural number n, we let P(n) be, “fn≤αn−1.”
We first note that P(1) is true since f1=1 andα0=1. We also notice that P(2) is true since f2=1 and, hence, f2≤α1.
We now let k be a natural number with k≥2 and assume that P(1), P(2), ..., P(k) are all true. We now need to prove that P(k+1) is true or that fk+1≤αk.
Since P(k−1) and P(k) are true, we know that fk−1≤αk−2 and fk≤αk−1. Therefore,
\[\begin{array} {rcl} {f_{k + 1}} &= & {f_k + f_{k - 1}} \\ {f_{k + 1}} &\le & {\alpha ^{k - 1} + {\alpha ^{k - 2}} \\ {f_{k + 1}} &\le & {\alpha ^{k - 2} (\alpha + 1).} \end{array}\]
We now use the fact that α+1=α2 and the preceding inequality to obtain
fk+1≤αk−2α2fk+1≤αk.
This proves that if P(1), P(2), ..., P(k) are true, then P(k+1) is true. Hence, by the Second Principle of Mathematical Induction, we conclude that or each natural number n, fn≤αn−1.
- Compound Interest. Assume that R dollars is deposited in an account that has an interest rate of i for each compounding period. A compounding period is some specified time period such as a month or a year.
For each integer n with n≤0, let Vn be the amount of money in an account at the end of the nth compounding period. Then
V1=R+i⋅R V2=V1+i⋅V1=R(1+i)=(1+i)V1=(1+i)2R.
(a) Explain why V3=V2+i⋅V2. Then use the formula for V2 to determine a formula for V3 in terms of i and R.
(b) Determine a recurrence relation for Vn+1 in terms of i and Vn.
(c) Write the recurrence relation in Part (22b) so that it is in the form of a recurrence relation for a geometric sequence. What is the initial term of the geometric sequence and what is the common ratio?
(d) Use Proposition 4.14 to determine a formula for Vn in terms of I, R, and n. - The Future Value of an Ordinary Annuity. For an ordinary annuity, R dollars is deposited in an account at the end of each compounding period. It is assumed that the interest rate, i, per compounding period for the account remains constant.
Let St represent the amount in the account at the end of the tth compounding period. S_t is frequently called the future value of the ordinary annuity.
So S_1 = R. To determine the amount after two months, we first note that the amount after one month will gain interest and grow to (1 + i)S_1. In addition, a new deposit of R dollars will be made at the end of the second month. So
S_2 = R + (1 + i)S_1
(a) For each n \in \mathbb{N}, use a similar argument to determine a recurrence relation for S_{n + 1} in terms of R, i, and S_n.
(b) By recognizing this as a recursion formula for a geometric series, use Proposition 4.16 to determine a formula for S_n in terms of R, i, and n that does not use a summation. Then show that this formula can be written as
S_n = R(\dfrac{(1 + i)^n - 1}{i}).
(c) What is the future value of an ordinary annuity in 20 years if $200 dollars is deposited in an account at the end of each month where the interest rate for the account is 6% per year compounded monthly? What is the amount of interest that has accumulated in this account during the 20 years?
- Answer
-
Add texts here. Do not delete this text first.