Dmchap 10
Dmchap 10
geometric progression
If a 0 , a1 , a 2 , is a geometric progression, then
a1 a 2 a 3 a n1
r , the common ratio.
a 0 a1 a 2 an
For example, a n+1 3a n , n 0. (or a n+1 3a n 0)
+ a2- a1= 1
an =1+2+3+...+(n-1)=(n2-n)/2
10.1 The First-Order Linear Recurrence Relation
+ an- an-1=2n
an=n2+n
10.2 The Second-Order Linear Homogeneous Recurrence Relation
with Constant Coefficients
The equation: Cn a n C n1a n1 C n 2 a n 2 0, n 2,
substituting a n cr n , where c 0 and r 0, into the recurrence
relation, we obtain Cn cr n C n1cr n1 C n 2 cr n 2 0. With
c, r 0, this becomes C n r 2 Cn1r Cn 2 0, which is called
the characteristic equation of the recurrence relation.
a1=1,a2=1,a3=2,a4=3,a5=5,a6=8,... Is an=Fn? NO
10.2 The Second-Order Linear Homogeneous Recurrence Relation
with Constant Coefficients
DeMoivre's Theorem
If z = x + iy C, z 0, then
x y
2 2 r (cos i sin )
z= x y i
2
x y2 x2 y2
z n r n (cos n i sin n ) x2 y2
y
x
Case (b) Complex Roots
Ex. 10.17 a n 2(a n1 a n 2 ), n 2, a 0 1, a1 2.
The C. E. is r 2 2r 2 0 with roots 1 i.
n
a n c1 (1 i ) n c2 (1 i ) n c1 2 cos i sin
4 4
n
n n n
c2 2 cos i sin c1 2 cos i sin
4 4 4 4
n n n
c2 2 cos i sin
4 4
n n n
2 (c1 c2 ) cos 4 i (c1 c2 ) sin 4 . With a 0 1, a1 2,
we have c1 c2 1 and c1 c2 i . Therefore,
n n n
a n 2 cos sin .
4 4
Case (b) Complex Roots
Ex. 10.18 For b R + , consider the n n determinant Dn given by
b b 0 0 0 0 0 0 0 0 0
b b b 0 0 0 0 0 0 0 0
0 b b b 0 0 0 0 0 0 0 =bD n-1-b 2
Dn-2
0 0 b b b 0 0 0 0 0 0 b b
D1 |b| b and D2 0
0 0 0 b b b 0 0 0 0 0 b b
n n 1 n
0 0 0 0 0 0 b b b 0 0 n D b cos sin
3 3 3
0 0 0 0 0 0 0 b b b 0
0 0 0 0 0 0 0 0 b b b
0 0 0 0 0 0 0 0 0 b b
Case (c) Repeated Real Roots
Ex. 10.19 a n 2 4a n1 4a n , where n 0 and a 0 1, a1 3.
The C.E. is r 2 4r 4 0. Since it has only one root with
multiplicity 2, to have two linear independent solution, let' s
try a n c1 2 n c2 n2 n . With a 0 1 and a1 3, we have
n 1 n
a n 2 n2 2 n n2 n1 .
2
In general, the solution corresponds to a root r with multiplicity
m has the form ( A0 A1n A2 n 2 Am1r m1 )r n .
10.3 The Nonhomogeneous Recurrence Relation
Cn a n Cn 1a n 1 Cn 2 a n 2 f (n)
Let a n a n( h) a n( p) , where a n( h) denotes the general solution
of the corresponding homogeneous solution and a n( p) denotes
a solution of the given nonhomogeneous solution (particular
( p)
solution). Then Cn (a n( h) a n( p) ) Cn 1 (a n( h)1 a n 1 )
( p)
Cn 2 (a n( h)2 a n 2 ) (Cn a n( h) Cn 1a n( h)1 Cn 2 a n( h)2 )
( p) ( p)
(Cn a n( p) Cn 1a n 1 Cn 2 a n 2 ) 0 f (n) f (n), which
indicates that a n a n( h) a n( p) is indeed a general solution.
10.3 The Nonhomogeneous Recurrence Relation
Ex 10.23 a n 3a n 1 5(3n ), n 1, a 0 2.
a n( h) c( 3n ), and since 3 is a characteristic root, a n( p) Bn3n .
Substitute a n( p ) into the given relation yields
Bn3n 3B (n 1)3n 1 5(3n ), or Bn - B (n - 1) = 5, so B = 5.
Hence a n (c 5n)3n . With a 0 2, c 2.
peg 1 peg 2 peg 3
Ex. 10.24 The Tower of Hanoi Problem
a n = the number of moves required for n disks.
a n +1 2a n 1 and a 0 0.
a n( h) c(2 n ), a n( p ) A(1n ) n+1 disks
a n 2 n 1. move to
rule: one disk at a time
larger one must not on top of a smaller one
10.3 The Nonhomogeneous Recurrence Relation
Ex. 10.25 Pauline takes out a loan of S dollars that is to be paid
back in T periods of time. If i is the interest rate per period for the
loan, what constant payment P must she make at the end of each
period?
an:the amount still owed on the loan at the end of the nth
period (following the nth payment)
a n 1 a n ia n P,0 n T 1, a 0 S , a T 0.
a n( h) c(1 i ) n , a n( p ) A.
P P n P
A , a n S (1 i ) . Example:
i i i
P T P S=5,000,000
Since 0 = a T S (1 i ) , i=10%/12
i i
T=20 years=240 months
P ( Si ) 1 (1 i ) T 1
. P=48251
10.3 The Nonhomogeneous Recurrence Relation
Ex. 10.27 The snowflake curve
1 1
3
2
1
3
area: a 0
4 2
2
3 3 1 3 1 2
a1 3 a 2 a1 4 3
4 4 3 4 3
10.3 The Nonhomogeneous Recurrence Relation
Ex. 10.27 The snowflake curve
2 n
a n 1 a n 4 n (3)
3
4 3 n
1
1
an
1 4
4 3 9
n
4
a n( h) A(1) n A, a n( p) B
9
1 4 n 1
an 6 .
5 3 9
6 3 1 4 n 3 1 1
lim a n
n 5 3 4 4 3 n 0 9 4 4 3 4
1
9
Summary
f ( n) a n( p)
c, a constant A, a constant
n A1n A0
n2 A2 n 2 A1n A0
n t , t Z+ At n t At 1n t 1 A1n A0
rn , r R Ar n
sin n A sin n + B cosn
r=1 cosn A sin n + B cosn
n t rn r n ( At n t At 1n t 1 A1n A0 )
r n sin n r n ( A sin n + B cosn)
r n cosn r n ( A sin n + B cosn)
1. Linear combinations work.
2. If f(n) contains rn and r is a characteristic root of multiplicity k,
then multiply by nk.
10.3 The Nonhomogeneous Recurrence Relation
Ex. 10.30 For n>1 suppose that there are n people at a party and
that each of these people shakes hands (exactly one time) with all
of the other people there (and no one shakes hands with himself
or herself). If an counts the total number of handshakes, then
an+1=an+n, a2=1, n>1, because when the (n+1)th person arrives,
he or she will shake hands with the n other people already arrived.
a n( h) c(1) n c
a n( p) n( A1n A0 )
n( n 1) n
The result is a n
2 2
10.3 The Nonhomogeneous Recurrence Relation
Ex. 10.31 a n +2 10a n 1 21a n f (n), n 0
a n( h) c1 3n c2 7 n
f ( n) a n( p)
5 A0
3n 2 2 A3 n 2 A2 n A1
7(11) n A4 11n
31r n , r 3,7 A5 r n
6(3) n A6 n3n
2(3) n 8(9) n A7 n3n A8 9 n
4(3) n 3( 7) n A9 n3n A10 n 7n
10.4 The Method of Generating Functions
Ex. 10.32 a n 3a n 1 n, n 1, a 0 1.
a n x n 3a n 1 x n nx n
n n n
a n x 3 a n 1 x nx
n 1 n 1 n 1
Let f ( x) = a n x n
n 0
x
f ( x) a 0 3xf ( x)
(1 x) 2
1 x 7 / 4 1 / 4 1 / 2
f ( x)
1 3x (1 x) (1 3x) 1 3x 1 x (1 x) 2
2
7(3) n 1 (n 1)
an
4 4 2
10.4 The Method of Generating Functions
Ex. 10.33 a n +2 5a n 1 6a n 2, n 0, a 0 3, a1 7.
a n 2 x n 2 5a n 1 x n 2 6a n x n 2 2 x n 2
n2 n2 n2
a n2 x 5 a n 1 x 6 an x 2 x n2
n 0 n 0 n 0 n 0
2
2 2x
( f ( x) a 0 a1 x) 5x( f ( x) a 0 ) 6x f ( x)
1 x
10x 2 11x 3 2 1
f ( x)
(1 x)(1 2 x)(1 3x) 1 3x 1 x
a n 2(3) n 1, n 0.
10.4 The Method of Generating Functions
Ex. 10.35 a n+1 2a n bn , bn 1 a n bn , a 0 1, b0 0
Let f ( x) a n x , g ( x) bn x n
n
n 0 n 0
n 1 n 1
a n 1 x 2 an x bn x n 1
n 0 n 0 n 0
n 1 n 1
bn 1 x an x bn x n 1
n 0 n 0 n 0
f ( x) a 0 2 xf ( x) xg ( x), g ( x) b0 xf ( x) xg ( x)
1 x x
f ( x) , g ( x)
2
x 3x 1 x 2 3x 1
10.5 A Special Kind of Nonlinear Recurrence Relation
If f ( x) = a i x i is the generating function for a 0 , a1 , ,
i 0
then f 2 ( x) generates a 0 a 0 , a 0 a1 a1a 0 , a 0 a 2 a1a1 a 2 a 0 ,
, the convolution of the sequence a 0 , a1 , with itself.
Hence, for n 0,
bn +1 b0bn b1bn 1 bn 1b1 bn b0
n 1
bn 1 x f (x ) b0
select one as root n0
n 1
b0 bn (b0bn b1bn 1 bn 1b1 bn b0 )x
n0
b1 bn-1 2 1 1 4x
xf (x ) So f (x )
2x
bn b 0
10.5 A Special Kind of Nonlinear Recurrence Relation
Ex. 10.36 (continued)
1 / 2
1/ 2 n
1 4x 1 4x ( 4x )
n0 n
1 1 1 1
1 1 2 n 1
(4) n 2 2 2 2 n
( 4 )
2 n!
n
n 1 1 1 3 2n 3
(1) (1) n 4 n n
222 2 ( 1) 2 1 3(2n 3)
n! n!
(1)2 n n ! 1 3(2n 3) (2n 1) (1)(2n )!
n ! n !(2n 1) (2n 1)n ! n !
1 2n
2n 1 n
10.5 A Special Kind of Nonlinear Recurrence Relation
Ex. 10.36 (continued)
1 1 2n n
f (x ) 1 1 x
2x n 1 2n 1 n
1 2n n
n +1
and bn is half the coefficient of x in x .
n 1 2n 1 n
1 1 2(n 1) 1 2n
So bn
2 2(n 1) 1 n 1 n 1 n
1
j numbers k numbers j+k=n
0 n
1 n-1
n 0
a n1 a 0 a n a1a n1 a n1a1 a n a 0 , a 0 1
1 2n
an
n 1 n
Exercise:P423:10
P432,433:1,6
P444: 12
P457: 6