Asymptotic Representations §
- Example: n+log(n) and n are asymptotically the same
Bounds §
- If function f(x) is faster than g(x), we may say that f(x) is upper bounded (not tightly) by g(x), mathematically represented as f(n)=O(g(n)).
- I.e. f(x) is faster than or at least equal to g(x), akin to ≤ in terms of time
- Tight Bound: both functions are equal to each other; none is faster than the other. We may then express both functions as O(...) of each other
- E.g. n+ln(n)=O(n) and N=O(n+ln(n))
- Then n+ln(n)=Ω(n)
Mathematical Definition §
f(x)=O(g(x))⟺x0,c.∀x>x0.f(x)≤cg(x)
- For some constants a>b>1
- a=Θ(b)
- logan=Θ(logbn)
- nb<O(na)
- bn=O(an)=O(nn)
Comparison §
- Compare each function by comparing representative elements, from slowest to fastest
- Exponential
- Polynomial
- Log
- Constant