solving recurrences

27
$OWING RECURRENCES Structure Page No. 9.1 Introduction Objectives 9.2 Linear Homogeneous Recurrences 48 9.3 Linear Non-homogeneous Recurrences 52 ( 9.4 Some Other Methods 5 7 Method of Inspection Metl~okl of Telescoping Sums A/Iet,liod of Iteration Meth~d of Substitution \, 9.5 Summary , 65 9.1 INTRODUCTION In tlle two previous units of this block, you have studied about setting up , recurrences &tld how td solve them by the use of generating functions. In this V . unit we concentrat,e on other methods of findine solutions of recurrence a ,ions. equ t' To begit, with, we shall develop the gkneral theory for solving a linear l~omogeneous recurrence with constant coefficients. Following this, we shall disc,:~ss some general theory for solving a linear nhn-homogeneous recurrence whose ii~+$ornogeneous part is a polynomial or an exponential firnction. 'We shall concludc tBe-unit by illustrating several techniques developed:for solving recurrences wllicbmay otherwise be hard to solve by more standard mcihods. We shall also lo k at examples of red-life applications of the P t,heory we discuss. As you cau see, this unit is closely linked with Unit 7. So, please glance over that unit again before going further. Let us now clearly spell out the objectives of this unit. 0 b ject ives After reading this unit, you should be able to r find the characteristic polynomial, equation and roots of a linear,. homogeneous recurrence relation with constant coefficients; . I I r solve any linear, homogeneous recurrence relation with constant . , . coeAicients; I. / r solve linear, non-homogeneous recurrences with constant coeffic$~lts when the non-homogenous part is "either a polynomial or a n exponential function; 0 solve recurrence relations by the method of inspection/telescopic t 4 sums/iteration/~bstitution, wherever applicable. E 47 a

Upload: bmandar

Post on 08-Apr-2015

297 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Solving Recurrences

$OWING RECURRENCES

Structure Page No.

9.1 Introduction Objectives

9.2 Linear Homogeneous Recurrences 48

9.3 Linear Non-homogeneous Recurrences 52

( 9.4 Some Other Methods 5 7

Method of Inspection Metl~okl of Telescoping Sums A/Iet,liod of Iteration Meth~d of Substitution

\,

9.5 Summary , 65

9.1 INTRODUCTION

In tlle two previous units of this block, you have studied about setting up , recurrences &tld how td solve them by the use of generating functions. In this

V . unit we concentrat,e on other methods of findine solutions of recurrence

a ,ions. equ t'

To begit, with, we shall develop the gkneral theory for solving a linear l~omogeneous recurrence with constant coefficients. Following this, we shall disc,:~ss some general theory for solving a linear nhn-homogeneous recurrence whose ii~+$ornogeneous part is a polynomial or an exponential firnction. 'We shall concludc tBe-unit by illustrating several techniques developed:for solving recurrences wllicbmay otherwise be hard to solve by more standard mcihods. We shall also lo k at examples of red-life applications of the P t,heory we discuss.

As you cau see, this unit is closely linked with Unit 7. So, please glance over that unit again before going further.

Let us now clearly spell out the objectives of this unit.

0 b ject ives

After reading this unit, you should be able to r find the characteristic polynomial, equation and roots of a linear,.

homogeneous recurrence relation with constant coefficients; .

I

I r solve any linear, homogeneous recurrence relation with constant . , . coeAicients; I .

/ r solve linear, non-homogeneous recurrences with constant coeffic$~lts when the non-homogenous part is "either a polynomial or a n exponential function;

0 solve recurrence relations by the method of inspection/telescopic t 4 sums/iteration/~bstitution, wherever applicable. E 47 a

Page 2: Solving Recurrences

Recurrences I !

9.2 LINEAR HOMOGENEOUS RECURRENCES -

You would recall from ~ d i t 7 that the general form of a linear, non-homogeneous recurrence of order k is

un = fL.(n)un-l + f2(n)un-2 + . . . + f k ( n ) ~ , - ~ + g(n), n 2 k,

where each fj and g is a function of n. It i s ho~nogeneous if g is identically zero, and non-homogeneous otherwise.

Now, let us assume that g is non-zero. Then, associated with the non-homogeneous recurrence is the homogeneous recurrence .

which we get by simply setting to zero. the non-homogeneous part.

Let us concentrate on recurrences whose homogeneous parts are linear. You know that the most general linear homogeneous equation with constant ,

coefficients is

U, = + c ~ u , ~ - ~ + - . + C ~ U , - ~ , n 2 k,

where the ci are constants, i.e., ci E O V i.

Related to this is an equation that we shall now define. 'I

Definitions: The characteristic equation, or auxiliary equation, of the linear, homogeneous recurrence (I) is the equation

k k-1.- C2Zk-2 - . !. - Z - C I Z Ck-12 - ck = 0. (2) The roots of the characteristic equation (2) are called the characteristic roots of (1).

The multiplicity of a characteristic root a! of (I) is the greatest integer . m such that (2.- G Z ) ~ is.a factor of the characteristic polynomial of (I),

i.e., of zk - c,zk-l - + - a - .-.

Ck.

Notice that the characteristic equatidn is simply obtained by setting the ~ t h term of the sequence {u,) equal to zm in the recurrenoe, and simplifying.

For instance, the characteristic equation of the recurrence 1 ' u n + ~ = 2 u n -un-,, n _ > 2, is

z ~ + ~ = 22" - z"-~, i.e., z4 = 2z2.- 1. herbf fore, the characteristic roots of tLis recurrence are 1 and -1, 'both ivith multiplicity 2. I

Now, given the characteiistic roots of a recurrence, how do we solve it? As jrou know from Unit 8; solving a recurrence means finding a sequence {a,) that satisfies it, where a, is a function of n. Often if we can find such a sequence, then we shall (somewhat carelessly!) say an is a soluticm.

Now, to try and understand how to solve recurrences like ( I ) , let us consider the recurrence '

a, = 16q1-2.

. From Unit 8, you know that bits solution is of the form an = ~ ( 4 ) " t B(-4)n, where A and B are constants. Observe that 4 and -4

a r e the roots of the characteristic equation, z2 "16, of the given recurrence. Both these roots have multiplicity 1.

. Now let us consider the recurrence a an+, = + 4% - 8an-l.

Page 3: Solving Recurrences

you cjn check that its characteristic polynomial is z3 - 2z2 - 4z+ 8, i.e., ( z - ( z+2) . k' So, its characteristic roots ar 2 (with multiplicitjr 2) and -2 (with rnultiplidity 1).

applying the. tkchniques of Unit 8, you can also check that the general solution of the give11 recurrence is an = (Ao,+ A1n)(2), + Bo(-2)n,Ao,Al,Bo E C. We can ,write this as

an = AbC(n, O)21 + A;C(l.+ n, 1)2" + BoC(n,O)(-2)",Ab, A;, B, E C . Have these exarnples given you an inkling of the general form of the solution of (1) in terms pf its characteristic roots? Match your conclusions with the following theorem.

Theorem 1: A sequence {a,) satisfies the linear, homogeneous recurrence " relation with constant coefficients

U, = id^^^^-^ + - + Cl{U,,-k7 n 1 k, ,

if and only if each a, is a sum of expressions of the form boC(n,O)ar + blC(l + n, 1)af + . . . + b,,-,C(mi - 1 + n, mi - 1)af where , a2, . are the characteristic roots of multiplicity ml, m2, .; , respec- tively, and the bjs are constants.

Proof:. We recall from Theorem 1 in Unit 8 that the gencrating function, U(z), of the sequence {u,) is of the form p(z)/q(z), where p and q are polynomials with degp c g e g q, and q(z) = 1 - clz - c2z2 - . . - ckzk

Now, - clZ]'-l - c zlc-2 - . . . - 2 Cl<-lZ - cl< = I-I (z - q)'"'

. . i

2 1 I - clt - c2t - . - cktk = n (1 - where we put t = -. z

i I I ~ ( 2 )

:. U(z) = -, where. q(z) = n(1 - aiz)? &d deg p < deg q. Y (4 i

So, using partkl fractions, we can express U(z) as a linear combination of terms of the form (1 - cuiz)-j-l, where 0 < j _< mi - 1. Since the coeficient of zn in the expansion of (1 - aiz):-l equals C(-j - l , n ) a r , i.e., C(j + n, j)$, the theorem follows.

Note that each an in thc theorem is actually a finite linear co~nbination of terTs of the'form njan, where a is a characteriitic root of multiplicity m, and Q 5 j 5 m - 1. This is because the binomial coefficients Cdj + n, j) are themselves polynomials of degree j in the variable n. It is often easier to expresa the solution in this form, as for instance, when t h e characteristic roots \are all distinct, i.e., of multiplicity one. In this situation, the form of the solution sequence is -

k

,where the ajs are the characteristic roots and Ajs are constants that are to f

be deermined by the initial conditions. 8 .* Let us look'at some examples of how Theo~em 1 can be applied. While doing SO,' let us see how the solution depends on the initial conditions.

~ k a r n ~ l e 1: Solve the recurrence a, = 4an-2; where a),ao = 4, al = 6

Solving R.ecurrences

For j 2 0, c(-j, n) = (-l)"C(j + n - 1,n)

Page 4: Solving Recurrences

Solution: The roots of the characteristic equation of the recurrence,' z2 = 4, are -+2. Thus, by Theorem 1, the general solution is of the form a; = ~ ( 2 ) " + B(-2)", where A and B arearbitrary constants.

a) Now, if a. = 4 and al = 6, then the general solution gives us A + B = 4 a n d 2 A - 2 B =6 .

7 1 ' :. A = - ,B = -. 2 2

So the solution is a, = 7(2)"' - (-2)"-'.

b) If a. = 6 and a2 = 20, the general solution yields A + B = 6 a n d ' 4 ~ + 4 ~ = 20. Since these equations are inconsistent, t he r e is n o solution.

c) Ifa, = 6 , a 2 = 2 0 , weget 2 (A-B)=Gand4(A+B)=20 . So, A = 4, B = 1, and the solution is a, = 4(2)" + (-2)".

In the example above you have seen bow important the initial conditions are.. You have also seer1 that sometimes these conditions can be such that no solution is possible.

Now consider a second order linear homogeneous recurrence with constant coefficieilts that you solved in Unit 8 by making use of generating functions. This equation can also be solved by applying Theorem 1, as you will just see.

Example 2: Obtain the solution for the recurrence relation satisfied by the Fibonacci sequence (see Problem 1, Unit 7).

Solution: Recall that the Fibonacci sequence {F,) satisfies

The characteristic equation, z2 - z - 1 = 0, has distinct roots a = (1 + &)/2 and P = (1 - &)/2. Therefore, by ~Keorem 1, for some constants A and B,

F~ = Aan + Bpn, n 2 1. (4)

This is the general solution for the recurrence (3). As you have seen in the previous example, the values of A and B depend on the initial conditions, i.e., the first two terms of the sequence.

Since = 1, (4) + 1 = Act + BP.

Since F2 = 1, (4) + 1 = Aa2 + BP2.

Also, since a and P are roots of z2 - z - 1 = 0,

So, we get

1 = A a 2 + B P 2 = A ( a , + l ) + B ( / 3 + l ) = ( A ~ + B P ) + ( A + B ) = l + ( A + B ) . Therefore, A + I3 = 0. heref fore, A(n - P ) = 1, and

?, * * * I

i Now consider an example in which no initial conditions are given.

Page 5: Solving Recurrences

FJxnmple 3: Solve the sixth order linear, homogeneous recurrence relation

Solution: The first 'step is to identify the characteristic roots together with their multiplicities. The characteristic equation is z 6 + x 5 - 1 1 ~ 4 - 1 3 ~ 3 + 2 6 ~ 2 + 2 0 ~ - 2 4 = 0 . i.e.', ( Z - I ) ~ ( z - 3) (Z + 2)3 = 0. Since the root 1 is of multiplicity two, the root 3 of multiplicity one and the root (-2) of multiplicity three, by Theorem 1 we lcnow that u, is a linear

of the six terms

C(0 + n, 0).l1', C ( l + n, l) . ln, C(0 + n, 0)3", C(0 + n,O)(-2)", C(1 + 11, I)(-2)" and C(2 + n, 2) (-2)",

i.e., u, = a + b(1+ n) +c.3" +d(-2)"-te(l+n)(-2)"+f. (1 + n) (2 + n)

2 .(-2)",

where a , . . . , f are coristanl,~ which can be determjned if any six consecutive terms (typically, the first six) of the sequence arc known. Since no initial conditions i r e given, we can only simplify the expression 1;o the form u, = A + Bn + (3.3" + (D + En -t ~ n ~ ) ( - 2 ) " , where A , . . . ,F are constants.

* * * *

So far we have solved Iinellr recurrence relations by using Theorcm 1. Now let us solve a non-linear recurrence relation, by reducing it to a lincas relation.

\

Example 4: Solve the recurrence 3 5aa, where a,, > 0 ind a. = 2. Also find a,.

Solution: The given recurrence is a quadratic relation. ,But, if we put b,'= a':, the relation becomes b,+, = 5bn, b o - - 4. From Theorem 1, you know that its solution is b , = A(5)11, A a constant.

' Now, bo = 4 + A = 4. .'. b, = 4(5)". Since a; is the' positive square root of b,, ih = 2(5)"12 for n 2 0. :. a, = 1250.

Wlly don't you try some exercises now? +

El) Find the general solution of the recurrence relation an = 3cl,-l.

E2) Determine constants cl and c2 such that the recursion U, + c ~ u ~ - ~ + c ~ u , - ~ = 0 has the characteristic roots 1 f fl.

