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.

You are the fairest<br />

of your sex,<br />

Let me be your<br />

hero;<br />

I love you as<br />

one over x,<br />

As x approaches<br />

zero.<br />

Positively.<br />

9.2 0 NOTATION 431<br />

But wait a minute. What if the variable n isn’t an integer? What if we<br />

have a <strong>for</strong>mula like S(x) = $x3 + ix2 + ix, where x is a real number? Then we<br />

cannot say that S(x) = 0(x3), because the ratio S(x)/x3 = 3 + ix-’ + ix 2<br />

becomes unbounded when x + 0. And we cannot say that S(x) = O(x),<br />

because the ratio S(x)/x = $x2 + ix + i becomes unbounded when x t 00.<br />

So we apparently can’t use O-notation with S(x).<br />

The answer to this dilemma is that variables used with 0 are generally<br />

subject to side conditions. For example, if we stipulate that 1x1 3 1, or that<br />

x 3 c where E is any positive constant, or that x is an integer, then we can<br />

write S(x) = 0(x3). If we stipulate that 1x1 6 1, or that 1x1 6 c where c is<br />

any positive constant, then we can write S(x) = O(x). The O-notation is<br />

governed by its environment, by constraints on the variables involved.<br />

These constraints are often specified by a limiting relation. For example,<br />

we might say that<br />

f(n) = O(s(n)) as n-3 03. (9.13)<br />

This means that the O-condition is supposed to hold when n is “near” co;<br />

we don’t care what happens unless n is quite large. Moreover, we don’t<br />

even specify exactly what “near” means; in such cases each appearance of 0<br />

implicitly asserts the existence of two constants C and no, such that<br />

(f(n)1 6 Clg(n)l whenever n > no. (9.14)<br />

The values of C and no might be different <strong>for</strong> each 0, but they do not depend<br />

on n. Similarly, the notation<br />

f(x) = qdxl) asx+O<br />

means that there exist two constants C and c such that<br />

(f(x)/ 6 Clg(xl( whenever 1x1 6 E. (9.15)<br />

The limiting value does not have to be co or 0; we can write<br />

lnz = z-l+O((z-1)2) as 2 -3 1,<br />

because it can be proved that Ilnz-z+l/ 6 /z- 112 when lz- 11 6 5.<br />

Our definition of 0 has gradually developed, over a few pages, from something<br />

that seemed pretty obvious to something that seems rather complex; we<br />

now have 0 representing an undefined function and either one or two unspecified<br />

constants, depending on the environment. This may seem complicated<br />

enough <strong>for</strong> any reasonable notation, but it’s still not the whole story! Another

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

Saved successfully!

Ooh no, something went wrong!