lect_21 - Big O, Recurrences Margaret M. Fleck 10 March...

Info iconThis preview shows pages 1–3. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Big O, Recurrences Margaret M. Fleck 10 March 2010 This lecture finishes discussion of big-O notation and starts talking about solving recurrences. This material is in sections 3.2 and 7.1 of Rosen. 1 Announcements Theres a quiz coming next Wednesday (15 March). Study materials will be posted soon. 2 Recap big-O Last class, we saw the idea of asymptotic analysis, in which functions (e.g. the running times of computer programs) are classified on the basis of their behavior for large inputs, ignoring multiplicative constants. We saw that a function f is O ( g ) if f grows no faster than g . So 3 x is O ( x 2 ). 3 x also O ( x ), since we dont care about the constant 3. But 3 x 2 isnt O ( x ), because 3 x 2 grows faster than x when x gets large. We saw the following big-O ordering for selected basic functions: 1 log n n n log n n 2 1 n n 2 n 3 . . . 2 n n ! We also saw the formal definition for big-O notation. Suppose that f and g are functions whose domain and co-domain are subsets of the real numbers. Then f ( x ) is O ( g ( x )) (read big-O of g) if and only if There are real numbers c and k such that | f ( x ) | c | g ( x ) | for every x k . 1 And then g ( x ) is ( f ( x )) if and only if f ( x ) is O ( g ( x )). (I.e. its like .) f ( x ) is ( g ( x )) if and only if g ( x ) is O ( f ( x )) and f ( x ) is O ( g ( x )) or (alternatively, if g ( x ) is O ( f ( x )) and g ( x ) is ( g ( x )). ( is like equality.) For example, x 3 is (3 x 2 ) and ( x 3 ), because x 3 grows at least as fast as both of these functions....
View Full Document

This note was uploaded on 09/21/2011 for the course CS 173 taught by Professor Erickson during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 5

lect_21 - Big O, Recurrences Margaret M. Fleck 10 March...

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

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