E3) Find the solution of the following recurrence equation satisfied by P:;:' the number of partitions of n into two parts in non-increasing order:

a n > 3 , P y = o , P ~ = 1,P:= 1 p; = p:-, +.P,--, -I?,-,,

In this section we have seen some .ways of solving linear homogeneous recurrences with constant coeflicients. You have also seen lzow some non-linear recurrences can be reduced to such linear recurrences, and hence

Ir solv&b.+L'ot us now see how to use what we have discussed here for solving non-homogeneous recurrences with constant coefficients.

Solving Recurrences

Page 6: Solving Recurrences

9.3 LINEAR N,ON-HOMOGENEOUS RECURRENCES

In this secti.on we shall look at some general theory pertaining to findink solutions of equations like u, = + 3n5

,- 2". More 'generally, we shall stugy equations of the form

U, = C ~ U , - ~ + c ~ u , - ~ + :. . + + g(n), n 2 k. (5) ~ o o k i n ~ at ( 5 ) , you may wonder if the solutions of (1) and (5) are linked. The following theorems tell us something about this.

I1 ; Theorem 2: If (an}nto and {bn},go are two sequehces, ex11 satisfying the

non-homogeneous recurrence (5), then {d,,), with d, = a, -bn, n 2 0, satisfies ( the associated homogeneous recurrence (1).

, Progf: Since {a,) and {b,) satisfy ( 5 ) , and d, = a, - b,, for n > 0 we get

d, = a, - b,

= [clan-l + + Ckan-k + g(n)] - [clbnVl + . . + ckbn+ + g(n)] = + - * + ~ ~ d ~ - ~ ~ .

, This'shows that {d,) satisfies (I), i.e., we have proved the st,atcrnent. I I

Now, can you see how we can use Theorem 2 along with Theorem 1 to iind I the general form of any solution of (5)? The following result explicitly

answers this question. . . -Theorem 3: Every solution of the recurrence (5) is of the form a, $ b,, where

A particular solution a, is any particular solution of (5) and b, is any solution of its associated of (5) is any sequence . homogeneous .recurrence (1). . {a) that satisfies (5). Proof: Let a, be any particGlar solution of (5). Now, Theorem 2 tells us

that t,he difference of any two solutions of (5) is s solulion of (I).' So, every solution u, of (5) sztisfies u, - a, = b,, where b,, satisfies (I), Therefore, u, = a, + b,, where a, is a particular solution of (5) and b,, is a solution of (I).

We have proved the two theorems above only for l inea~ recurrence relations ,

with constant coefficient. But they hold true in the general case also. This is , what the following exercise is about. ,

E4) State and prove the analogues of he or ems 2 and 3 for general recurrendes of the form

u, = fl (n)u,-l+ f2 (n)u,-2 + . . + f,$(n)u,-k 4 g(n), where the fis and g are.functions of n.

1 I

I

I I -

In view oi the two theorems above, to solve (5) we must look for any one solution of (5) and the general form of the solution of (1). Let, us consider

I

an example.

Example 5: Find the complete solution of the recurrence a, = 3a,-l - 4n, n _> 1.

Solution: The required solution, as Theorern 3 says, is the sum ofikhe '

general solution of a, ='3an-1 and any solution of the given recurrence. . . From El you know that the general solution of an = 3a, is an = b.3",

52 where b is a constant,

I

-

Page 7: Solving Recurrences

NOW, let us consider tlle non-homogeneous part too. ire have an = 3andl - 4n. Let us sec if an can be of the form An + 13, A, B E C. If it is, then A n + B = 3[A(n - 1) +B] - 4n = n(3AL 4) - 3A+ 313. Comparing the coefficients of n, we get A = 3 A - 4 a n d B = 3 B - 3 A r - .

i.e., A = 2 and B = 3. So, a,, = 211 + 3 works, and hence is a par t icular solution of the givcn recurrence. So, the total solut,ion of the recurrence will be an = b.3" + 2n + 3, b E C.

I

Solving R,ecurren'ces

Ih the example abovc, we have obtained a particular solution by guess work. In Inany cases we need i,o use such an approacli. Unlike the hotnogeneous case, there is no gencrd ind,llod to obtain a particular soluiion for a non-liorr~ogcneous reci~rrc;lcci But there arc techniques available for ccrt,nin recurrc;icc~, including Ilic onc given in Example 5. The following theorems tell us about two special cascs.

