415 lecture note #7
a1= 5, a2= 8, a3= 11, a4= 14, a5= 17, ...
It seems there is a relation between any two adjacent terms an and an+1, namely an+1= an+ 3, for any n (where n >= 1).
There are two ways to express the relation above:
With an initial amount M and r% annual interest, the amount at the end of the nth year, An, is expressed recursively as:
An = (1 + r)*An-1, for all n >= 1
with initial condition
A0 = M
Example 2: Fibonacci numbers
fn = fn-1 + fn-2, for all n >= 3
with initial conditions
f1 = 1 and f2 = 2
Example: Sequence 5, 8, 11, 14, 17, ...
Closed form is an = 3n + 2, for all n >= 1. So,
a1 = 3*1 + 2 = 5
a2 = 3*2 + 2 = 8 etc.
(1) Iteration Method
an = an-1 + 3, for all n >= 2
with initial condition a1 = 5
an = an-1 + 3
[an-1
= an-2 + 3 ... as a side note
= an-2 + 3 +
3 ... substitute an-2
+ 3 for an-1
= an-3 + 3 + 3 + 3 ... substitute
an-3 + 3 for an-2
...
= an-k +
k*3 ... derive
a pattern for an arbitrary kth iteration
...
= a1 +
(n-1)*3 ... k = (n-1) since
n-(n-1) = 1
Then, we can plug in a1 = 5. We get
an = 5 + (n-1)*3 = 3n - 3 + 5 = 3n + 2 ... closed form
Sn = 2*Sn-1, for all n >= 1
with initial condition S0 = 1
Sn = 2*Sn-1
[Sn-1
= 2*Sn-2 ... side note
=
Number of moves required for n disks is
Cn = 2Cn-1+ 1, for all n >= 2
with initial condition C1 = 1.
Cn = 2Cn-1+ 1
[Cn-1
= 2Cn-2 + 1 ... side note
= 2(2Cn-2 + 1) +
1 ... substitute
2Cn-2 + 1 for Cn-1
= 4Cn-2 + 2 + 1
= 4(2Cn-3 + 1) + 2 +
1 ... substitute 2Cn-3 + 1 for Cn-2
= 8Cn-3 + 4 + 2 + 1
....
= 2kCn-k + 2k-1
+ ...+ 21 + 20
... a general pattern!!
....
= 2(n-1)*C1 + 2n-2
+2n-3 + ...+ 21 + 20 ... k =
(n-1) since n-(n-1) = 1
Then we can plug in C1 = 1 in the above, obtaining
Cn = 2n-1 + 2n-2 +2n-3 + ...+
21 + 20
2n -
1
=
-------- ... by geometric summation
formula
2 - 1
= 2n - 1