CS336f1011

# CS336f1011 - Lecture 11 CS336 F10 Definition  Asymptotic...

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 10/6/10 Lecture 11 CS336 F10 Definition  Asymptotic Dominance Let f and g be functions from N to R. Then f is asymptotically dominated by g or f is O(g) if (∃k,C| : (∀x| x>k: |f(x)| ≤ C|g(x)|)) That is, there exists constants k and C such that |f(x)| ≤ C|g(x)| for all x>k Prove that f is O(f)  Proof:  |f(x)| ≤|f(x)| for all x  Hence by definition of big O with C=1 and k=0,  we conclude f is O(f).  Example   •  Let k be a positive integer.  Show that if     f(n)=log(Πi|1≤i≤n:ik) then f(n) is O(nlogn).  Example:  Find C and k such that   |log(Πi|1≤i≤n:ik) | ≤ C|nlogn| for all n≥k.   Proof:  |log(Πi|1≤i≤n:ik) | Example:  Find C and k such that   |log(Πi|1≤i≤n:ik) | ≤ C|nlogn| for all n≥k.   Proof:  |log(Πi|1≤i≤n:ik) | ≤ < log is ≥0 so ignore ||;since i≤n> log(Πi|1≤i≤n:nk)  1 10/6/10 Example:  Find C and k such that   |log(Πi|1≤i≤n:ik) | ≤ C|nlogn| for all n≥k.   Proof:  |log(Πi|1≤i≤n:ik) | ≤ < log is ≥0 so ignore ||;since i≤n> log(Πi|1≤i≤n:nk)  =<arith>  log (nk)n  for n≥1  Example:  Find C and k such that   |log(Πi|1≤i≤n:ik) | ≤ C|nlogn| for all n≥k.   Proof:  |log(Πi|1≤i≤n:ik) | ≤ < log is ≥0 so ignore ||;since i≤n> log(Πi|1≤i≤n:nk)  =<arith>  log (nk)n  for n≥1  =<arith>  kn(log n) for n≥1  Hence by the definition of big‐O with C=k and k=1    log(Πi|1≤i≤n:ik)  is O(nlogn).  Uses for Big O   •  Common estimates  Definition  Let f and g be functions from N to R. Then f asymptotically dominates g or f is Ω(g) (∃k,C| : (∀x| x>k: |f(x)| ≥ C|g(x)|)) That is, there exists constants k and C such that |f (x)| ≥ C|g(x)| for all x>k •  If f is O(g) then g is Ω(f). •  If f is O(g) and f is Ω(g) then f is Θ(g). For each of the following statements,    determine if they are true or false.    •  •  •  •  •  •  •  xlogx is O(x2).         True    False   xlogx is Ω(x2).        True    False   xlogx is Θ(x2).        True    False   2n is O(n!)           True    False   If f1 is O(g) and f2 is O(g) then f1 ‐  f2 is O(g)   True  False  If f1 is Θ(g) and f2 is Θ (g) then f1‐f2 is Θ (g)   True  False   If f is Θ(g) then f is O(g)     True    False   Quiz 13    For each of the following statements,  determine if they are true or false and circle  appropriately.   a.  (5x2+x)(2logx‐1) is Ω (x2).  True    False     b.  logx3 is O(x2).           True    False     c.  If f1 is Θ(g1) and f2 is Θ(g2), then f1‐f2 is     Θ(g1‐g2).    True    False  2 10/6/10 Example   Example   •  Prove or disprove that if 0<a<b, the na is O(nb)  3 ...
View Full Document

## This note was uploaded on 11/30/2010 for the course CS 336 taught by Professor Myers during the Fall '08 term at University of Texas.

Ask a homework question - tutors are online