02-Asymptotic-Notation-and-Recurrences

# 02-Asymptotic-Notation-and-Recurrences - Algorithms LECTURE...

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

Algorithms L2.1 Algorithms Professor Ashok Subramanian L ECTURE 2 Asymptotic Notation O -, -, and Θ -notation Recurrences Substitution method Iterating the recurrence Recursion tree Master method

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

View Full Document
Algorithms L2.2 Asymptotic notation We write f ( n ) = O ( g ( n )) if there exist constants c > 0 , n > 0 such that 0 f ( n ) cg ( n ) for all n n . O -notation (upper bounds):
Algorithms L2.3 Asymptotic notation We write f ( n ) = O ( g ( n )) if there exist constants c > 0 , n > 0 such that 0 f ( n ) cg ( n ) for all n n . O -notation (upper bounds): E XAMPLE : 2 n = O ( n ) ( c = 1 , n = 2 )

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

View Full Document
Algorithms L2.4 Asymptotic notation We write f ( n ) = O ( g ( n )) if there exist constants c > 0 , n > 0 such that 0 f ( n ) cg ( n ) for all n n . O -notation (upper bounds): E XAMPLE : 2 n = O ( n ) functions, not values ( c = 1 , n = 2 )
Algorithms L2.5 Asymptotic notation We write f ( n ) = O ( g ( n )) if there exist constants c > 0 , n > 0 such that 0 f ( n ) cg ( n ) for all n n . O -notation (upper bounds): E XAMPLE : 2 n = O ( n ) functions, not values funny, “one-way” equality ( c = 1 , n = 2 )

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

View Full Document
Algorithms L2.6 Set definition of O-notation O ( g ( n )) = { f ( n ) : there exist constants c > 0 , n > 0 such that 0 f ( n ) cg ( n ) for all n n }
Algorithms L2.7 Set definition of O-notation O ( g ( n )) = { f ( n ) : there exist constants c > 0 , n > 0 such that 0 f ( n ) cg ( n ) for all n n } E XAMPLE : 2 n O ( n )

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

View Full Document
Algorithms L2.8 Set definition of O-notation O ( g ( n )) = { f ( n ) : there exist constants c > 0 , n > 0 such that 0 f ( n ) cg ( n ) for all n n } E XAMPLE : 2 n O ( n ) ( Logicians: λ n .2 n O ( λ n . n ) , but it’s
Algorithms L2.9 Macro substitution Convention: A set in a formula represents an anonymous function in the set.

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

View Full Document
Algorithms L2.10 Macro substitution Convention: A set in a formula represents an anonymous function in the set. f ( n ) = n + O ( n ) means f ( n ) = n + h ( n ) E XAMPLE :
Algorithms L2.11 Macro substitution Convention: A set in a formula represents an anonymous function in the set. n + O ( n ) = O ( n ) means for any f ( n ) O ( n ) : n + f ( n ) = h ( n ) E XAMPLE :

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

View Full Document
Algorithms L2.12 -notation (lower bounds) O -notation is an upper-bound notation. It makes no sense to say f ( n ) is at least O ( n ) .
L2.13 -notation (lower bounds) Ω( g ( n )) = { f ( n ) : there exist

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.

## This note was uploaded on 04/29/2011 for the course IT 201 taught by Professor K.v.arya during the Spring '11 term at IIT Kanpur.

### Page1 / 57

02-Asymptotic-Notation-and-Recurrences - Algorithms LECTURE...

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

View Full Document
Ask a homework question - tutors are online