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.

432 ASYMPTOTICS<br />

subtle consideration lurks in the background. Namely, we need to realize that<br />

it’s fine to write<br />

in3 + in2 + An = O(n3),<br />

but we should neueT write this equality with the sides reversed. Otherwise<br />

we could deduce ridiculous things like n = n2 from the identities n = 0 (n2)<br />

and n2 = O(n2). When we work with O-notation and any other <strong>for</strong>mulas<br />

that involve imprecisely specified quantities, we are dealing with one-way<br />

equalities. The right side of an equation does not give more in<strong>for</strong>mation than<br />

the left side, and it may give less; the right is a “crudification” of the left.<br />

From a strictly <strong>for</strong>mal point of view, the notation 0( g(n)) does not<br />

stand <strong>for</strong> a single function -f(n), but <strong>for</strong> the set of all functions f(n) such<br />

that If(n)1 6 Clg(n)l <strong>for</strong> some constant C. An ordinary <strong>for</strong>mula g(n) that<br />

doesn’t involve O-notation stands <strong>for</strong> the set containing a single function<br />

f(n) = g(n). If S and T are sets of functions of n, the notation S + T stands<br />

<strong>for</strong> the set of all functions of the <strong>for</strong>m f(n) + g(n), where f(n) E S and<br />

g(n) E T; other notations like S-T, ST, S/T, &, es, In S are defined similarly.<br />

Then an “equation” between such sets of functions is, strictly speaking, a set<br />

inclusion; the ‘=’ sign reall:y means ‘g’. These <strong>for</strong>mal definitions put all of<br />

our 0 manipulations on firm logical ground.<br />

For example, the “equation”<br />

in3 + O(n’) = O(n3)<br />

means that S1 & S2, where S-I is the set of all functions of the <strong>for</strong>m in3+f1 (n)<br />

such that there exists a constant Cl with If,(n)/ 6 Clln’I, and where S2<br />

is the set of all functions f.!(n) such that there exists a constant CJ with<br />

Ifz(n)l 6 C21n31. we can <strong>for</strong>mally prove this “equation” by taking an arbitrary<br />

element of the left-hand side and showing that it belongs to the righthand<br />

side: Given in3 + fl In) such that If,(n)1 < C11n21, we must prove<br />

that there’s a constant Cl such that l$n3 + fl (n)l 6 C21n31. The constant<br />

Cl = 3 + Cl does the trick, Isince n2 6 In31 <strong>for</strong> all integers n.<br />

If ‘=’ really means ‘C’, why don’t we use ‘c’ instead of abusing the equals<br />

sign? There are four reasons.<br />

First, tradition. Number theorists started using the equals sign with Onotation<br />

and the practice stuck. It’s sufficiently well established by now that<br />

we cannot hope to get the mathematical community to change.<br />

Second, tradition. Computer people are quite used to seeing equals signs<br />

abused- <strong>for</strong> years FORTRAN and BASIC programmers have been writing<br />

assignment statements like “N = N + 1’. One more abuse isn’t much.<br />

Third, tradition. We often read ‘=’ as the word ‘is’. For instance we<br />

verbalize the <strong>for</strong>mula H, = O(log n) by saying “H sub n is Big Oh of log n!’<br />

“And to auoide the<br />

tediouse repetition<br />

of these woordes:<br />

is equal/e to: I will<br />

sette as I doe often<br />

in woorke use, a<br />

paire of paralleles,<br />

or Gemowe lines of<br />

one lengthe, thus:<br />

= , bicause<br />

noe .2. thynges, can<br />

be moare equal/e.”<br />

-R. Recorde 12461

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

Saved successfully!

Ooh no, something went wrong!