Theorem 4: A part,icular solution of (5) with non-homogeneous part an(', where a is a. ltnowri ronstanl and d E N, is of Ihe form i) A, -1- A L n 4- A2n% + . + AA,,nd,'if 1 is not a characterist ic r oo t pf (5);

ii) Ao~l'T' + AI~i"'S1 + . . + A(,n'n-(-dl if 1 is a charact,c.risl,ic root of (5) with inultiplicity m, . .

wllere A,, A, , . . . , A, arc constailts.

Theorem 5: A particulss solution of (5) with non-lioniogeneous part as'' (where a is a ltrlowri const,nut) is of bhc form

i) Ar", if r is n o t a character is t ic r oo t of (5);

ii) Aiin'r", if r is a cliaractcristic root d (5) with inultiplicity rn, whcre A is a, constant,.

We wid1 riot prove tliese results Ilerc, but shall look a t a few oxamples of toheir use. Yoii rnny rccall llaving encuuntored soine of these examplcs in prc?vious units.

43xarnple 6: Find t,hc soliltion bo tlic recurrence in Problem 3 of Sec. 7.2, namely, L,, = L ,,-, + n, n > 2, with L1 = 2.

Solution: Obscrve thai, 1 is Ihc only dlnractcristic root of this rccurreiice. So, the general soliltion to thc Iioniogcueous part of this rccurrcnce is simply a. ln = a, wliwc 'n, is a constant.

Now, the non-homogeneous part of the recurrence is n. So, applying Theorem 4(ii) with In = 1 and d = 1, we see that a particular solution of this recurrence is of the forril Aon + A,n2, A,,, A, E C . To find the values of A, alld Al, wc set L, -r A,n + A] 1i2 iii the securrence relation to get

Aon-t-A1ll" A,(n- 1) + ~ , ( n - l ) ~ + n = (-Ao + A L ) + (A, - 2A, + l ) n + ~ ~ n "

Comparing the collstant terms and Che coeficicnts of 11, we get '0 = -Ao + A,, A, = A, - 2A1 + 1.

Page 8: Solving Recurrences

\ Recurrences I

Now, taking the sum of both the solutions, we get

L , = a + n(n + 1) 2

The initial.kondition L1 = 2 tells us that a =' 1, so that

* * * .Example 7: Rani takes a loan of R rupees which is to be paid back in T months. If I is the interest rate per month for the loan, what constant payment P must she make at the end of each period?

Solution .: Let a, denote the amount Rani owes at the end of the nth month, i.e., after the nth payment. Then the problem can bei;written'as

%+I = a ,+Ian-P, 0 ~ n 5 T - l , a 0 = R , a , = 0.

So, the homogeneous part contributes b ( l + I)" to the solution, b being a constant.

. . Using TheoreaS(i), with r = 1, we see that ,the non-homogeneous part contributes A, a constant. But then;putting a, = A in our recurrence relation, we get A = A(1 + I) - P + A = P/I.

Thus, a, = b(l +I)" + P/I. Then, a. = R + b + P / I = R + b = R - P / I

I Also, 9 3 0 =% b( l + I ) ~ + P/I = 0

:. P = IR(l + I ) ~

I [I - (1 + I)T] * * *

I Example 8: Solve the recurrence u, = aundl + c.an, n 2 1, where a and c are known constants.

I

I Solution: Using Theorem 5, we get

u, = A.an + Bnan, A and B being constants. I I

= an(A+Bn) for n 2 0. I

* * * Now, here are some simple exercises for you,

I

E5) Solve the recurrence Tn = 2Tn-1 + 1, n 2 2, with TI = 1. (see Problem 2, Sec. 7.2).

E6) The population of a species of snails in a certain lake triples every year. Starting with 1000 such snails, and finding 1500 of them the following year, 200 are removed from the lake to increase them in other lakes. Similarly, at the end of every year 200 are removed. If a, represents the snail population in the lake after n years, find and solve a recurrence I

relation for a,, n 2 0.

Now let us ansider a result which tells us how to find a particular solution for recurrences with non-homogeneous parts which are linear combi~lations of nd and rn, r a constant.

1

Theorem 6 (superposition Principle): If {a,) is a solution of

Un = CIUn-l + C2%-2 + ' ' + Ckun-k + gl (n) and {b,) is a solution of I

I

Page 9: Solving Recurrences

un = CIUn-1 + C2Un-2 -1 . . . + C~<Un-k + g2 (n), then, fo'r constant,^ A and B, Aa, + Bb, is a solution of

un = c lun -~ + . . - + C ~ U , - I ~ + Agl(n) + Bg2(n).

Proof: For 11 2 lr, we have Aa, + Bb, = A [ ~ , ~ n - l + ' ' ' + Ckan-l< + + B[b,-, +.. + ckbn-k + g2(n)] = c1 (A%-, + B b n - ~ ) + + ~ k ( ~ & n - k + Bb,-k) + {Agl (n) + Bg2(n)}.

This means that Aa, + Bb, is a solution of (5) with g(n) = Agl (n) + Bg2 (.).

In view of Theorem 6, we can combine the results of Theorems 4 and 5 to get solutions of non-homogeneous recurrences like the following one.

Example 9: Obtain the general solution of the recurrence v, - 7v;,-, + = 5.2" - 4.3", n 2 2.

Solution: Since there are no initial conditions and the equation is of second order, we can only expect a general solution involving two constants.

To begin with, the homogeneous part v, - 7v,-, + 1 2 ~ , ~ - ~ = 0 has the characteristic polynomial z2 - 72 + 12,'i.e., (z - 3)(z - 4). Consequently, itis geneid solution is of the form a.3" -I- b.4", where a, b E C .

Now let's consider the non-hornogencous part. I t consists of two terms, one of which is a power of orie of the characteristic roots. By Tlieorems 5 and 6, we must set v, = c.2" + dn.3" in order to find a particular solution. When we do this, the recurrence relation gives us 2n-2c(4 - 14 + 12) + 3"-'d [9n - 21(n - 1) + 12(n- 2)] .= 5.2" - 4.3". ,

2"-'(c - 10) = 3"-' (d - 12) Since this equalit,y is true for every n > 1, we see that 2"-l J (d - 12) for every n 2 1. This can only be true if d - 12 = 0, i.e., d = 12: This forces c - 10 = 0 to be true, i.e., c = 10. Putting all this information together, we get v, = 10.2" + ( a + 12n)3" +b.4", whcre a , b E C . .

Let us go back to Theorem G for a moment.' Will the superposition principle be true for linear ho~no~eneous recurrences too? Actually, it will, and we have been using this fact quite a lot. Try and pinpoint where we have first used it for such recurrences.

, Here are some exercises now

E7) If the recurrence u, + clu,,-, -t C ~ U , - ~ = an + b has a general solution u, = A.2" + B.5" 4- 3n - 5, find a ,b,cl and c2.

E8) Solve the recurrence v, - 7v,-, + l 6 ~ , , - ~ - = 2" + 3,, with the initial terms vo = 1, v, = 0, v2 = 1.

,Solving Recurrences

So far we have seen how to solve (5) if g(n) is of the form and, arn or a lincar combination of terms of these types. There is one more type of non-homogeneous part [,hat we shall discuss now.

Theorem 7: A particular solution of (5) with non-homogencous part andrn, where a and r are known constants and d E N, is of the form

ij Arn(Ao + A, n + .. + ~ ~ n ~ ) , if nei ther r nor 1 a re characteristic roots of (5);

ii) Anmrn(A, + Aln + - - + ~ ~ n ~ ) , if e i ther r o r 1 (but not bo th) is a characteristic root 01 (5) with multiplicity m;

Page 10: Solving Recurrences

. - Recurrences iii) Anml'"'~n(Ao + Aln + . . . + Ac,nd), if.r and 1 b o t h are characteristic

roots of (5) with multiplicities ml and m2, respectively, where A, Ao, A l l - . . , Ad are constants. ,

As before, we shall not prove this result, but shall show how it can be applied,

