Orders of Growth. Rosen 5 th ed., §2.2. Orders of Growth (§2.2). For functions over numbers, we often need to know a rough measure of how fast a function grows .
Rosen 5th ed., §2.2
First of all, what is order of growth? It is a gross measure of the resources required by an algorithm as the input size becomes larger.
Suppose algorithm A to solve a problem requires a complexity in the form of function f(x) where x is the input size.
Likewise, another algorithm B for the same problem will require the complexity of g(x).
There are two kinds of programs or algorithms.
The answer is obvious. Everybody (who can do the math) will choose the program A.
Value of function
This plotting shows how fast each algorithm’s complexity increases.
I guess two functions will meet around 30 or 31.
Why do we use this notation O(n)?
The exact expression of complexity of algorithm is somewhat long and perplexing. So we want to grasp the essence of the complexity.
That’s why we use O(n) notation and let’s see how we can derive the
O() notation from the original complexity equation.
Let g be any function RR.
You should prove that the values you choose do work.
When we simplify the complexity by the big-o notation, we normally focus on the highest-order term.
Why? Because it will signify how fast the function will change
In the first case, the highest-order term is linear term
In the 2nd case, the highest-order term is quadratic term
A polynomial function of a variable x of a degree n will have this form in general.
less than or equal to g(n)
greater than or equal to g(n)
strictly less than g(n)
strictly greater than g(n)
f (n) is o (g (n)) if
lim n→∞(f (n) / g (n)) = 0
log log n
n log n
Hint: Can use L’Hopital’s rule
O(2n ), O(n!): intractable
fg to mean fo(g)
f~g to mean f(g)
( f )
O( f )
o( f )
( f )
( f )
Definitions of order-of-growth sets, g:RR