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.

332 GENERATING FUNCTIONS<br />

Finally, since l/(1 -z")~ = xkao (k14)~'0k, we can determine the coefficient<br />

of C, = [z”] C(z) as follows, when n = 1 Oq + r and 0 6 r < 10:<br />

c lOq+r = ~Aj(k:4)[10q+r=10k+jl<br />

= A:(‘:“) + A,+Io(‘;~) + A,+zo(~;‘) + A,+~o(‘;‘) . (7.40)<br />

This gives ten cases, one <strong>for</strong> each value of r; but it’s a pretty good closed<br />

<strong>for</strong>m, compared with alterrratives that involve powers of complex numbers.<br />

For example, we can u,se this expression to deduce the value of C50q =<br />

Clog. Then r = 0 and we have<br />

c50q = ("k") +45(q;3)+52(4;2) +2(“3<br />

The number of ways to change 50# is (i) +45(t) = 50; the number of ways<br />

to change $1 is ($) +45(i) -t 52(i) = 292; and the number of ways to change<br />

$l,OOO,OOO is<br />

= 66666793333412666685000001.<br />

Example 5: A divergent series.<br />

Now let’s try to get a closed <strong>for</strong>m <strong>for</strong> the numbers gn defined by<br />

40 = 1;<br />

9 n = ngv1, <strong>for</strong> 11 > 0.<br />

After staring at this <strong>for</strong> a Sew nanoseconds we realize that g,, is just n!; in Nowadayspeofact,<br />

the method of summation factors described in Chapter 2 suggests this ~~~~‘e~c~~~<br />

answer immediately. But let’s try to solve the recurrence with generating ~<br />

functions, just to see what happens. (A powerful technique should be able to<br />

handle easy recurrences like this, as well as others that have answers we can’t<br />

guess so easily.)<br />

The equation<br />

9 n= ngn-1 + [n=Ol<br />

holds <strong>for</strong> all n, and it leads to<br />

G(z) = xgnz” = ~ng,-rz”+~z’.<br />

n n n=O<br />

To complete Step 2, we want to express t, ng, 1 2” in terms of G(z), and the<br />

basic maneuvers in Table 320 suggest that the derivative G’(z) = t, ngnzn ’

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

Saved successfully!

Ooh no, something went wrong!