06.03.2017 Views

Mathematics for Computer Science

e9ck2Ar

e9ck2Ar

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.

“mcs” — 2017/3/3 — 11:21 — page 567 — #575<br />

14.5. Products 567<br />

We can then apply our summing tools to find a closed <strong>for</strong>m (or approximate closed<br />

<strong>for</strong>m) <strong>for</strong> ln.P / and then exponentiate at the end to undo the logarithm.<br />

For example, let’s see how this works <strong>for</strong> the factorial function nŠ. We start by<br />

taking the logarithm:<br />

ln.nŠ/ D ln.1 2 3 .n 1/ n/<br />

D ln.1/ C ln.2/ C ln.3/ C C ln.n<br />

nX<br />

D ln.i/:<br />

iD1<br />

1/ C ln.n/<br />

Un<strong>for</strong>tunately, no closed <strong>for</strong>m <strong>for</strong> this sum is known. However, we can apply<br />

Theorem 14.3.2 to find good closed-<strong>for</strong>m bounds on the sum. To do this, we first<br />

compute<br />

Z n<br />

1<br />

ln.x/ dx D x ln.x/<br />

Plugging into Theorem 14.3.2, this means that<br />

ˇ<br />

x<br />

ˇn<br />

1<br />

D n ln.n/ n C 1:<br />

n ln.n/<br />

Exponentiating then gives<br />

n C 1 <br />

nX<br />

ln.i/ n ln.n/<br />

iD1<br />

n C 1 C ln.n/:<br />

This means that nŠ is within a factor of n of n n =e n 1 .<br />

14.5.1 Stirling’s Formula<br />

n n<br />

nnC1<br />

nŠ <br />

en 1 e n 1 : (14.23)<br />

The most commonly used product in discrete mathematics is probably nŠ, and<br />

mathematicians have workedto find tight closed-<strong>for</strong>m bounds on its value. The<br />

most useful bounds are given in Theorem 14.5.1.<br />

Theorem 14.5.1 (Stirling’s Formula). For all n 1,<br />

nŠ D p n<br />

n<br />

2n e<br />

.n/<br />

e<br />

where<br />

1<br />

12n C 1 .n/ 1<br />

12n :

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

Saved successfully!

Ooh no, something went wrong!