Example 10: Find a linear homogeneous recurrence with constant coefficients for which the characteristic roots are 1 with multiplicity two(-1 with multiplicity three and 2 with multiplicity five. Further, assume that the non-homogeneous part is a linear combinatipn of n ( _ l j n , n2.2" and 3" plus a,

polynomial of degree three.

Solution: We wish to solve a recurrenve which has 10 characterjstic roots.' .

So, it is of the form I

'where we know that the characteristic polynomial of the homogeneous part % . is (a-1)2(z+1)3(z-2)51

9 i.:~., - C I Z - . . . - C9Z - C1O - (Z - I ) ~ ( z + 1 1 3 ( ~ - 215.

So, by Theorem 1, the form of the general solution to the hornogeneo~~s part will be

I

(A,+Aln).l"+(B~+Bln+~2n2)(-l)n+(CO+'~ln+~~~+~4n4)211, (6).

where the As, Bs and Cs are constants. i

Now, by Theorem 4, you know that the form of the particular solution correspondjng to the third degree polynomial is

n2(Do + D16 + ~~n~ + D3113), wher,e the Ds are constants.

I;'roin Theorem 7 you know that the form of the solution corresponding to bn(-1)" is n"-1)"(?Eo'+ ~ ~ n ) , and to

cn2.2" is 117.2"(~o + Fin + F2n2), where the Es and Fs are constants.

From Theorem 5, you know that the.part of the solution 'correspondi~lg to d.3n is G.(3)", G being a-constant. '

Thus, the particular solution is of the form

' n 2 ( ~ 0 + D l n + ~ 2 n 2 + ~ 3 n 3 ) x + n 5 ( - 1 ) n ( E o - ~ E , n )

+ J (2" ) (F0 + F,n + F&') + G(3") ' 1 (7)

' Therefore, the complete solution is the sum of thc expressiorls in (6) and (7). 5

S t *

Here's an exercise of'the same type for you.

E9) Find a recurrence relation with constalit coeflicients for which the characteristic roots are 3 with multiplicity 1 and -2 with multiplicity 2. The relation also has a non-homogeneous part which is a liacitl. combination of 2", n(-1)" and a polynomial of degree 2.

In this section we have considered some general methods for tsclclillg spekial . kinds of non-homogeneous recurrences. While studying them yon would have noticed that the solution af the non-liornogeneo~ part is depc?ndent on

-whether a characteristic root of the recurrence occurs in this p,2rl;.

Now that you have studied this section and Unit 8, car1 you solve? all thi: problems given in Unit 7? What about the 'divide and conqucrl problem'! To solve this pr.oblern and other recurrences with non-horr~ogcn~o~~s

Page 11: Solving Recurrences

different from the ones looked at in this section, we need to look at some Solving Rec~irrences other sblution techniques. Let us do so now.

9.4 SOME OTHER METHODS

In the previous section we have seen how to deal with two ltiilds of non-homogeneou~ parts of linear recurrences. There are many other kinds of recurrences that we can solve by some special methods. We shall look at four of these methods in this section.

9.4.1 Method of Inspection - .

-

One simple way of solving a recurrence is to write down enough terms in the sequence until one feels comfortable in guessing the solution. However, unless the pattern of the sequence is fairly straightforward, it, is not easy to make a good guess. Usually, if one has made a correct guess here, the principle of mat8hematical inductiorl (see Unit 2) can be used to prove the guess. Let us consicier an example.

Example 1J: Solve, by inspection, the recurrence relation an = an-l + n!n i f n > 1, 2nd ap = 0.

\

Solution: If wc compute the first five terms of this sequilce, we get, 0,1,5,23 and 119. Can you see what thc nth term might, be? Does adding one to each term in the sequence help? Doing so would give us a sequencc that you would recognise, i.e., (n + I)!. So our initial guess is a,, q ' ( n + I)! - 1.

Having done the initial work of making a guess, let us attempt t;o prove it by using induction on n. The base case is easy to check: so = (0 + l ) ! - 1 = 0. If we are to assurn? the result fbr n = k, for some k 2 0, then

akrl = ak -I- (I< + l)!(lt + 1) = [(k + I)! - 11 + (k + l)!(l< + 1) = (k -t- I)!(]< + 2) - 1 = (k + 2)! - 1, as we hoped.

This completes the, proof by induction, and proves our guess.

* * * Here's an exercise for you now. ;

E10) Use the method of inspection to solve the recurrence b, = bn-l + 4n" 6n2 + 4n - 1 for 11 2 1 with bo = 0.

Let us now consider another method for solving recurrences.

9.4.2 Method of Telescoping Sums

This neat method is useful for solving recurrences of the form k

U, = u,-, + g(n), particularly if g(n) easy to find. More generally, it n=l

can be uied to evaluate sums of series and products.

This method is based on the fact that the sum of thc first N terms of a scrfes whose nth term is of the form an - a,-, is simply

- "01 + (az - a,) + -I- (aN-l,- aNA2) + (aN - aN-l) = sN - aO. In much Ihc same manlier, the product of the first N terms of a series with nth term a,/a,,-l is aN/ao provided, of course, that none of the a,,'s is zero

Page 12: Solving Recurrences

I

~:ir.ll(trl telesc,.. !:>i,~g in arii~logjr \vi!,I L ~ . i , i :

tl~ic:i;uc:ss I ) ? : ;I (:iliil~j)s~d tc?lescopi?, nrli!:::~ is the tlilLt:l.erir:cl hetxxe.:~.i.ltl the c~ut,es radius of t,he o~.~t;c~rznost t,ube end the irmor l,a.dius of the i ~ l n c n l ~ o s t lube.

TT'llough t,his method appears easy, it is not often that this method can be applied, and often not, easy to see how to use it even when it can be! Let us sec a, few irlstitri[:e~ of where it can be applied.

Example 12: Solve the linear recurrence a,, -- all -1 = Fn+2.-7,-1, 11 2 1, w1ler.c a. = 2 and .Fi denotes the ith Fibonacci 'number. .

Solution: F'rom Example 2, yon know that 3,+,Jn.-, = (+,+I + F n ) (%+I - Fn) = 3:+1-

So, for n = 1,2, . . . , the recurrence gives us the following equations:

an - an-l = 3,2+1 - 3; On adding these equations, we find that

2 a, - a0 = F:+~ - 3; ~ a n = 2 + F : + 1 - l = . F : + l f 1

The next example should be familiar to you. Recall, from Sec.8.2, that denotes the sum of the kth powers of'the first n positive integers.

Example 13: Compute uA,ui and a:, using t,he method uT t(!lcscoping sums.

Solution: To find a;, we sum both sides of the identity. (k + 1)2 - k2 = 2k + I from k = 1 to k = n. On doing so, wc get,

II n n

(n + - 1 = C {(k + 1)' - k2) = 2 C k + C 1 = 2n: + n.

Let us now find 0: and rsi. Summing both sides of the identities (k + 1)3 - k3 = 3k"f 31' + 1 and (k + I)$- k4 = 4k3 + 6k2 + 4k + 1 from k = 1 lo k = n, we obtain

n n . n 11

( n i - ~ ) ~ - 1 = c {(k+ 1)3 :k3} = 3 1c2 + 3 k + I k=l k=l , k=1 I(= 1

= 3 4 + 30: + n, and

= 4 4 + 6 4 + 40; + n.

From the first of these equations, and using the value.oS CJ-; f ro~n above, c: = n(n + 1)(2n + I)/&.

Plugging in the values of D; and a: into the second ccluation, we now obtain l a: = {n(n + l ) / 2 l 2 . I

* * * ) i While going through thc example above, you may llavo Sclt t,h:~t thero is a I

I much simpler method to compute CJ:. But the advantage of using t,elescoping I

sums is that it also works for computing ok for labger v:~lucs oE k, where the I simpler method does"not.

I Now you can try and obtain the general formula for n:, k 2 1.

I

Page 13: Solving Recurrences

Solying Recurrences 1

~ 1 1 ) Find a recurrence relation satisfied by the sequence arid hex?:'? 4 compute u,.

Let us now look at Problem 7 of Unit 7, namdly, the nllrnher of derangements on k symbols, dk.

Example 14: Solye the recurrence

d, =led,-, + (-l)k if lc> 2, with d, = O .

Solution: Loolcing a t the recurrence, it doesn't seem to be in the form in which we can apply the method of telescoping sums to solve it. But we car1 alter it slightly to bring it into a suitable form. We simply divide each terrri by k!, and get

Now we can apply the method since the terms are such that if wc wrile down the eqliations from lc = 2 to lc = n, and add them, most of 'the terms will get cancelled. We will only be left with

n

- - - - (-1)lC n! I!

I<=% lc=O

Therefore,

In the next example we see how 'telescoping products' can be used for solving recurrences.

Example 15: Solve the recurrence a, = n3a,-1, n > 1, a. = 2.

Solution : Let us put lc = 1,2, . . . , n, in the equation a = kc3.

&k- I

We get

'1 = 1 3

8 n - - n". an- 1

Multiplying these equations, we get a

= (n!)3 "0 - an = qn!13.

The technique in the example above can be used more generally for non-homogeneous recurrences of the lype an = f(n)an-l + g(n), where f(n) # 0 for all n. Let us consider an example of this.

1 ' 1 Example 1G: Solve the recurrence u, = ~ u n - 1 + -, n 2 1, uo = 1.

n !

Page 14: Solving Recurrences

Recurrences 1 . Solution : The homogeneous part of this recurrence is = - . Using the n - n

method of telescoping products, we get 1 1 1 1

a n = - ' " - = - n n - 1 1 n!' Now, suppose that the solution of the given recurrence is of the form

This method can be u, = anbn, where b, = 1. Then applied here since 1

1 1 - # O V n > l . a,b, = -%-lbn-l + - n n ! n 1 . 1

I = anbndl + 2, since a, = -4-1

n 1 -i 1 + b, =. b,-, + '- = b,-, + 1, since a, = - an n! '

Now, we can use the method of telescoping sums to solve the recurrepce b, = b,-, +1, b," = 1. We get b, = n + l .

n + l Therefore, u, = anbn = -.

n ! * * *

Can you clearly spell out the steps we have gone through in ~ x a m p l e 16? To obtain a solution of the recurrence n, ='f(n)unPl + g(n), the skcps arc:

S t ep 1 : See if f(n) # OVn. Only then can this method be applied.

Step 2 : Find the solution {q} for the homogeneous part of the recurrence. SO, % = f(n)%-lQn 2 1.

I ' Step 3 : Assume that the solution of the given recurrence is of the form,

, i U, = a,b,. - - Then

anbn = f (n)an-lbn-l +-g&) ,

= anbn-1 + g(n) . ' Therefore, b, = b,-l.+ g(n)/a, .

Here is where we use the fact f (n) # 0 V n. (Now?)

' Step 4: Solve the recurrence g(n) bn = b,-, + - '

an by whichever method you find 'suitablb.

Step 5 : Then the solution to the given recarrknce is u, = anb,,. - -

Here are some exercises now. I

E12) Show that C(2ia, n) is a solution of Lbe recurrence . 2(2n-1) X, = Xn- l , n '2 1% n

E13) Use the method of telescoping sums and products to solve the . recurrence a, = n3a,-l + (n!)2 if n 2 1 and a" = 1.

E14) Solve the recurrence a, = (n!n)a,_ n 2 1, a,, = 5 .

