next up previous
Next: About this document

Introduction to Asymptotic Notation
Dr. Russ Miller
December 30, 1996

We use tex2html_wrap_inline155 to mean `order exactly', O to mean `order at most', and tex2html_wrap_inline157 to mean `order at least'.

Definition of tex2html_wrap_inline155: Given nonnegative functions f and g defined on the positive integers, we write tex2html_wrap_inline165 if and only if there are positive constants tex2html_wrap_inline167, tex2html_wrap_inline169, and a positive integer N such that tex2html_wrap_inline173, whenever n>N.

Definition of O: Given nonnegative functions f and g defined on the positive integers, we write f=O(g) if and only if there is a positive constant C and an integer N such that tex2html_wrap_inline189, for all n>N.

Definition of tex2html_wrap_inline157: Given nonnegative functions f and g defined on the positive integers, we write tex2html_wrap_inline199 if and only if there is a positive constant C and an integer N such that tex2html_wrap_inline205, for all n>N.

When using order notation, one wants to use the simplest function possible within the tex2html_wrap_inline155, O, or tex2html_wrap_inline157. The idea is to use the notation to reduce complicated functions to simpler ones whose behavior is easier to understand.

Proposition 1: Suppose f and g are positive functions defined on the positive integers, and that tex2html_wrap145, for some nonzero a. Then tex2html_wrap_inline165.

Proof: tex2html_wrap145 means that for any c>0 there is an integer N such that tex2html_wrap_inline225, for all tex2html_wrap_inline227. If we chose tex2html_wrap_inline229 then there is an N such that tex2html_wrap_inline233 for all tex2html_wrap_inline227. So, tex2html_wrap_inline237, for all tex2html_wrap_inline227. tex2html_wrap_inline241

Proposition 1 is useful because there are many techniques, such as L'Hopital's rule, for evaluating limits. However, there are some instances where Proposition 1 cannot be used.

For example, tex2html_wrap_inline243, even though tex2html_wrap147 is undefined.

Examples of tex2html_wrap_inline155: If f(n) = 3n + 6 and g(n) = n, then tex2html_wrap_inline251, or tex2html_wrap_inline165, or tex2html_wrap_inline255, as can be seen by using tex2html_wrap_inline257, and N=5.

Notice that if tex2html_wrap_inline165 then tex2html_wrap_inline263, since if there are positive constants tex2html_wrap_inline265, and N such that tex2html_wrap_inline173 for all n>N, then tex2html_wrap_inline273, for all n>N.

tex2html_wrap_inline277. tex2html_wrap_inline279. tex2html_wrap_inline281. tex2html_wrap_inline283

Useful Properties of tex2html_wrap_inline155:

1. If tex2html_wrap_inline287 and tex2html_wrap_inline289, then tex2html_wrap_inline291.

2. If tex2html_wrap_inline251 and tex2html_wrap_inline289, then tex2html_wrap_inline287.

3. tex2html_wrap_inline299.

4. tex2html_wrap_inline301 for any a,b>1.

5. tex2html_wrap_inline305

6. tex2html_wrap_inline307.

7. tex2html_wrap_inline309.

8. tex2html_wrap_inline311.

9. If tex2html_wrap_inline313, and tex2html_wrap_inline315, then tex2html_wrap_inline317.

O and tex2html_wrap_inline157 Notation

It is not always possible to determine the behavior of an algorithm using tex2html_wrap_inline155-notation. For example, given a problem with n inputs, we may have an algorithm to solve the problem which takes tex2html_wrap_inline325 time when n is even and Cn time when n is odd. Or, we may only be able to prove that an algorithm never uses more than tex2html_wrap_inline333 time and never less than Fn time. In either circumstance we can claim neither tex2html_wrap_inline337 nor tex2html_wrap_inline339 to be the order of the time usage of the algorithm. O and tex2html_wrap_inline157 notation will allow us to give at least partial information.

Proposition 2: Suppose f and g are positive functions defined on the positive integers, and that tex2html_wrap148, then f=O(g). tex2html_wrap_inline241

Examples of O: 3 n + 2 = O(n), since tex2html_wrap_inline357, for all tex2html_wrap_inline359. 100 n + 6 = O(n), since tex2html_wrap_inline365, for all tex2html_wrap_inline367. tex2html_wrap_inline369Otex2html_wrap_inline371, since tex2html_wrap_inline373, for all tex2html_wrap_inline375. tex2html_wrap_inline377O(1), since 3 n + 2 is not less than or equal to c for any constant c and all tex2html_wrap_inline387. tex2html_wrap_inline389O(n). tex2html_wrap_inline369Otex2html_wrap_inline395. tex2html_wrap_inline241

Proposition 3: Suppose f and g are positive functions defined on the positive integers, and that tex2html_wrap149, then tex2html_wrap_inline199. tex2html_wrap_inline241

Examples of tex2html_wrap_inline157: tex2html_wrap_inline409, since tex2html_wrap_inline411 for all tex2html_wrap_inline413. tex2html_wrap_inline415, since tex2html_wrap_inline417 for all tex2html_wrap_inline413. tex2html_wrap_inline421 since tex2html_wrap_inline423 for all tex2html_wrap_inline413. tex2html_wrap_inline427. tex2html_wrap_inline429. tex2html_wrap_inline241

Useful Properties of O and tex2html_wrap_inline157:

1. tex2html_wrap_inline165 if and only if f=O(g) and tex2html_wrap_inline199.

2. If f=O(h) and g=O(h) then f+g=O(h).

3. If tex2html_wrap_inline455 and tex2html_wrap_inline457 then tex2html_wrap_inline459.

4. If f=O(g) and g=O(h) then f=O(h).

5. If tex2html_wrap_inline199 and tex2html_wrap_inline457 then tex2html_wrap_inline455.

6. Suppose 0<a<b. Then tex2html_wrap_inline481Otex2html_wrap_inline483 and tex2html_wrap_inline485.

7. Suppose 0<a and 1<b, then tex2html_wrap_inline491Otex2html_wrap_inline493 and tex2html_wrap_inline495.

8. Suppose 1<c and 0<a, then tex2html_wrap_inline481Otex2html_wrap_inline503 and tex2html_wrap_inline505.



next up previous
Next: About this document

Davin Milun
Mon Dec 30 13:26:11 EST 1996