next up previous
Next: About this document

 COS 341, October 15, 1997

Handout Number 11

Solving Recurrence with Generating Functions

The first problem is to solve the recurrence relation system tex2html_wrap_inline257 , and tex2html_wrap_inline259 for tex2html_wrap_inline261 .

Let tex2html_wrap_inline263 . Multiply both side of the recurrence by tex2html_wrap_inline265 and sum over tex2html_wrap_inline261 . This gives

displaymath237

Note that

eqnarray58

Thus, in term of A(x), we obtain

displaymath238

Rearranging terms, we get

displaymath239

Hence,

eqnarray69

We can now get tex2html_wrap_inline271 by expanding A(x) as a series

displaymath240

This gives, for all tex2html_wrap_inline275 ,

eqnarray76

This is the same answer as we obtained earlier by different means.

The next problem for solution is the Rabbit Island problem. Before studying it, let us note the following identity, valid for any distinct numbers b and c:

equation84

It can be directly verified by taking common denominators of the terms on the right-hand-side, and simplyfing the expression. A more systematic way to do this is to solve the system of equations for variables tex2html_wrap_inline281 ,

displaymath241

The solution satisfyies the equation

displaymath242

and gives

eqnarray90

This is a special case of the partial fraction decomposition. You might find it challenging to extend the discussion to show that, if b,c,d are distinct,

displaymath243

with sosme appropriate choice of tex2html_wrap_inline285 .

In the Rabbit Island problem, we need to solve the recurrence tex2html_wrap_inline287 , and tex2html_wrap_inline289 for tex2html_wrap_inline291 . Let tex2html_wrap_inline263 . As in the previous problem, let us multiply the recurrence by tex2html_wrap_inline295 and sum over tex2html_wrap_inline291 . This gives

displaymath244

In terms of A(x), we have tex2html_wrap_inline301 . This leads to

equation111

It remains to expand A(x) into a power series, so that we can identify tex2html_wrap_inline271 .

Now note that

eqnarray114

where tex2html_wrap_inline307 and tex2html_wrap_inline309 . Using (1) and (2), we can expand A(x) as

eqnarray124

Thus, for all tex2html_wrap_inline275 , we have

displaymath245

For n=0,1, this formula gives tex2html_wrap_inline257 , tex2html_wrap_inline319 , as was to be expected.

The numbers tex2html_wrap_inline271 are called Fibonacci numbers, and often denoted by tex2html_wrap_inline323 . Note that tex2html_wrap_inline325 and tex2html_wrap_inline327 . Thus, tex2html_wrap_inline329 is numerically a very small number, while tex2html_wrap_inline331 is large. For reasonably large n, say n>10, tex2html_wrap_inline323 can be obtained by evaluating tex2html_wrap_inline339 , and rounding it to the closest integer.

The third problem we tackle is the recurrence tex2html_wrap_inline341 , tex2html_wrap_inline319 , and tex2html_wrap_inline345 for tex2html_wrap_inline291 . The quantity tex2html_wrap_inline271 is the number of ways to parenthesize an expression tex2html_wrap_inline351 .

Let tex2html_wrap_inline353 . The recurrence relation gives

eqnarray154

This means tex2html_wrap_inline355 , and hence tex2html_wrap_inline357 . Solving the quadratic equation for A(x), we obtain two possible solutions: tex2html_wrap_inline361 and tex2html_wrap_inline363 . The former solution can be discarded, since it would give tex2html_wrap_inline365 , which contradicts our assumption tex2html_wrap_inline341 . Thus,

eqnarray165

We infer from it tex2html_wrap_inline341 , and for tex2html_wrap_inline261 ,

displaymath246

Note that, for tex2html_wrap_inline291

eqnarray177

This leads to

eqnarray205

for tex2html_wrap_inline291 . The above formula also holds for n=1 since both sides are equal to 1. (Recall tex2html_wrap_inline381 .) The numbers tex2html_wrap_inline271 are often called the Catalan numbers.




next up previous
Next: About this document

Andrew Yao
Sat Oct 11 17:32:57 EDT 1997