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
Snk:=i=1∑nik
Solution: Snk=Θ(nk+1)
Geometric Sums
When x=1,
Sn(x):=i=0∑n−1xi
Solution: S∞=x−1xn−1
Infinite Geometric Series
When ∣x∣<1,
S∞(x):=i=0∑∞xi
Solution: S∞=1−x1
Harmonic Series
Hn:=1+21+31+⋯+n1
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:
f(x)≤Cf(x/2)(ev.)
Increasing Exponential Type
f increases exponentially if there exists real numbers C>1 and k>0 such that:
f(x)≥Cf(x−k)(ev.)
Decreasing Exponential Type
f decreases exponentially if there exists real numbers C>1 and k>0 such that:
f(x)≤f(x−k)/C(ev.)
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
Sf(n)=Θ⎩⎨⎧nf(n)f(n)1if f is polynomial-type,if f is increasing exponentially,if f is decreasing exponentially.
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)
t(n)=i≥0∑n2nn=Θ(1)
Because t(n)=2nT(n),
T(n)=Θ(2n)
Master Theorem
Related homework questions: h2-Q8
Master recurrence:
T(n)=aT(n/b)+d(n)
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)
Master Theorem
Theorem 10: Master Theorem on Lecture II Page 51, L1207
T(n)=Θ⎩⎨⎧nw,nwlog(n),d(n),if d(n)=O(nw−ϵ) for some ϵ>0,if d(n)=Θ(nw),if a⋅d(n/b)≤c⋅d(n) for some 0<c<1.CASE(−)CASE(0)CASE(+)
Extended Master Theorem
Theorem 12: Extended Master Theorem on Lecture II Page 54, L1282
T(n)=Θ⎩⎨⎧d(n),W(n)loglogn,W(n)logc+1(n),W(n),if a⋅d(n/b)≤c⋅d(n) for some 0<c<1.if d(n)=Θ(W(n)logc(n)) for c=−1,if d(n)=Θ(W(n)logc(n)) for c>−1,if d(n)=O(W(n)logc(n)) for c<−1.CASE(+)CASE(1)CASE(0)CASE(−)
Multi-term Master Recurrences
Related homework questions: h3-Q5
T(n)=d(n)+i=1∑kaiT(n/bi)
where ai>0 and b1>b2>⋯>bk>1 are real constants.
Watershed constant
It is the real number α such that:
1=i=1∑kbiαai
It clearly exists and is unique.
Multi-term Master Theorem
Theorem 15: Multi-term Master Theorem on Lecture II Page 62, L1483
T(n)=Θ⎩⎨⎧nα,nw,d(n),if d(n)=O(nw−ϵ) for some ϵ>0,if d(n)=Θ(nw),if ∑i=1kai⋅d(n/bi)≤c⋅d(n),CASE(−)CASE(0)CASE(+)