06.03.2017 Views

Mathematics for Computer Science

e9ck2Ar

e9ck2Ar

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

“mcs” — 2017/3/3 — 11:21 — page 558 — #566<br />

558<br />

Chapter 14<br />

Sums and Asymptotics<br />

f.n/<br />

f.n1/<br />

<br />

f.x/<br />

<br />

f.3/<br />

f.2/<br />

f.1/<br />

0 1 2 3 n2 n1 n<br />

Figure 14.2 The shaded area under the curve of f .x/ from 1 to n (shown in bold)<br />

is I D R n<br />

1<br />

f .x/ dx.<br />

Comparing the shaded regions in Figures 14.1 and 14.2 shows that S is at least<br />

I plus the area of the leftmost rectangle. Hence,<br />

S I C f .1/ (14.17)<br />

This is the lower bound <strong>for</strong> S given in (14.16).<br />

To derive the upper bound <strong>for</strong> S given in (14.16), we shift the curve of f .x/<br />

from 1 to n one unit to the left as shown in Figure 14.3.<br />

Comparing the shaded regions in Figures 14.1 and 14.3 shows that S is at most<br />

I plus the area of the rightmost rectangle. That is,<br />

S I C f .n/;<br />

which is the upper bound <strong>for</strong> S given in (14.16).<br />

The very similar argument <strong>for</strong> the weakly decreasing case is left to Problem 14.10.<br />

<br />

Theorem 14.3.2 provides good bounds <strong>for</strong> most sums. At worst, the bounds will<br />

be off by the largest term in the sum. For example, we can use Theorem 14.3.2 to<br />

bound the sum<br />

nX p<br />

S D i<br />

as follows.<br />

iD1

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

Saved successfully!

Ooh no, something went wrong!