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.

7.1 DOMINO THEORY AND CHANGE 315<br />

How many pennies Obviously P, = 1 <strong>for</strong> all n 3 0. And a little thought proves that we have<br />

are there, really? N, = Ln/5J + 1: To make n cents out of pennies and nickels, we must choose<br />

If n is greater<br />

than, say,<br />

either 0 or 1 or . . . or Ln/5] nickels, after which there’s only one way to supply<br />

10”)<br />

I bet that P, = 0 the requisite number of pennies. Thus P, and N, are simple; but the values<br />

in the “real world.” of Dn, Qn, and C, are increasingly more complicated.<br />

One way to deal with these <strong>for</strong>mulas is to realize that 1 + zm + 2’“’ +. . .<br />

is just l/(1 - 2”‘). Thus we can write<br />

P = l/(1 -2’1,<br />

N = P/(1 -i’),<br />

D = N/(1 - 2”) ,<br />

Q = D/(1 - zz5) ,<br />

C = Q/(1 -2”).<br />

Multiplying by the denominators, we have<br />

(l-z)P = 1,<br />

(1 -z5)N = P,<br />

(l-z”)D = N,<br />

(~-z~~)Q = D,<br />

(1-z5’)C = Q.<br />

Now we can equate coefficients of 2” in these equations, getting recurrence<br />

relations from which the desired coefficients can quickly be computed:<br />

P, = P,-I + [n=O] ,<br />

N, = N-5 + P,,<br />

D, = Dn-IO -tN,,<br />

Qn = Qn-25 -t D,,<br />

Cn = G-50 + Qn.<br />

For example, the coefficient of Z” in D = (1 - z~~)Q is equal to Q,, - Qnp25;<br />

so we must have Qll - Qnp25 = D,, as claimed.<br />

We could unfold these recurrences and find, <strong>for</strong> example, that Qn =<br />

D,+D,-zs+Dn~5o+Dn~75+..., stopping when the subscripts get negative.<br />

But the non-iterated <strong>for</strong>m is convenient because each coefficient is computed<br />

with just one addition, as in Pascal’s triangle.<br />

Let’s use the recurrences to find Csc. First, Cso = CO + Q50; so we want<br />

to know Qso. Then Q50 = Q25 + D50, and Q25 = QO + D25; so we also want<br />

to know D50 and 1125. These D, depend in turn on DUO, DUO, DUO, D15,<br />

DIO, D5, and on NSO, NC,, . . . , Ns. A simple calculation there<strong>for</strong>e suffices to

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

Saved successfully!

Ooh no, something went wrong!