You are on page 1of 10

Techniques for Order Notation

Suppose that f (n) > 0 and g (n) > 0 for all n n0 . Suppose that
f (n)
.
n g (n)

L = lim
Then

o(g (n))
f (n) (g (n))

(g (n))

if L = 0
if 0 < L <
if L = .

The required limit can often be computed using lH


opitals rule. Note that
this result gives sucient (but not necessary) conditions for the stated
conclusions to hold.

Lebreton (SCS, UW)

CS240 - Module 1

Spring 2014

32 / 48

An Example
Compare the growth rates of log n and ni (where i > 0 is a real number).

Lebreton (SCS, UW)

CS240 - Module 1

Spring 2014

33 / 48

Example
Prove that n(2 + sin n/2) is (n). Note that limn (2 + sin n/2) does
not exist.

Lebreton (SCS, UW)

CS240 - Module 1

Spring 2014

34 / 48

Example
Prove that n(2 + sin n/2) is (n). Note that limn (2 + sin n/2) does
not exist.

60

40

20

0
0

10

15

20

25

Lebreton (SCS, UW)

CS240 - Module 1

Spring 2014

34 / 48

Relationships between Order Notations

f (n) (g (n)) g (n) (f (n))


f (n) O(g (n)) g (n) (f (n))
f (n) o(g (n)) g (n) (f (n))

f (n) (g (n)) f (n) O(g (n)) and f (n) (g (n))


f (n) o(g (n)) f (n) O(g (n))
f (n) o(g (n)) f (n) & (g (n))

f (n) (g (n)) f (n) (g (n))

f (n) (g (n)) f (n) & O(g (n))

Lebreton (SCS, UW)

CS240 - Module 1

Spring 2014

35 / 48

Algebra of Order Notations

Maximum rules: Suppose that f (n) > 0 and g (n) > 0 for all n n0 .
Then:
O(f (n) + g (n)) = O(max{f (n), g (n)})
(f (n) + g (n)) = (max{f (n), g (n)})
(f (n) + g (n)) = (max{f (n), g (n)})
Transitivity: If f (n) O(g (n)) and g (n) O(h(n)) then f (n) O(h(n)).

Lebreton (SCS, UW)

CS240 - Module 1

Spring 2014

36 / 48

You might also like