lec2-2 - EE 608: Computational Models and Methods Lecture...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EE 608: Computational Models and Methods Lecture 2: Asymptotics and Mathematical Basics Read Chapter 3 of Introduction to Algorithms ECE 608, Fall 2005 [ 1 ] -Notation We describe asymptotic running times of algorithms using functions with do- mains of natural numbers. This notation is convenient for defining the worst- case running time function, T ( n ). ( g ( n )) represents an asymptotically tight bound , which is defined formally as a set: ( g ( n )) = { f ( n ) | positive constants c 1 , c 2 , n such that c 1 g ( n ) f ( n ) c 2 g ( n ) , n n } n n0 c2 g(n) f(n) c1 g(n) Though we write f ( n ) = ( g ( n )), technically this means f ( n ) ( g ( n )). ECE 608, Fall 2005 [ 2 ] Discussion of the Asymptotic Notation A very useful aspect of this notation is that constants and lower-order terms can be ignored. How does one work with this notation? We will learn a number of rules for their manipulation. If they dont help, remember the definition for . For example, let us try to prove that 6 n 3 6 = ( n 2 ). Proof by contradiction: i.e., assume 6 n 3 = ( n 2 ). c 1 n 2 6 n 3 c 2 n 2 , n n c 1 6 n c 2 , n n This implies that n c 2 6 , n n , a contradiction. ECE 608, Fall 2005 [ 3 ] -Notation Example 1 f ( n ) = 5 n 2 + 1000 n Claim: f ( n ) = ( n 2 ) Needed: c 1 , c 2 , and n , such that: c 1 n 2 5 n 2 + 1000 n c 2 n 2 c 1 5 + 1000 n c 2 One choice: n = 1000 , c 1 = 5 , c 2 = 6 ECE 608, Fall 2005 [ 4 ] -Notation Example 2 Let us try to prove that n 6 = ( n 2 ). Proof by contradiction: i.e., assume n = ( n 2 ). c 1 n 2 n c 2 n 2 , n n c 1 1 n c 2 , n n This implies that n 1 c 1 , n n , a contradiction. ECE 608, Fall 2005 [ 5 ] O-Notation If we want to express only the asymptotic upper bound of a function, we can use O-notation. Formally: O ( g ( n )) = { f ( n ) | positive constants c, n such that f ( n ) cg ( n ) , n n } n n0 f(n) c g(n) For example, 5 n 2 + 100 n + 22 = O ( n 2 ) and n = O ( n 2 ). Since O-notation describes an upper bound, when we use it to bound the worst- case running time of an algorithm, we also bound the running time on arbitrary inputs. ECE 608, Fall 2005 [ 6 ] -Notation If we want to express only the asymptotic lower bound of a function, we can use -notation. Formally: ( g ( n )) = { f ( n ) | positive constants c, n such that cg ( n ) f ( n ) , n n } n n0 f(n) c g(n) For example, 5 n 2 + 100 n + 22 = ( n 2 ) and n 2 = ( n ). Since -notation describes a lower bound, when we use it to bound the best- case running time of an algorithm, we also bound the running time on arbitrary inputs....
View Full Document

Page1 / 15

lec2-2 - EE 608: Computational Models and Methods Lecture...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online