Introduction

Outline of Algorithmics

Exponent rule

(ab)c=abc\begin{gather*} (a^b)^c = a^{bc} \end{gather*}

Log rule

clog⁔a(n)=nlog⁔a(c)\begin{gather*} c^{\log_a(n)} = n^{\log_a(c)} \end{gather*}

Asymptotics

Name
Notation
Rough Meaning
Definition
In-fix Notation

big-Oh

g=O(f)g=O(f)

g≤fg \le f

(∃C>0)[Cf≄g≄0(e.v.)](\exists C > 0)[C f \ge g \ge 0(e.v.)]

gāŖÆfg \preceq f

big-Omega

g=Ī©(f)g=\Omega(f)

g≄fg \ge f

(∃C>0)[Cg≄f≄0(e.v.)](\exists C > 0)[C g \ge f \ge 0(e.v.)]

gāŖ°fg \succeq f

Theta

g=Θ(f)g=\Theta(f)

g=fg = f

(∃C>1)[C2f≄Cg≄0(e.v.)](\exists C > 1)[C^2 f \ge C g \ge 0(e.v.)]

gā‰fg \asymp f

small-oh

g=o(f)g=o(f)

g≪fg \ll f

(āˆ€C>0)[Cf≄g≄0(e.v.)](\forall C > 0)[C f \ge g \ge 0(e.v.)]

g≪fg \ll f

small-omega

g=ω(f)g=\omega(f)

g≫fg \gg f

(āˆ€C>0)[Cg≄f≄0(e.v.)](\forall C > 0)[C g \ge f \ge 0(e.v.)]

g≫fg \gg f

Asymptotics Notations

Stirling's Approximation

Original:

2Ļ€n(ne)ne112n+1<n!<2Ļ€n(ne)ne112n\sqrt{2\pi n}({n \over e})^n e^{1\over{12n + 1}} < n! < \sqrt{2\pi n}({n \over e})^n e^{1\over{12n}}

log(n!)=nlog⁔(n)āˆ’n+Θ(log⁔(n))log(n!) = n \log(n) - n + \Theta(\log(n))

Further simplification:

log(n!)=Θ(nlog⁔(n))log(n!) = \Theta(n \log(n))

A possible transformation:

n!=Θ(enlog⁔(n))n! = \Theta(e^{n \log(n)})

Comparison Tree

Example: Merge x1<x2x_1 < x_2 and y1<y2<y3<y4y_1 < y_2 < y_3 < y_4.

Decision Tree Example

Hasse Diagram

The lower the smaller, circle(o) for x, cross(Ɨ) for y.

Hasse Diagram Example

Last updated