This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Big O, Recurrences Margaret M. Fleck 10 March 2010 This lecture finishes discussion of bigO 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 bigO 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 bigO 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 bigO notation. Suppose that f and g are functions whose domain and codomain are subsets of the real numbers. Then f ( x ) is O ( g ( x )) (read “bigO 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
 Spring '08
 Erickson
 Real Numbers, Recursion, Big O notation, positive real numbers, Margaret M. Fleck

Click to edit the document details