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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

322 GENERATING FUNCTIONS<br />

middle of Table 321, and it’s also the special case m = 1 of (1, (","), (mzL),<br />

(“,‘“), ), which appears further down; it’s also the special case c = 2 of<br />

the closely related sequence (1, c, (‘:‘) I (‘12), . ). We can derive it from the<br />

generating function <strong>for</strong> (1 , 1 , 1 , 1, . . ) by taking cumulative sums as in (7.21);<br />

that is, by dividing 1 /(l-z) by (1 -z). Or we can derive it from (1 , 1 , 1 , 1, . ) OK, OK, I’m conby<br />

differentiation, using vinced already<br />

(7.17).<br />

The sequence (1 , 0, 1 , 0, . ) is another one whose generating function can<br />

be obtained in many ways. We can obviously derive the <strong>for</strong>mula 1, zZn =<br />

l/( 1 - z2) by substituting z2 <strong>for</strong> z in the identity t, Z” = l/( 1 - z); we can<br />

also apply cumulative summation to the sequence (1, -1 , 1, -1, . . . ), whose<br />

generating function is l/(1 $ z), getting l/(1 +z)(l - z) = l/(1 -2’). And<br />

there’s also a third way, which is based on a general method <strong>for</strong> extracting<br />

the even-numbered terms (gc , 0, g2, 0, g4,0, . . . ) of any given sequence: If we<br />

add G(-z) to G(+z) we get<br />

there<strong>for</strong>e<br />

G(Z)+ G(-z) = t gn(l +(-1)")~" = 2x g,[n evenlz”;<br />

n n<br />

G(z) + G(-z)<br />

2<br />

= t g2n zLn .<br />

n<br />

The odd-numbered terms can be extracted in a similar way,<br />

G(z) - G(-z)<br />

2<br />

=t g2n+1zZn+'<br />

n<br />

(7.22)<br />

In the special case where g,, =I 1 and G(z) = l/( 1 -z), the generating function<br />

<strong>for</strong>(1,0,1,0,...)is~(~(z)+~(-z))=t(&+&)=A.<br />

Let’s try this extraction trick on the generating function <strong>for</strong> Fibonacci<br />

numbers. We know that I., F,zn = z/( 1 - z - 2'); hence<br />

t F2nz 2n = ;(j57+l+r’,)<br />

n<br />

1 ( 2 + 22 - 23 - 2 + z2 + z3 ) z2<br />

=-<br />

2 (I -z2)2-22 = l-322+24<br />

This generates the sequence (Fo, 0, F2,0, F4,. . . ); hence the sequence of alternate<br />

F’s, (Fo,Fl,Fd,F6,...) = (0,1,3,8,... ), has a simple generating function:<br />

F2,,zn =<br />

IL<br />

n<br />

z<br />

l-3z+z2<br />

(7.24)

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

Saved successfully!

Ooh no, something went wrong!