Recurrences
Separable form for recurrence relation:
where G(x0,x1,...,xk) is a function in k+1 variables and each ni(i=1,...,k) is a function of n that is strictly less than n.
Fibonacci sequence is defined by the recurrence relation:
For this, we have k=2,n1=n−1,n2=n−2
Merge sort complexity:
For this, we have k=1,n1=n/2
Rote Method
Related homework questions: h2-Q7
EGVS method
4 stages: Expand, Guess, Verify and Stop-and-Sum.
Example:
T(n)=2T(n/2)+n
Expand:
T(n)=2T(n/2)+n=2(2T(n/4)+(n/2))+n=4T(n/4)+2n=4(2T(n/8)+(n/4))+2n=8T(n/8)+3n=…Guess:
T(n)=2iT(2in)+inVerify: (use natural induction)
Base case: T(n)i=1=2T(n/2)+n holds
Inductive step: Assume T(n)i=k holds, the goal is to prove T(n)i=k+1 also holds.
T(n)=2kT(2kn)+kn=2k(2T(2k+1n)+2kn)+kn=2k+1T(n/2k+1)+(k+1)nTherefore, this proves T(n)i=k+1 also holds.
Combining the base case and the inductive step we verified that T(n)=2iT(2in)+in.
Stop:
We can pick i=⌊lgn⌋ for stopping, then 0<2in≤2.
By DIC, choose T(n)=0 for all n≤2.
Therefore, for n>1,
T(n)=⌊lgn⌋n
Basic Sums
Other kinds of sums are often reduces to the following forms.
Arithmetic Sums
Solution: Snk=Θ(nk+1)
Geometric Sums
When x=1,
Solution: S∞=x−1xn−1
Infinite Geometric Series
When ∣x∣<1,
Solution: S∞=1−x1
Harmonic Series
Solution: Hn=ln(n)+g(n) where 0<g(n)<1.
Summation Techniques
Growth Types
Related homework questions: h3-Q1
Polynomial Type
A real function f is polynomial-type if f is non-decreasing (ev.) and there is some C>1 such that:
Increasing Exponential Type
f increases exponentially if there exists real numbers C>1 and k>0 such that:
Decreasing Exponential Type
f decreases exponentially if there exists real numbers C>1 and k>0 such that:
Lemma 8: Closed Properties
(a) Polynomial-type functions are closed under addition, multiplication, and raising to any positive power a>0.
(b) Exponential-type functions f are closed under addition, multiplication, and raising to any power a. In case a>0, the function fa will not change its subtype (increasing or decreasing). In case a<0, the function fa will change its subtype.
(c) If f is polynomial-type and lgf is non-decreasing then lgf is also polynomial-type. If f is exponential-type and a>1 then so is af.
Summation Rules by Growth Type
Related homework questions: h3-Q2
Theorem 6: Summation Rules
Examples:
Polynomial Sums:
i≥1∑nilog(i)=Θ(n2log(n)),i≥1∑nlog(i)=Θ(nlog(n)),i≥1∑nia=Θ(na+1)(a≥0).Exponentially Increasing Sums:
i≥1∑nbi=Θ(bn)(b≥0),i≥1∑ni−522i=Θ(n−522n),i≥1∑ni!=Θ(n!).Exponentially Decreasing Sums:
i≥1∑nb−i=Θ(1)(b≥0),i≥1∑ni2i−i=Θ(1),i≥1∑ni−i=Θ(1).

Transformation Techniques
Domain Transformation
Related homework questions: h3-Q3 and h3-Q4(combining range transformation)
Example:
Consider:
We define t(n):=T(2n)orN=2n.
This transforms the original N-domain into the n-domain:
We get this standard form. By DIC, we choose the boundary condition t(n)=0 for all n≤0.
We get sum:
Because we have n=lgN,
On Lecture II Page 46, L1120, we get the exact sum by transforming the descending sum to the ascending sum.
Range Transformation
Related homework questions: h3-Q4(combining domain transformation)
Example:
We define t(n):=2nT(n), then divide the both sides of the original equation by 2n.
We get this standard form. By DIC, we choose the boundary condition t(n)=0 for all n≤0.
We get sum: (∑i≥0n2nn is exponentially decreasing)
Because t(n)=2nT(n),
Master Theorem
Related homework questions: h2-Q8
Master recurrence:
where a>0, b>0 are real constants and d(n) the driving/forcing function.
Watershed constant
w=logb(a)
Watershed function
W(n)=nw=nlogb(a)
Useful link: Online basic master theorem solver
Master Theorem
Theorem 10: Master Theorem on Lecture II Page 51, L1207
Extended Master Theorem
Theorem 12: Extended Master Theorem on Lecture II Page 54, L1282
Multi-term Master Recurrences
Related homework questions: h3-Q5
where ai>0 and b1>b2>⋯>bk>1 are real constants.
Watershed constant
It is the real number α such that:
It clearly exists and is unique.
Multi-term Master Theorem
Theorem 15: Multi-term Master Theorem on Lecture II Page 62, L1483
Real Induction
Related homework questions: h2-Q9
Last updated