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

## Presentation on theme: "Design & Analysis of Algorithms COMP 482 / ELEC 420 John Greiner."— Presentation transcript:

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

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

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 0 a+c b-d ! a n 0 3

Floor & Ceilings 4 a>0 integer a integer a>0, b 1

Logarithm Notation lg n = log 2 nln n = log e n lg k n = (lg n) k lg lg n = lg (lg n) lg n + k = (lg n) + k lg (0) n = nlg (i+1) n = lg lg (i) n lg* n = min {i 0 | lg (i) n 1} How many times can you take the logarithm before its 1? 5

Exponentials & Logarithms 6 a>0 O(log a x) = O(log b x) = O(log x) x=a c=b

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

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

Bounding Summations: Upper Bound 9 ?

Bounding Summations: Lower Bound 10 ?

Logarithms 11

Bounding Summations by Integrals 12 0 1 0123 … 4 Recall: ln 1 = 0

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

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

Download ppt "Design & Analysis of Algorithms COMP 482 / ELEC 420 John Greiner."

Similar presentations