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.

316 GENERATING FUNCTIONS<br />

determine all the necessary coefficients:<br />

n 0 5 10 15 20 25 30 35 40 45 50<br />

P, 1 1 1 1 1 1 1 1 1 1 1<br />

NTI 12345 6 7 8 9 10 11<br />

D, 12 4 6 9 1216 25 36<br />

Qn 1 13 49<br />

G 1 50<br />

The final value in the table gives us our answer, COO: There are exactly 50 ways<br />

to leave a 50-cent tip. (Not counting the<br />

How about a closed <strong>for</strong>m <strong>for</strong> C,? Multiplying the equations together<br />

gives us the compact expression<br />

Option ofchar@ng<br />

1 1 1 1 1<br />

c = ----~~<br />

1 --z 1 --5 1 -zz~o 1 -z25 1 -z50 1 (7.11)<br />

but it’s not obvious how to get from here to the coefficient of zn. Fortunately<br />

there is a way; we’ll return to this problem later in the chapter.<br />

More elegant <strong>for</strong>mulas arise if we consider the problem of giving change<br />

when we live in a land that mints coins of every positive integer denomination<br />

(0, 0, 0, . . . ) instead of just the five we allowed be<strong>for</strong>e. The corresponding<br />

generating function is an infinite product of fractions,<br />

1<br />

(1 -z)(l -22)(1 -23)..1'<br />

and the coefficient of 2” when these factors are fully multiplied out is called<br />

p(n), the number of partitions of n. A partition of n is a representation of n<br />

as a sum of positive integers, disregarding order. For example, there are seven<br />

different partitions of 5, namely<br />

5=4+1=3+2=3+11-1=2+2+1=2+1+1+1=1+1+1+1+1;<br />

hence p(5) = 7. (Also p(2) =: 2, p(3) = 3, p(4) = 5, and p(6) = 11; it begins<br />

to look as if p(n) is always a prime number. But p( 7) = 15, spoiling the<br />

pattern.) There is no closed <strong>for</strong>m <strong>for</strong> p(n), but the theory of partitions is a<br />

fascinating branch of <strong>mathematics</strong> in which many remarkable discoveries have<br />

been made. For example, Ramanujan proved that p(5n + 4) E 0 (mod 5),<br />

p(7n + 5) s 0 (mod 7), and p(1 In + 6) E 0 (mod 1 l), by making ingenious<br />

trans<strong>for</strong>mations of generating functions (see Andrews [ll, Chapter lo]).<br />

the tip to a credit<br />

card.)

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

Saved successfully!

Ooh no, something went wrong!