1

~ e t bs now see how telescoping sums can be used efficiently lo sum an infinite I

I series, Although this is not an example involving recurrerlcc relations, you

1 60 would get some idea of how this method can be applied to dif1crent problems.

lid*

Page 15: Solving Recurrences

Example 17: Use the method of telescoping sums to sum the infinite series Solving Recurrences; 3 - 5 7 +L+-+...+

2n+ 1 + ... 1.2.3 2.3.4 3.4.5 n(n+ l ) ( n + 2)

Solution: The central idea behind telescoping sums is the expression of the I

nth term as a difference of successive terms of a sequence. We would have been able to apply this had the nth term in this summation been a product of only two terms in the denominator. But don't worry! Let us try and extend the idea.

With three terms in the denominator, we first express the nth term as'a partial fraction:

2n + 1 - --+--- 112 1 312 n ( n + l ) ( n + 2 ) n n + 1 n + 2 '

Now, if ai denotes the it,h term of the series, then

-312 1 112 Since - + - + - = 0, cancelling groups of such terms, wc get

n n n

Therefore, S = lim Sn = 514. n-+co

* * * Why don't you try some exercises now?

E15) By methotls of this sub-section, solve the recurrence nx, = (n-2)xnV1 + I , n > 1, where xo = O . '

E16) Using the method of telescoping sums, prove the following Fibonacci identikies

/ .

1: I

And now we shall consider another very commonly used method for solving I, I

recurrences. 6.1 ' 5

1 I

Page 16: Solving Recurrences

t Recurrences 9.4.3 Method of Iteration

Iterati011 nleaas 'to repeat'. In a sense, this is what we do in this method. More precisely, we successively express the nth term un in terms of some or all of the previous (n - 1) terms u!, ul, - , . , u ~ - ~ , using the recurrence equation again and again. While doing so, we try and find an emerging pattern which can help us find un explicitly as a function of n.

To see how this-method works, let us look at an example.

Exainple 18: Solve the recurrence relation given by u , = 2unal + 2" - I, where n 2 1 and uo = 0.

Solution: Replacing n by n - 1, n - 1 by n - 2, and so on in the recurrence equation, we get u, = 2 ~ , - ~ + 2" - 1

= 2 ( 2 ~ , - ~ -t. 2"-l - 1) + 2n - 1 = 22~,-2 + 2.2n - (1 + 2) = 22(2~,-3 + 2n-2 - 1) + 2.Zn - (1 + 2) =i 823~,-3 + 3.2" (1 + 2 + 22)

* * *

i In the example abpve, we began with the recurrence relation and reached an expresiion for thg nth term in terms of n. In principle this mefhod always I

1 wcirks. But, i t is not always easy to apply because the computation can sometimes get out of hand.

Why don't you try the following exercise now? You shouldn't hive any difficulty & th'e computation. In fact, you may find it easier to solve by this method than by the .method you used earlier.

1 1 E17) Solve the recurrence y = -u,-~ + -, n > 1, with uo = 1.11~'tlle

" n! .

methbd of iteration.

I Let us now consider an example which.can be solved by iteration as well as

' \

by first solving the recurrence for ak jnd then summing thc series, Let us 1, : !

"solve it by using the former. method. >

Example 19: Sum the first p terms of the series whose kth term, a],, I satisfies the recurrence ak = 3&k-1 + 1, and whose initial l;crm, is a, = 2.

Solution: From the recurrence, wet fihd that n-1

a = c 4 + (3a-, + 1) k=1 k=l

n-2 = + (1 + 3 ) ( 3 ~ ~ , - ~ + 1) + 1

k=l n-3

= a k + ( l +a+32)(3an-, + I ) + { I + (1 + 3 ) ) k=l n-4

= C a, + (1 + 3 + 3' + 33)(3an-4 + 1) + {f + (I + 3) k=l +(I+ '3 + 3"))

6 2

Page 17: Solving Recurrences

. 3k-1 and l + 3 + . . . + 3 k - 1 = - .

3 - 1 5.3" - 3 - 2n

You may lilce to try and solve a similar problem now.

-

E18) Use thc, method of iteration to find the sum of the first n + 2 terms of the series whose kt11 term, u,,, satisfies the recurrence uk = u ~ - ~ + k, and whose initial term is u1 = 1.

Now let us discuss the fourth inethod of this section.

So far we have seen scveral teckiliques for solving a variety of recurrences, linear and non-linear. But there are some that defeat our eiitire arsenal. For instance, we are ill cquippecl to handle even some of the simplest non-linear recurrences and linear recurrences with non-,constant coefficients. It is in some of these cases that we can call hpon a substitution to extricate ourselves from this position.

The method of substitution is used to change the given recui-rence to a form that can then be readily solved by one of the previously discussed techniques. As you might expect, the hard part is io figure out what the substitution should be. Let us see h w this method works through examples related to 'the divide-and-'conquer relations.

, Example 20: Solve ihe recurrence relatioil of Ptoblem 8 of Unit 7, namely, -a,.= a,,/2 + 1 for n = 2",k 2 l , a l = 0.

\

-- Solution: 'bet ._US put a2k = u,~. Then the given recurrence becomes U k = Ul,-l + 1, Uo = 0: Now, we. can apply the method of telescoping sums, to get the solution 11,~ = u0 + n = n, i.c., a,, = n. i.e., a, = log,m for m > 1.

* * * Example 21: Solve the recurrence obtained by 'merge sort' in Sec. 7.4, namely, a , = 2a,,12 + n - 1, u = 2k, k > 1, al = 0. .'

Solution : As in tlie pre+ious example, we put a,,, = uk. Then the recurrence becomes 'uk = 2ukW1 + 2k - 1, Uo = 0. Now, as in Exarnple 18, we get U,, = (k- 1 ) 2 ~ + 1, i.e., a 2 k = (lc - 1)2'< + 1, i.e., a, = (log, n - l ) n + 1.

* * * Here are sorne recurre~ices for you to solve now.

9) Usihg an appropriate substitution, solve the recurrence

Solving H.ecurrcnces

Page 18: Solving Recurrences

Recurrences 11 - 1 1 + -, n > 1, where yo = 5. Y.' - y - Y n - 1

E20) Solve the recurrence t, = 3t,/:, + 1i2, t, = 2, by substitut,ion, and specify for which values of n the conversion is valid.

Let us look at anbther example, one which makes it a riatursl candidate for the substitution technique.

Example 22: Solve the second order, non-linear recurrence x, = ( 2 G + 3 ~ ) ~ , n 2 2: wit11 tile initial co~lditions xo = 1, = q.

Solution: Looltirig at the recurrence, you probably feel Ihal wc have not developed the tools to solve an equation of this type. Le1;'s acc'if we can, transform this into a linear recurrence. Let,us malcc! tlle ~ubutit~ution yn = 6, n > 0. (Note that this substitution is valid because cad1 X, is non-negative.) The substitution does not quite make the recurrence liiica,r, but, at least it gets rid of the square root symbol-Lhe problein now bcc,onlcs y: = ( 2 ~ , - ~ f 3 ~ , , , ~ ) ~ , n _> 2, wit11 yo = l , y l = 2. Extracting square roots of e i ~ ~ l l side, we now get, Yn = 2~~1-1 f 3~n-21 n L 2.

