More_O_Notation - More on O and Notation Last updated 1-1 We have seen the formal denitions of(a f(n = O(g(n Informally f(n = O(g(n means that f(n grows

# More_O_Notation - More on O and Notation Last updated 1-1...

• Notes
• 53

This preview shows page 1 - 18 out of 53 pages.

1-1 More on O () and Θ() Notation Last updated April 27, 2010
2-1
2-2
3-1Functionf(n) =O(g(n)):(read:f(n)isOofg(n))Ifsuch thatxx0f(x)cg(x).If (i) There is some positivex0R(ii) There is some positivecRRecall The Definition:
4-1 4 n 2 8 n 2 + 2 n - 3 n 2 / 5 + n - 10 log n n ( n - 3) are all O ( n 2 ) . Some Examples
4-2 4 n 2 8 n 2 + 2 n - 3 n 2 / 5 + n - 10 log n n ( n - 3) are all O ( n 2 ) . Some Examples Statements like these can often be proven using simple tools; It is NOT usually necessary to prove f ( x ) = O ( g ( x )) from scratch!
5-1 Observation 1: If x 0 and c > 0 such that x > x 0 , f ( x ) c Then f ( x ) = O (1)
5-2 Observation 1: If x 0 and c > 0 such that x > x 0 , f ( x ) c Then f ( x ) = O (1) This comes directly from definition of O (1)
5-3 Observation 1: If x 0 and c > 0 such that x > x 0 , f ( x ) c Then f ( x ) = O (1) This comes directly from definition of O (1) Examples: sin( x ) = O (1) 2 + 1 x = O (1)
6-1 Observation 2: “Constants don’t matter”
6-2 Observation 2: “Constants don’t matter” If f ( x ) = O ( g ( x )) then c > 0 , f ( x ) = O ( cg ( x )))
6-3
6-4
7-1 Observation 3: If f 1 ( x ) = O ( g 1 ( x )) and f 2 ( x ) = O ( g 2 ( x )) then f 1 ( x ) + f 2 ( x ) = O ( g 1 ( x ) + g 2 ( x ))
7-2
7-3
8-1 Observation 3: If f 1 ( x ) = O ( g 1 ( x )) and f 2 ( x ) = O ( g 2 ( x )) then f 1 ( x ) + f 2 ( x ) = O ( g 1 ( x ) + g 2 ( x )) Example: