1 / 14

Design & Analysis of Algorithms COMP 482 / ELEC 420 John Greiner

Design & Analysis of Algorithms COMP 482 / ELEC 420 John Greiner. Math Background: Review & Beyond. Asymptotic notation Math used in asymptotics Recurrences Probabilistic analysis. To do: [CLRS] A, B, 3.2 #1. Comparisons. Some useful algebra: a<b, c<d implies… -b < -a

marisa
Download Presentation

Design & Analysis of Algorithms COMP 482 / ELEC 420 John Greiner

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Design & Analysis of Algorithms COMP 482 / ELEC 420John Greiner

  2. Math Background: Review & Beyond • Asymptotic notation • Math used in asymptotics • Recurrences • Probabilistic analysis To do: [CLRS] A, B, 3.2 #1

  3. Comparisons Some useful algebra: a<b, c<d implies… • -b < -a • 1/b < 1/a – Unless a,b have different signs! • a+c < b+c • ac < bc – If c>0 • a+c < b+d – But not necessarily a-c < b-d or a-c > b-d ! • an < bn– If a,b>0

  4. Floor & Ceilings  a>0  integer a>0,  b1  integer a

  5. Logarithm Notation lg n = log2 n ln n = loge n lgk n = (lg n)k lglg n = lg (lg n) lg n + k = (lg n) + k lg(0) n = n lg(i+1) n = lglg(i) n lg* n = min {i0 | lg(i) n  1} How many times can you take the logarithm before it’s  1?

  6. Exponentials & Logarithms a>0 c=b x=a O(loga x) = O(logb x) = O(log x)

  7. Summations ? Solve as telescoping sum: ? Arithmetic ? Geometric if x  1 ? if |x| < 1 ? Harmonic ? Telescoping

  8. Summations – Combining with Calculus if |x| < 1 Have: Differentiate: if |x| < 1 Algebra: if |x| < 1

  9. Bounding Summations: Upper Bound ?

  10. Bounding Summations: Lower Bound ?

  11. Logarithms More generally,

  12. Bounding Summations by Integrals 1 … 0 0 1 2 3 4 Recall: ln 1 = 0

  13. Factorials n! = ω(2n) n! = o(nn) log n! = Θ(n log n)

  14. Permutations & Combinations # of permutations of an n-set = n! # of k-combinations of an n-set =

More Related