This is a second order linear recurrence with consbant c*c~c:fIicients, illid (;all bc solved by standard rnetliods discussed eilrlicr. Wc let~vo it lo yo11 l,o v(;rify that the solution is y,l' = A.3" $ B(-l)", n 2 0, for some confitants A , B.

Using tlle irlitial conditions, we further gel A 4- B = 1 and 3A - B = 2, so that A = 3/4 and U = 1/4.

* $ *

As a final example, we look a,t n.not1ier ~loli-linear rur:ur.ronc:c wil,ll ~ L I I

expoile~itial-t,ype relation between the t c ~ ~ n s . .

Example 23: Solve the recurrence givcri by x,, = >c; - , /x,1,C2, t,ogo!f,l~cr wit11 the initial conditions xo = 1 and x, = 2.

Solution: Taking the logaritllrn to ariy convcnioilt, bas0 (wo i~rc: only going to be dealing wit11 positive numbers in t l~is secllictnco afLcr all!) rc!ducc?s the right side of this to a form wc c i ~ r ~ quile casily llnntll(::

log:, x, = 7 logz x " _ ~ - 12 log2 x,,-2.

Now, let y,, = logax,,. The scquencc {y,,) snt,isiius t110 i.oc-llr.rc:Ilc:c?

Yn - 7 y n 4 + 12yr1-2 = 0.

So its characteristic roots are 3 arid 4. Therefore, y, = a.3" + 1).4", n 2 0, a, b E C. Now, the initial coriditions xO = 1 and xl = 2 yic!l(l yo == 0 il11(1 y , = 1. Putting n = 0 and 1 in y, = a.3" -k b.4" gives s = -1,l) = 1. Therefore, y,, = 4" - 3". T ~ U S , x, = 2yll = 24n 0.

* * d:

Observe that Ilie choice of base in tho oxil,rnplo ;J)ovc! tloc!s llol, allor l l ~e find answer, as indeed it must nol,! Wc c2iose 2 1~c:causc: xu and x , arc, both powers of two.

Now, for 'some exercises.

Page 19: Solving Recurrences

Solving RecUmmres

E21) Find the solution of 6 - 5 G + 6- = 0, n 2 2, where xo = 4. and xl = 25.

5 E22) Solve the recurrence x, = 4n(n -- l)xnd2 + -n!(an) for n > 2, if xo = I

9 and xl = -1.

E23) Let {u,) satisfy the non-homogeneous recurrence

U, = ~ ~ 1 1 ~ - ~ + c'u,-~ + c ~ u , - ~ + c ~ u , - ~ + g(n),

such that the associated homogeneous recurrence has (z - 2)(z - 3) (2 - 412 as its cl~asactesistic polynomial, and {g(n)) satisfies a fifth order linear homogeneous recurrence with constant cocfficients whose characteristic polynomiil : - 2)2(2 - 3)(z - 5)'. Determine u,.

E24) Let {v,) satisfy the second order recurrence

with bl , b2 and r as constants. Prove that the sequence also satisfies the *

third order homogeneous linear recurrence with constant coefficients ' having (z2 + blz + b2)(z - r ) as its characteristic polynomial.

E25) Let {x,),~, and (y~) ,>o be two soliltions of the recurrence u,, + alun-l -I- a2un-2 = 0, where al and a2 are constants. a) Show that { ~ , y , ) ~ , ~ satisfies a third order linear hornogeneous *

recurrence with co?istant coefficients.

b) Show that { x ~ , , ) ~ , ~ satisfies a second 'order linear hornogeneous recurrence with constant coefficients.

E26) Assume that for positive real numbers a, b and r, there exists m E N ' such thkt (a -1 bn)rn < n! for n 2 m, Using this, prove that there does not exist any second order homogeneous linear recurrence with constant coefficients satisfied by the sequence {n!).

With this we have come to the end of this unit and block on recurrences. Let us talre a quiclr look a t what we have covered in this unit.

9.5 SUMMARY I

In this unit we have discussed the following points. I

I. The solution of the linear homogeneous recurrence with constant coefficients, U, = c lun -~ + CZU,-~ + a - + C~U,_I( , n 2 k, ,

1 1

I , !

where al, . . - , a, are the distinct characteristic roots of this recurrence 11

1

with multiplicity t l , . . . , t,, respectively. I I

2. The solution of a linear non-homogeneous recurrence ____ is the sum of bhe I

general solution of its homogeneous part,and a particud& ~olut ion of the I

I

whole recurrence. I

3. A particular solution of I

U, = CIUn-l + CZU,-~ - . . -I- Cku,-k f andl n > k ,

1

65 I,

Page 20: Solving Recurrences

I Recurrences is of the form nm(A, + k,n + a + Adnd) where rn 2 0 is the multiplicity of 1 as a characteristic root of the equation, and the Ais are constants.

4. A particular solution of un = c1 u ~ - ~ + c ~ u ~ - ~ + . . + c k ~ n - k + axn is of the form Anmrn, where m 2 0 is 'the multiplicity, of r as a characteristic root of the equation and A is a constant.

5. A particular solution of U, = C ~ U , - ~ + . . - + c ~ u , , - ~ + andrn is of the form nml+mzrn (A, + Aln + . . . + Adnd) where ml 2 0 and m2 2 0 are the multiplicities of r and 1, respectively, as characteristic roots of the equation, and the Ais are constants.

6 . The methods of inspection and telescoping sums for solving linear recurrences with constant coefficients.

7. The methods of iteration and substitution for solving linear rccurrerlces with constant and non-constant coefficients.

.. 9.8 SOLUTIONS/ANS WERS

E l ) The characteristic equation is z = 3. So the charactcrisiic root is 3, with multiplicity 1. Therefore, the solution is a, = bC(O$n,0).3",b E C, i.e.,a, = b3=.

E2) The recursion u, + clu,-, + c2u,-, = 0 has the characteristic: equation z2 + CIZ + c2 = 0. We also know that the roots of this equation are 1 + i and 1 - i. Therefdre, from MTE-04 you know that cl cquals tho negativo or t h e sum of its characteristic roots, i.e., -2, and cz is the product ol' these roots, i.e., 2.

E3) The characteristic equation of the givkn recurrence is ~3 -z2 - Z + I = ( z- i)2(z +I ) = 0.

. - - - So, Pz = (an + b) + c(-l)?, n 2 0, for some constants a, b, c. The initial conditions are a + b -'c = 0, 2a + b + c = 1 ancl 3a + b - c = 1; Therefore,

E4) Statements: 1) If {an) and {b,) are two solution sequences of the non-homogeneous recurrence

un = f1(n)un-l + fi(n>un-z +. . . + fic(n)q,-k + g(n), (8) , then {c,) is a solution sequence of its associated homogeneous

recurrence, where c, = a, - b,.

2) Every solution of (8) is of the form a, + b,,, where a,, is a particular solution of (8) and b, is any solution of its associated horriogerleous recurrence

Un = fl(n)un-l + " ' +fk(n)un-k (9) The proofs are exactly on the lines of the proofs far thc 'consta.nt I.

L

coefficients'case'. . ' I .

Page 21: Solving Recurrences

E5) The characteristic root of the recurrence T, = 2T,-1 is z = 2. heref fore, the general solution of the homogeneous part is T, = a.2", n 2 1. The particular solution to the non-homogeneous part is T, = b, by Theorem 5. Plugging in this value of T, into the recurrence gives b = -1. Add'ing the solutions of the homogeneous and non-homogeneous parts, and using the initial condition T1 = I, we get T, = 2" - 1, n 2 1.

E6) Here an+2 - = 3(a,+, - a,) - 200, n 2 0, i.e., an+2 - 4an+, + 3an = -200.

The solution corresponding to the homogeneous part is a.3" + b(l)", i.e., a.3" + b, where a, b E C. Now, -200 = (-200) (I)", and 1 is a characteristic root. So, by Theorem 5, a particular solution is An, A a constant. Putting a, = An in the recurrence, we get A(n + 2) - 4A(n + 1) + 3An = -200 A = 100. :. a, = a.3, + b + 100n. With a. = 1000 and al = 1500 - 200 = 1300, we have a, = 100(3)" + 900 + loon, n > 0.

E7) The recurrence u, + C,U,-~ + c,u,-~ = 0 has the characteqktic equation a2 + cla + c2 = 0. From the given solution we see that its roots are 2 and 5. Therefore, cl = -(2 + 5) = -7 and c2 = 2 x 5 = 10. Now, setting the given particular solution u, = 3n - 5 in the given equation, we get ,4

(3n - 5) - 7(3n - 8) + lO(3n - 11) = an + b. heref fore, a = 12 and b = -59.

E8) The recurrence v, - 7vn-l + l 6 ~ , - ~ - l2v,-, = 0 has the characteristic equation z3 - 7z2 + 162 - 12 = 0, i.e., (z - 2)2(z - 3) = 0. SO, V, = (an+ b)2" +c.3", n 2 0, for some a,b,c. The paticular solution is of the form v, = An22" + Bn3n. Therefore, the recurrence reduces to

Solving this, wE.get A = -1, B = 9. Therefore, v, = (-n2 + a n + b)2" + (9n + c)3", n > 0. The initial conditions lead to the equations . b + c = 1,2(a + b - I) + 3 ( c + 9) = 0 and 4(2a+b - 4) + 9(c + 18) = 1. Solving these equations we get a = 7, b = 42 and c = -41. Therefore, v, = (-n2 + 7n + 42)211 + (9n - 41)3", n > 0.

