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

NameNotationRough MeaningDefinitionIn-fix Notation

big-Oh

big-Omega

Theta

small-oh

small-omega

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.

Hasse Diagram

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

Last updated