Asymptotic Analysis
”What doesn’t kill you, makes you stronger”
Smaller / Larger Asymptotic Bounds
Big-Oh
-
: ( is asymptotically bounded above by ) if there exists constants and such that for all .
-
So it suffices to show the existence of a single (, ) pair.
-
Gives asymptotic upper bound
- means function is “bounded” above by function
- eventually for large enough
- ignoring multiplicative constant
- Growth rate of is slower or the same as the growth rate of
- means function is “bounded” above by function
-
Use big-O to bound the growth rate of algorithm
- for running time
- for growth rate
-
-
big-Oh is only an upper bound
- typically example: 1 is in and n is in
- try to give ‘s if possibe
big-anything hides constants
- this is by design
- a will beat a algorithm eventually
- galactic algorithms: become practically relevant for astronomical input sizes (fast matrix or integer multiplication)
Asymptotic Lower Bound:
- To prove that , what do we need to show?
- Separately showing that and ?
- Show
- You need two constants and such that for all , . The simplest way of showing this is to prove the two bounds separately and then take .
Summary of Order Notation
Strictly smaller/larger asymptotic bounds
- We need to find an for each possible . That is we find , in terms of .
Main difference to and is the quantifier for .
Rules of Order Notation
Transitivity:
- If and then .
- If and then .
Maximum rules:
Suppose that and for all . Then:
Techniques for Order Notation
- Given two positive function and which asymptotic bounds can be proved/disproved directly using the Limit Rule?
- Since the limit rule is only defined for , and bounds. It is true that if the bound is proven using the limit rule, then you have also shown an bound since .
Common Growth Rates
- for some constant
Relationship between Order Notations
Questions
-
- true
-
- false
-
- false
Choose the correct bound. Always select the bound which conveys the most information(the tightest bound)
-
- In notation we are interested in finding a tight bound that represents the growth rate of the given function. The notation indicates that the function has a constant growth rate.
-
- To determine the bound we take the limit of and and since it equals to , from the definition, we know that grows slower than , so we have .
-
- By taking the limit of approaching , we see that it’s equal to , so we have
-
- By taking the limit of approaching , we see that it’s equal to . Thus, we have .
-
Which of the followings is in increasing order of growth rate?
- , , ,,
Note
Which one is true?
- Look at Recurrence Relations
In the Random Access Machine (RAM) model, which of the following is not true?
- The assumptions made in the RAM model are also true for real computers (false)
- Access to a memory location takes constant time. (true)
- Running time of a program is proportional to the sum of the number of memory accesses and primitive operations. (true)
- Primitive operations take constant time. (true)