E9) We know that 3 and -2 are the only characteristic roots with multiplicity 1 and 2, respectively. Therefore, the solution corresponding to the homogeneous part is . . A.3n + (Bn + C)(-2)".

j

The non-homogeneous part of the recurrence is

a.2" + bn(-l)n + (cn2 + dn + e), a, . , e are constants.

Therefore, the solution corresponding to this part is

D(2,) + (-l)"(Eo + E,n) + ~n~ + Gn + E.

The complete solution is the sum of the two solutions.

Solving Recurrences

Page 22: Solving Recurrences

1 Recurrences E10) Since the first few terms of the sequence are Q, 1,16,81, . . . , ii; is reasonable to guess that b, = n4 for n 2 0. Let's check this guess by induction. Now, this gucss is correct for n = 0 and n = 1. Let's assume that it is true for n - 1. Now

4 n = (n- 1)4 + (4n3 - 6n2 +4n - 1) for n 2 1. So, the principle of mathematical induction proves our guess.

E l l ) Summing both sides of the identity k

(j + I ) ~ " - jk+' = x C(k + 1, r)j1 from j = 1 t o j = n, we get the r=O

recurrence equation

r=O 111 particular, k = 4 gives

r=O

Therefore,

(2n)! 2(2n - 1) (2n - 'a! E12) Method 1: Since C(2n, n) z - = it follows

(n!)2 n [(n - 1)!]2' that C(2n, n) is a solution of the given recurrence.

n I1 n

I :I

Method 2: x, = xo fl xk/xk-, = xo 2(2k - l ) / k

I' k = l k=1 t % = xo2"[1.3.5...(2n - l)]/n! = xo (2n)!/(n!)2, n > 0. t

I ' E13) Let us apply the technique of Example 16. We can do;so, since I

I I , I n 3 # 0 V n 2 1 . '

I From Example 15 we know that the solution to the homogeneous part is

I 3 + un = uo (n!) . j ' I f , I

Suppose the solution of the given recurrence is

/ I , a, = SV,, where %vo = 1.

i 1 Then unvn = 3'

1; n un-lVn-l + (n!)2

i - - U*V,-~ + 1 1 1 * 1 1 * v, = vn-1 + -.- I u,, n! 1 f

Now applying telescoping sums, we get

j i , f i + ? :I 1 a ; Yn = v o +' (ei) :, , , "Uo k = l I I Then the solution of the recurrence is j',

?

68 11 IJ

Page 23: Solving Recurrences

Solving Recurrences

E15) Multiplying by n - 1 reduces this recurrence to n(n - l )xn - (n - l ) ( n - 2 ) ~ , - ~ = n - 1, n > 1. Substituting dn = n(n.- l )xn, we get dn - dnWl = n - l ,do = 0.

E16) For convenience, let us define Fo F2 - Fl = 0. r~ n

1 0 3 03

d) C LFk/ (6c-1 Fk+I 11 = ( ~~~1 - k=2 k=2 . = lim {(Fcl +F;l) - (F;' +F;:~)} = 2.

I1+ W 03 00

e) C (Fk-1 Fk+l)--l = { (6<-1 ~k 1-I - ( ~ k &+I )-I 1 k=2 k=2

= lirn { (F1 &)-I - (.T, Fn+l )-l } = 1. n+m

E17) Repea1;edly replacing n by n - 1, we get 1 1

Un = - + - n !

E18) By the iteration method, we have

Page 24: Solving Recurrences

Recurrences

E19) Rewriting the recurrence in the form ny, - (n - l ) ~ , - ~ = 1, suggests , the substitution x, = ny,, n 2 1. The recurrence then reduces to the

I form x, - x,-~ = 1, and telescopes to i

i xn - Xo = 1 5 (xk - x k - ~ ) = n. ! k= 1

I Therefore, x, = n and yn = 1 for n L. 1.

E20) n has to be of the form 2k for the recurrence to be valid. Now, lek us put t2k = uk in the recurrence. Then it reduces to

The solution of the homogeneous part is u, = A.3". The sBlution of the non-homogeneous part is u, = 13.2~" = B4". Putting this in the recurSence, we get B = 4. I

:. u, = A.3" + 4"$'. Now, using the initial condition, we get A = -2. :. u, = (-2)3" + 4nS1. ' I

:. t,, = (-2)3, + 2'("+').

E21) Let y, = G. Then, y, - 5 ~ , - ~ + 6 ~ , - ~ = 0 has the characteristic roots 2 and 3. So y, = a.2" + b.3", for some a, b. Since yo = 2 and yl = 5, a = 1 = b. Therefore, x, = y: = (2" + 3"12 for n 2 0.

E22) The term n! of the non-homogeneous part provides us with the hint that we should divide both sides by n!. If ye do, we get

5 yn -4yn-, = - x 3", n 2 2, with yo = l , y l = -1, where y, = x,/n!.

9 Since the homogeneous part of this has the characteristic polynomial z2 - 4 = 0, it follows that

Yn = a.2n+ b(-2), +c.3,, n 2 0 , for some a,b,c. t ' Inserting this value into the recurrence gives c = 1, while the initid

conditions give rise to a + b + c = a + b + 1 = 1 and 2a - 2b + 3c = 2a - 2b + 3 = -1, solving which we get a = 1, b = -1. Therefore, x, = 32" - (-2)" + 3n)n!1 n 2 0.

1 ' 1 E23) Write u, as a sum of its homogeneous solution, u,(~) , and particular solution, u,(P). Then, 1 u,(~) = a1.2"l + 3 .3, + (a3 + a4n)4n, ai E C 'd i.

!!! 1. i Since g(n) is of the form (A + ' ~ n ) 2 " + C.3" + (D + En)5", the form . that the particular solution takes is I I

4 70 up) = [A,n + (b, + b,n)n]2" + Con.3" + D0.5" + (E, + E1n)5l1

E A

Page 25: Solving Recurrences

= (Aln + ~ ~ n ~ ) 2 " + Con.3" + Do.Sn + (ED + Eln)5", where the capital ' Solving Recurrences letters are constants.

Therefore, un = uih) + up) .

E24) Let r,, r2 be the roots of the characteristic polynomial z2 + blz + b2 = 0. Then

airy + a2r; + crn if r l , r2, r are all distinct, (al + cn)ry + a2r5 if r = r l # r2, (a + bn)ry + crn if r l = r2 # r , (a + bn'+ cn2)rn if r l = r2 = r.

In any of these cases, the characteristic polynomial of the linear homogeneous recurrence with constant coefficients satisfied by {v,) has roots rl , r2 and r, not necessarily distinct. In other words, this polynomial is (z - r l ) (z - r,) (z - r)' = (z2 + blz + b2) (Z - r).

E25) Let z2 + alz + a2 = (z - a ) ( z - P). If a # p, x, = Aan + BPn and yn = Can + Dpn for some constants A,B,C,D and all n > 0. If a = p, x, = (A + Bn)an and y,, = (C + Dn)an for some constants A,B,C,D and all n > 0. a) So, if the roots are distinct,

xnyn = AC(a2)" + (AD + BC)(ap)" + B D ( ~ ~ ) " , n > 0. So, (xnyn) satisfies a third order linear homogeneous recukrence with constant coefficients and distinct cl~aracteristic roots a2, a@ and P2. More explicitly, the characteristic polynomial is (z- a2)(z'--@)(z - p2) = z3 - (a: - a2)z2 +a2(a: -a2)z - a:, and the recurrence relation is Vn - (a: - a2)vn-1 + a2(a: - a2)vn-2 - aivn-3 = 0. ,

If the roots are equal, xnyn = A C ( ~ ~ ) " + (AD + ~ C ) n ( a ~ ) " + ~ ~ n ~ ( c r ~ ) " , n 2 0. So {xnyn) again satisfies a third order linear holnogeneous recurrence with constant coefficients and the characteristic root a2 of multiplicity three. More explicitly, the characteristic polynomial is (z - a2)3 = z3 - 3a2z2 + 3a;z - a$, and the recurrence relation is V, - + 3a;vnd2 - = 0.

b) In this case, if the roots are distinct, x2,, = A(a2)" + ~ ( p ~ ) " , n 1 0, and {x2,) satisfies a second order linear homogeneous recurrence with constant coefficients and distinct ch+racteristic roots a2 and P2. More explicitly, the characteristic polynomial is (Z - cr2)(z - p2) = z2 - (a: - 2a2)z + a;, and the recurrence relation is W, - (a: - 2a2)wn-l + 2q$wn-2 = 0. If the roots are equal, xZn = (A + 2Bn)(a2)", n 2 0, and {x2,) again satisfies a second order linear hdmogeneous recurrence with constant coefficients and the cliaracteristic root a2 of maltiplicity two. ,

