{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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 Document Right 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 There’s 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 don’t care about the constant 3. But 3 x 2 isn’t 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. it’s 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

{[ snackBarMessage ]}

Page1 / 5

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

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

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