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.

9.3 0 MANIPULATION 449<br />

This preliminary analysis indicates that we’ll find it advantageous to<br />

write<br />

‘(n) = ;fP(k((;) +0(1))2 = ;fp(k)((;)2+o(;))<br />

k=l k=l<br />

= ;&‘i(;)l+fo(;)<br />

k=l k=l<br />

= ifIdk)(E)l + O(nlogn)<br />

This removes the floors; the remaining problem is to evaluate the unfloored<br />

sum 5 x.L, p(k)n2,/k2 with an accuracy of O(nlogn); in other words, we<br />

want to evaluate ,Fi’=, p(k)l/k’ with an accuracy of O(n-’ logn). But that’s<br />

easy; we can simply run the sum all the way up to k = cq because the newly<br />

added terms are<br />

k>n T<br />

= O(g2) = O(&x.&)<br />

k>n<br />

= O (kJA -t,) = o(A).<br />

We proved in (7.88) that tk>, F(k)/k’ = l/, k(k)/k’ =<br />

1 /k2) = 6/7r2, and we have our answer:<br />

‘/(tk>l<br />

CD(n) = $n2 + O(nlogn). (9.56)<br />

9.4 TWO ASYMPTOTIC TRICKS<br />

Now that we have some facility with 0 manipulations, let’s look at<br />

what we’ve done from a slightly higher perspective. Then we’ll have some<br />

important weapons in our asymptotic arsenal, when we need to do battle<br />

with tougher problems.<br />

nick 1: Boots trapping.<br />

When we estimated the nth prime P, in Problem 3 of Section 9.3, we<br />

solved an asymptotic recurrence of the <strong>for</strong>m<br />

P, = nlnP,(l + O(l/logn)) .<br />

We proved that P, = nln n + O(n) by first using the recurrence to show<br />

the weaker result O(n2). This is a special case of a general method called<br />

bootstrapping, in which we solve a recurrence asymptotically by starting with<br />

k=l

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

Saved successfully!

Ooh no, something went wrong!