More explicitly, the characteristic polynomial is (z - 'a2)2 = z2 - 2a2z + a;, and the recurrence relation is

2 W, - 2 8 2 ~ n - 1 + a2Wn-2 = 0.

Page 26: Solving Recurrences

Recurrences E26) If the sequence {n!) is to satisfy a secorid order ho~nogeneous linear recurrence with constant coefficients, ils nth term must be of the form az$ + a,r; for some al, a2 provided rl # r2, or of the form (a + bn)*n for some a, b.

If r, # rz, lalri' + 5 Ialllrlln + lazllr21n 5 (1% 1 -t lazln)rn, where r = m=(lrll, Ir21). So, in either case, n! 5 (A + Bn)an, n 2 0 for some posilive A, B alld a, and this is a contradiction to our supposition.

Page 27: Solving Recurrences

REGIONWISE LIST OF SlTr)Y CENTRES FOR RSc. P R O G R W

SLVo. Centre CDde Centre A d d m

1. WYDERhBAD REGJON(Andhrn Pmdcnh) 1 0102 V R Cdlegr, NeUore-524 001. ,indhn Prr*r6 2 0103 lCBN College. Kothapn. Vljqawada-520 001. h d h n Rdesh 3 0111 Aorora'a DFgrea College, Hydcrnbd-500 020,

Andbn Prdub 2. C L W W T I R!ZGION(hsam. A r u d d P d a b B S i W ) 4 MI Guwahd U n ~ v c n ~ t y , Guwahau-T81 014, hum. 5 z: Bighorn Mnhavidl;alaya B c q p g m - 7 8 3 380. Guwab.cl 6 Hendique Cnrk Collcgc. Guaaban-781 100. A w m 7 Wry P! G m . Scienffi Coll~xe, JorhaI-705 01 0, Auam 8 0 1 1 1 Blyali Collcgc. Pahsda. P d h d a P 0 . Barpctn Dmnct-T8 1 325,

h m 9 01 1 6(D) h b m j Roy Colleqe; Gola@ P G. Golagha-785 62 I. h a r m 10 0119 Lakbimpur Gris College, 13lclman P . 0 , Sorth L-.X 931. bssm I I 2101 Sikk!m Gort CoUe& T d m g G m ~ k - : ; i 102. SlkPin 3. PATNA REGION (Bihar) 13 0501 Vamjye MahJvidyalay. Pama Unwtnir)., Pal3I-SOC X5. B l h r

p m a Science Collegc. Pam4 War). 13 0.2W B IcS. B h r LTni\mity LlBan, Z M m - p i - g i 2 IN! B b r f i C ~ Z o I l r p ~

X l d a r p u r , Dihmr). I4 050.2 b l m n r i CoUgcCT.bf.Bbngnlplr Cmvcrsltyj, Bhagdpur-8 I2 007. Blhar 1 0508 Purcna Coll~%c Purncb8SJM1. b r 16 05M Rqmdra CoUcge. C.%pr&Ul 301. Blbnr. 17 05 15R Bdika Vidyapsetb L&sw-811 31 1. Dllur. 18 0521 Sin& Collegc. P.O. Sindri-828 13: Dhanbad Blbmr. 19 0512. C ht College, Glaghrt. Darbbangk B h r 30 0 5 3 Bihar Nadrnd Collcgc. Patm-SW IXY. B l b r 21 05LT kIphila CoUcgc. Chdbmn, P.O. Cha~ba~a-833 201. Dm Kcst

S&bh= Wr 3 - - uj28D St. Columhm College, P 0 College M o q H m b a g h - 8 2 5 30 1 23 0529 Anuwah Narsyan College, B m g Road Pntn~-8lN 111: 4. DELI-II RECION(1) (South and W e d R q h , Guqmn. F a d d a b d and Matbun) 2-1 0707 M a c , J w n blilvlill~a Islarma I r m a Nqnr, New Delhi-l 10 025 Y 071 1 CTargi Colleg. Slri Forl Road, New Ikrm-110 019 3 . ;b 0715 . 4 c b q a Nnrcndrn Dev College. Wkajl. New Drlhl-l 10 019. 5. DELHl REGION(?) (Norih and East R q l o n I n c l ~ g .Urnrut, .Madinngar r n l Chrzhbmd DM- of U l b r P n k h ) 27 0 72 X Rhhsknrnchnryn CoUcgc of Appl~cd Sc~cnrp. Vccr Savarku Cornpleq husa

Ncw Delhl-110 012 ?B 0729 K a l ~ n d ~ College. East Pard Nags , Ken 1Zcihl- I10 %lX 29 27-13 Lajpat Rai (P.G.) l:ollcgc, Sdh1bnbad.2Ol OC5. L t ' r PndPsh 6. .UDIKII.-\HAD REGION (Cujnrmt, Oarnun R: Diu, h d m & Nuptr Havcli) 30 090 1 L.D. Arb Collcgs. IrI3vrangpurq h . . ednbd-380 &i9, GujanL 3 1 0902 General Education Buildin& h1.S. Un~;crsi&, Vad,d,ua-3W 002. GuJarat 32 (r31k; JD Thacker Commerce Collcy~,Dhuj-371) 001 ,Guja:lt (L.alw Collcgu.

l>I~uj, G u j n r ~ t j . 33 N/IIO Kcw rrog~cssivc I<ducali~ln 7'rus1, hlch;1n,1-384 lrc12, GuJarnl 1 1 2 ( I j Sl~rce Cintl~r ViJyslaya,PIt?I No 910, GUJC Estnte , rL~t l~shrv~ ,GuJnr~t 35 CrY2XiRj Naliorl:~l [n.;lit~~lc for kl;magen!cnt dnd InB1rm~ti~\nTcc~oloy)fi'L\11T)

C/o Paras Ad, Jan:i;itt3 Pras, Kajkor-5 36 200 1 Clo\l Arls Collegc. I>.unnn and DIU W.T. j-396 2 I O 7. KAKNrll. REGIIIS (llxrysnx nnd I'ur~J:rl)) 7 -l 1OOI hfutanntlld! Nationd Collega. Yynuna Sq~r.13.5 01 1 , F l u r y a n ~

IrlclS Chhuru R m Collcpc oCEducJlio& Rohuk-124 001, H~ryrnr (All I d i n Jat Hcnxs Mcmorial Collcge, Roh3k Hrqannj .

39 loox G a l . College (Guh Wing), Scctor-14, Ruln.ay R o d Kamnl-132 021, l l t l y n a

4n 1003 Clo\t PP.G College, Himar-13 001, H.QBN. 4 I Ill!? h l d a n d a Sation31 College, S M s b a 4 KuluLshctra ILr)ana 42 1013 Government P.G. College, Jind-126 102, )I#r)ma 43 2217l D A]'. College. Jnlaqdhiu. 1 4 W8, Punjab B. SlIL\fl.A REC20S(TUn~rcl1ul I'radoh and Chandiprh) 4-4 1101 Goven~mcnt B q i College, Sanjaul~ Sbynld-171 LY)6,

~ l i o u c b l Pnderh . 45 I 105 Gor-cmmcnl Collegr D h ~ u m h a l a - l 7 6 215, H h K h d P n d s b . 46 ! I i 3 Gar?. P G Collrgc* BBil=pur-17.1Wl. Hlmnch~l P m h h 47 I1 iS Gmt. Degree Collcgc, Rccong Pcm, Knmw D u r , H i d d P d n h 9. J . L U I U REGIOS(JLK) 48 1301 Cnivcnity of Jammu, Deputnml of hlanagmzmt %t%

lammu Tawi-180 001. Jk K. (Gmdhi bltmorial Science Collqe, J m u Taw, J&K).

49 1206 Go\% D e p x College, Wua, Jkli 50 1207 h t . Degree CoUegq Rajouri. J&l i 5 1 1 Zifl Govl. Degroc CoUegc, Pwncb. JkK. 52 1 5 P ) G d h hLmDnal Collcgc, Crmp R a w , B d a b . J~nmu-181 123, J&K 10 E A Y G U R P . R . E C I O . ~ L . d Ca) 53 08 02 Dbcmpc College a f h & Sciencq P.O. Bm S0.22 Panlim.

C . m 4 3 001 5-4 ljU3 I S.S. CoUcgc I>hmwd-580DOJ, K a n n h h 55 1320 k t . Se icna College, Rod, B+mSGO MI, K u n r b h 11. C I X l E i RECIO.S(licrrl. d ~.hh&wp) -% 1401 of- in Goy V U U Bbrv+n. M a r a ~ l a ~ k 6 - 6 9 5 033.

K r t l b (L'niWrty CoUcge. W a K d a i 57 1 u 1 3 J.D.T. Islam. C W 4 l 3 018. Kmk. ES I A i l Caiholicate Calkgc, P 1 L t a n a m ~ l d g e M5, Krrda i ,) -. 1 ~:!5 S'hi Xarcyan CoJtgc. ljonu4X OCr7 .- ', 11:: St. &'ceca Cdle$c. Emakul?mlSjb: 01 S, R c n b .