SUNY Geneseo Department of Computer Science
Introduction to Asymptotic Notation
{Date}
CSci 240, Spring 2007
Prof. Doug Baldwin
Return to List of Lectures
Previous Lecture
Misc
Lab 4 (debugging) due tomorrow
Faculty applicant (Suprakash Datta) interviewing today
- Student roundtable 11:30 - 12:00, Fraser 208
- Research talk (sensor networks) 2:30, Milne 213
- Model class (Internet congestion control), 4:30,
Welles 123
Questions?
Asymptotic Notation
Sections 9.2.1 and 9.2.2
- Run times for different algorithms, e.g., selection sort,
initialization,
search, something else
- Asymptotic notation (theta) to talk about proportionality of
algorithms
- Definition of f(n) = Θ( b(n) )
- f(n) ≤ c1 b(n) for all n ≥ n1
- f(n) ≥ c2 b(n) for all n ≥ n2
- Informal definition of f(n) = Θ( b(n) )
- f(n) roughly proportional to b(n) for large n
- Important thing about about a theoretical count is fastest
growing term, asymptotic notation abstracts this out
Example: Find and prove simple asymptotic equivalents for...
- (n2 + n) / 2
- = Θ( n2 )
- Proof:
- (n2 + n) / 2 ≤ c1 n2 for n ≥ n1
- (n2 + n) / 2 ≥ c2 n2 for n ≥ n2
- c2 = 0.2, n2 = 1
- or n2/2 + n/2 ≥ c2 n2 , c2 = 1/2, n2 = 0
- 3 2n
- Look at what happens if you get the asymptotic form wrong: "oh, this is like n2", i.e., 3 2n = Θ(n2)
- Check aka prove
- n1 = 2, c1 = 3?
- Counter-example! n = 5: 3 25 = 96; 3 52 = 75
- Maybe c1 and n1 don't exist
- Prove this by thinking about limits?
- Look at limit of ratio 3 2n / n2 ≤ c1
- This limit is infinite, i.e., c1 has to be infinite
Next
Two other forms of asymptoptic notation, Big-O and Big-Ω
Analyzing empirical data for consistency with an asymptotic
hypothesis
Next Lecture