09.12.2012 Views

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.3 SOLVING RECURRENCES 327<br />

When Q(z) has repeated roots, the calculations become more difficult,<br />

but we can beef up the proof of the theorem and prove the following more<br />

general result:<br />

General Expansion Theorem <strong>for</strong> Rational Generating Functions.<br />

If R(z) = P(t)/Q(z), where Q(z) = qo(1 - ~12)~' . ..(l - p~z)~[ and the<br />

numbers (PI,. . , pi) are distinct, and if P(z) is a polynomial of degree less<br />

than dl + . . . + dl, then<br />

[z"] R(z) = f,ln)p; + ... + ft(n)p; <strong>for</strong> all n 3 0, (7.30)<br />

where each fk(n) is a polynomial of degree dk - 1 with leading coefficient<br />

This can be proved by induction on max(dl , . . . , dl), using the fact that<br />

al(dl -l)! al(dl - l)!<br />

R(z) - (1py - . . . -<br />

(1 - WldL<br />

(7.31)<br />

is a rational function whose denominator polynomial is not divisible by<br />

(1 - pkz)dk <strong>for</strong> any k.<br />

Example 2: A more-or-less random recurrence.<br />

Now that we’ve seen some general methods, we’re ready to tackle new<br />

problems. Let’s try to find a closed <strong>for</strong>m <strong>for</strong> the recurrence<br />

go = g1 = 1 ;<br />

Sn = gn-l+2g,~~+(-l)~, <strong>for</strong> n 3 2. (7.32)<br />

It’s always a good idea to make a table of small cases first, and the recurrence<br />

lets us do that easily:<br />

No closed <strong>for</strong>m is evident, and this sequence isn’t even listed in Sloane’s<br />

Handbook [270]; so we need to go through the four-step process if we want<br />

to discover the solution.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!