Week 4: Complexity of Recursive Methods Flashcards
1
Q
Exponentials
A
a0 = 1
a1 = a
a-1 = 1/a
(am)n = amn
aman = am+n
for all n, a ≥ 1 the function an is monotonically increasing in n (always increasing or constant)
2
Q
Logarithms
A
a = blogba
logc(ab) = logca + logcb
logba = logca/logcb
logb(1/a) = -logba
logba = 1/logab
alogbc = clogba
where log base ≠ 1
3
Q
Factorials
A
n! = 1 x 2 x 3 …. n
weak upper bound n! ≤ nn
1 x 2 x 3 … n < n x n x n …
4
Q
Stirling’s Approximation
A
n! = √2π (n/e)n(1 + Θ(1/n))
5
Q
Sums
A
a1 + a2 + … + an k=1 ∑n ak
if n = 0, sum is 0
lim n→∞ k=1 ∑n ak
If the limit exists, the series converges, else it diverges