lec2-2

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

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

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

View Full Document

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

View Full Document
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 don’t 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

## This note was uploaded on 04/07/2011 for the course ECE 608 taught by Professor Mithuna during the Fall '07 term at Purdue.

### Page1 / 15

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

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

View Full Document
Ask a homework question - tutors are online