Asymptotic Analysis
Asymptotic Analysis
Asymptotic Analysis
Growth of Functions
Changing the hardware/ software environment
•Affects T(n) by a constant factor
•Does not alter the growth rate of T(n)
Although we can sometimes determine the exact running time
of an algorithm, the extra precision is not usually worth the effort
of computing it.
4 2 4 8 16 64 16
8 3 8 24 64 512 256
16 4 16 64 256 4,096 65,536
4,294,967,29
32 5 32 160 1,024 32,768
6
64 6 64 384 4,094 262,144 1.84 * 1019
128 7 128 896 16,384 2,097,152 3.40 * 1038
256 8 256 2,048 65,536 16,777,216 1.15 * 1077
512 9 512 4,608 262,144 134,217,728 1.34 * 10154
1,073,741,82
1024 10 1,024 10,240 1,048,576 1.79 * 10308
4
The Growth Rate of the Six Popular functions
Asymptotic Complexity
•, O, W, o, w
(g(n)) = {f(n) : positive constants c1, c2, and n0, such that n
n0, we have 0 c1g(n) f(n) c2g(n)}
1. 7n-2= O(n)
need c > 0 and n0 1 such that 7n-2 c•n for n
n0
cn2 105n
RR
O( f ) ( f )
•f
( f )
o-notation
Big-Oh
f(n) is O(g(n)) if f(n) is asymptotically less than or equal to
g(n)
big-Omega
f(n) is (g(n)) if f(n) is asymptotically greater than or equal
to g(n)
big-Theta
f(n) is (g(n)) if f(n) is asymptotically equal to g(n)
little-oh
f(n) is o(g(n)) if f(n) is asymptotically strictly less than g(n)
little-omega
f(n) is (g(n)) if is asymptotically strictly greater than g(n)