This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Mathematical Background and Running Time Analysis EECS 2332 Previous Lecture: Mathematical Defnitions T ( N ) = O ( f ( N )) if there are positive constants c and n such that T ( N )<= cf ( N ) when N >= n T ( N ) = Ω ( f ( N )) if there are positive constants c and n such that T ( N )>= cf ( N ) when N >= n T ( N ) = θ ( f ( N )) iff T ( N ) = O ( f ( N )) and T ( N ) = Ω ( f ( N )) T ( N ) = o ( f ( N )) if for all constants c there exists an n such that T ( N )< cf ( N ) when N > n3 How to Determine the Relative Growth Rate? If lim N>infinity T ( N ) / f ( N ) = 0: T ( N ) = o ( f ( N )) = c != 0: T ( N ) = θ ( f ( N )) = infinity: f ( N ) = o ( T ( N )) If no convergence <= c : T ( N ) = O ( f ( N )) T ( N ) = N f ( N ) = N if N is odd, or N 2 if N is even >= c : f ( N ) = O ( T ( N )) Otherwise (could be > c and < c for any c ): no relation T ( N ) = N f ( N ) = 1 if N is odd, or N 2 if N is even T ( N ) = o ( f ( N )) if for all constants c there exists an n such that T ( N )< cf ( N ) when N > n . T ( N ) = θ ( f ( N )) if there are positive constants c and n such that T ( N )<= cf ( N ) when N >= n AND there are positive constants c* and n* such that T ( N )>= cf ( N ) when N >= n* T ( N ) = O ( f ( N )) if there are positive constants c and n such that T ( N )<= cf ( N ) when N >= n4 Logarithm Properties Nonnegative, monotonic function for N ≥ 1 Sub linear growth: Basic equivalencies: Corollary: logarithm grows slower than any polynomial! log( N ) = o ( N x ) " log(log( N ) = o (log( N x ) = o ( x log( N )) " log Y = o ( xY ) = o ( Y ) log( X ) = o ( X )5 Relative Growth Rates Examples (which grows faster?) 1000000 versus 0.01*sqrt( N ) log( N ) versus sqrt( N ) N log( N ) versus N 1.001 N 3 versus 10000* N 2 log 2 ( N ) versus 10*log( N 5 ) 2*log 2 ( N ) versus log 3 ( N ) N *2 N versus 3 N 10*log( N 5 ) = 50*log( N ) 3 N = 1.5 N * 2 N N 1.001 = N * N 0.001 6...
View
Full Document
 Spring '08
 Rabinovich
 Analysis of algorithms, Computational complexity theory, LG, positive constants, int maxSum, int thisSum

Click to edit the document details