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...

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

1-1 More on O () and Θ() Notation Last updated April 27, 2010
Image of page 1
2-1
Image of page 2
2-2
Image of page 3
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:
Image of page 4
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
Image of page 5
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!
Image of page 6
5-1 Observation 1: If x 0 and c > 0 such that x > x 0 , f ( x ) c Then f ( x ) = O (1)
Image of page 7
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)
Image of page 8
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)
Image of page 9
6-1 Observation 2: “Constants don’t matter”
Image of page 10
6-2 Observation 2: “Constants don’t matter” If f ( x ) = O ( g ( x )) then c > 0 , f ( x ) = O ( cg ( x )))
Image of page 11
6-3
Image of page 12
6-4
Image of page 13
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 ))
Image of page 14
7-2
Image of page 15
7-3
Image of page 16
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:
Image of page 17
Image of page 18

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture