02-Asymptotic-Notation-and-Recurrences

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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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):
Background image of page 2
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 )
Background image of page 3

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

View Full DocumentRight Arrow Icon
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 )
Background image of page 4
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 )
Background image of page 5

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

View Full DocumentRight Arrow Icon
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 }
Background image of page 6
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 )
Background image of page 7

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

View Full DocumentRight Arrow Icon
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
Background image of page 8
Algorithms L2.9 Macro substitution Convention: A set in a formula represents an anonymous function in the set.
Background image of page 9

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

View Full DocumentRight Arrow Icon
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 :
Background image of page 10
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 :
Background image of page 11

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

View Full DocumentRight Arrow Icon
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 ) .
Background image of page 12
L2.13 -notation (lower bounds) Ω( g ( n )) = { f ( n ) : there exist
Background image of page 13

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

View Full DocumentRight Arrow Icon
Image of page 14
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 Right Arrow Icon
Ask a homework question - tutors are online