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.2 BASIC MANEUVERS 319<br />

Replacing the z by a constant multiple is another of our tricks:<br />

G(u) = t ~,(cz)~ = xcngnz”; (7.16)<br />

n n<br />

this yields the generating function <strong>for</strong> the sequence (c”g,). The special case<br />

c = -1 is particularly useful.<br />

I fear d genera ting- Often we want to bring down a factor of n into the coefficient. Differenfunction<br />

dz 3. tiation is what lets us ‘do that:<br />

G’(z) = gl +2g2z+3g3z2+- = t(n+l)g,+,z". (7.17)<br />

n<br />

Shifting this right one place gives us a <strong>for</strong>m that’s sometimes more useful,<br />

zG’(z) = tng,,z”<br />

n<br />

(7.18)<br />

This is the generating function <strong>for</strong> the sequence (ng,). Repeated differentiation<br />

would allow us to multiply g,, by any desired polynomial in n.<br />

Integration, the inverse operation, lets us divide the terms by n:<br />

J L G(t)dt = gez+ fg,z2 + ;g2z3 +... = x 1 p-d. (7.19)<br />

0 TI>l<br />

(Notice that the constant term is zero.) If we want the generating function<br />

<strong>for</strong> (g,/n) instead of (g+l/n), we should first shift left one place, replacing<br />

G(t) by (G(t) - gc)/t in the integral.<br />

Finally, here’s how we multiply generating functions together:<br />

F(z)G(z) =<br />

=<br />

(fo+f,z+f2z2+~-)(go+g1z+g2z2+-~)<br />

(fogo) + (fog1 +f1!Ilo)z + (fog2 +f1g1 +f2go)z2 + ...<br />

~(-pk&k)ZTI. (7.20)<br />

TL k<br />

As we observed in Chapter 5, this gives the generating function <strong>for</strong> the sequence<br />

(hn), the convolution of (fn) and (gn). The sum hn = tk fk&-k can<br />

also be written h, = ~~=, fkgnpkr because fk = 0 when k < 0 and gn-k = 0<br />

when k > n. Multiplication/convolution is a little more complicated than<br />

the other operations, but it’s very useful-so useful that we will spend all of<br />

Section 7.5 below looking at examples of it.<br />

Multiplication has several special cases that are worth considering as<br />

operations in themselves. We’ve already seen one of these: When F(z) = z”’<br />

we get the shifting operation (7.14). In that case the sum h,, becomes the<br />

single term gnPm, because all fk's ue 0 except <strong>for</strong> fm = 1.

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

Saved successfully!

Ooh no, something went wrong!