Asymptotic Notations and Complexity Analysis: Fall 2002 CMSC 351 Document - Prof. Brian Th, Study notes of Algorithms and Programming

Various topics related to asymptotic notations, logarithms, stirling's formula, recurrences, and facts, including big o, θ, and ω notations, logarithmic properties, and the master theorem. It also includes information on summations, distribution law, interchanging order of summation, splitting range, arithmetic series, geometric series, and telescoping series.

Typology: Study notes

Pre 2010

Uploaded on 02/13/2009

koofers-user-36r
koofers-user-36r 🇺🇸

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMSC 351:Fall 2002 Khuller & Postow
Information CMSC251
Asymptotic Notations.
Θ(g(n)) = {f(n): there exist positive constants c1,c2, and n0such that 0 c1g(n)f(n)c2g(n) for all
nn0}.
O(g(n)) = {f(n): there exist positive constants cand n0such that 0 f(n)cg(n) for all nn0}.
Ω(g(n)) = {f(n): there exist positive constants cand n0such that 0 cg(n)f(n) for all nn0}.
Logarithms.
a=blogbalogc(ab) = logca+ logcblogban=nlogba
logba=logca
logcblogb(1/a) = logbalogba=1
logabalogbn=nlogba
Stirling’s Formula.
n!n
en2πn
Recurrences “Master Theorem”:
T(n) = aT (n/b) + cndn > 1
f n = 1
implies
T(n) =
f+c
abd1nlogbacnd
abd1=Θ(nlogba)a > bd
Θ(nd)a < bd
nd(f+clogbn) = Θ(ndlogbn)a=bd
.
Facts: Number of leaves in a binary tree of height his at most 2h.
1
pf2

Partial preview of the text

Download Asymptotic Notations and Complexity Analysis: Fall 2002 CMSC 351 Document - Prof. Brian Th and more Study notes Algorithms and Programming in PDF only on Docsity!

CMSC 351:Fall 2002 Khuller & Postow

Information CMSC

Asymptotic Notations.

Θ(g(n)) = {f (n): there exist positive constants c 1 , c 2 , and n 0 such that 0 ≤ c 1 g(n) ≤ f (n) ≤ c 2 g(n) for all n ≥ n 0 }.

O(g(n)) = {f (n): there exist positive constants c and n 0 such that 0 ≤ f (n) ≤ cg(n) for all n ≥ n 0 }.

Ω(g(n)) = {f (n): there exist positive constants c and n 0 such that 0 ≤ cg(n) ≤ f (n) for all n ≥ n 0 }.

Logarithms.

a = blogb^ a^ logc(ab) = logc a + logc b logb an^ = n logb a

logb a = logc^ a logc b

logb(1/a) = − logb a logb a = 1 loga b

alogb^ n^ = nlogb^ a

Stirling’s Formula.

n! ≈

( (^) n e

)n √ 2 πn

Recurrences “Master Theorem”:

T (n) =

aT (n/b) + cnd^ n > 1 f n = 1

implies

T (n) =

f + (^) ab−cd− 1

nlogb^ a^ − cn

d ab−d− 1 =

Θ(nlogb^ a) a > bd Θ(nd) a < bd nd(f + c logb n) = Θ(nd^ logb n) a = bd

Facts: Number of leaves in a binary tree of height h is at most 2h.

Summations. Distribution law: (^) ( ∑m

i=

ai

∑^ n

j=

bj

∑^ m

i=

∑^ n

j=

aibj

Interchanging order of summation: ∑m

i=

∑^ n

j=

aij =

∑^ n

j=

∑^ m

i=

aij

Splitting range: ∑n

k=

ak =

∑^ r

k=

ak +

∑^ n

k=r+

ak

Arithmetic series: (^) n ∑

k=

k = 1 + 2 + · · · + n = n(n^ + 1) 2

Geometric series: (^) n ∑

k=

xk^ = 1 + x + +x^2 · · · + xn^ =

xn+1^ − 1 x − 1 x^6 = 1

∑^ ∞

k=

xk^ =

1 − x

x < 1

Another useful sum: (^) ∞ ∑

k=

kxk^ = x (1 − x)^2

x < 1

Harmonic series:

Hn = 1 +

4 +^ · · ·^ +

n =

∑^ n

k=

k = ln^ n^ +^ O(1)

Telescoping series: ∑n

k=

(ak − ak− 1 ) = an − a 0

Products: (^) n ∏

k=

ak = a 1 a 2 · · · an log

∏^ n

k=

ak =

∑^ n

k=

log ak

Quadratic Formula.

ax^2 + bx + c = 0 ⇒ x =

−b ±

b^2 − 4 ac 2 a