Activity 5 - InterMath

advertisement
Math 7030
Activity 5 - Recursion
A very important way of generating sequences of numbers xn is by recursion. Basically
recursion is a well-defined procedure or formula of going from a given number in the
sequence to the next number. One usually needs an initial set of numbers to get things
moving. In view of modern computing capabilities, recursion is a very powerful tool.
As an example suppose we start with the number x1 = 1 and the recursion formula
xn  3xn1  1
for values of n starting with n = 2. This generates the sequence of numbers
x1  1
x2  4
x3  13
x4  40
x5  121
and so on. These numbers can be generated very easily on the TI calculator with the aid
of the STO key.
1. Start with the initial value 2 and the recursion formula
x
x  n1
1  xn1
Use the STO key on the graphing calculator to generate the first 10 numbers in this
sequence.
Another example of recursion is the Fibonacci sequence. Here we start with two initial
values x1 = 1 and x2 = 1 and the recursion formula
xn  xn 1  xn 2
This formula generates the sequence 1,1,2,3,5,8,13,21,34,… In order to achieve this
sequence with the graphing calculator we must write a simple program.
Remark: The Fibonacci sequence can also be described as the sequence of numbers of the
form

  
 
n
n


1

5
/
2

1

5
/
2

 / 5
where n = 1, 2, 3, …. Use your calculator to verify this formula for some values of n. The
above formula shows that there is a connection between the Fibonacci sequence and the
Golden Ratio.
2. Generate a Fibonacci-like sequence by using the same recursion formula but with
initial values 1 and 3. Do the same thing with initial values 1 and 5 .
Sometimes a recursion formula may also involve the counting variable n in a more direct
way. For example suppose we start with initial value x1=1 and the recursion formula
xn  xn1  2n  1
for n greater than or equal to 2. This generates the sequence 1,4,9,16,25,… This sequence
can be generated easily with a program on the TI calculator. This is very similar to
writing a "do-loop". The main idea is that one must remember to initialize the variable n
and increment it at the end of the calculation.
3. Write a program on the TI calculator that generates the sequence having initial value x1
= 1 and recursion formula
1
xn  xn 1  n 1
2
Generate the first 15 or 20 numbers in this sequence. Do they seem to be getting closer
and closer to any fixed number? If so what number? The numbers in this sequence are
sums of a geometric progression. A geometric progression is a sequence of numbers of
the form 1, r, r2, r3,… , where r is some fixed number. There is a formula for the sum of
the first n terms of a geometric progression
1  r n 1
1  r  r2  r3   r n 
1 r
When r is a number with absolute value less than 1 we obtain the formula for the infinite
sum of a geometric progression
1
1  r  r2  r3  r4  
1 r
Explain how this formula explains the behavior of the numbers in your sequence.
4. Recursion occurs in models of compound interest. For example suppose you make an
initial deposit of $1000 in an account that pays 6% interest compounded monthly. This is
equivalent to earning interest of 0.5% per month. If xn denotes the value of your account
at the end of n months, we have the recursion formula
xn  0.005 xn1
with initial value x0 = 1000. Use the calculator to determine the value of your account
after 2 years and six months.
5. Suppose we have the same situation as in the previous question except that at the end
of each month we make a deposit of $50. What is the new recursion formula? What is the
value of the account after two years and six months? How long will it take for the
account to reach $4500?
All of these calculations can also be easily implemented on a spreadsheet.
Download