Consider the following recurrence relation of T(n):
T(1)=1,T(n)=T(⌈3n⌉)+1
Use The Master Theorem to show that T(n)∈Θ(log2n).
a=1,b=3,f(n)=1k=log3(1)=0∴f(n)∈Θ(n0)≡Θ(1)T(n)=Θ(nklog2n)=Θ(log2n)
Verify lower-bound by showing T(n)≥21log2n for all n≥1.
Base Case: LHS = T(1)=1, RHS = 21log2(1)=0
Hence, LHS≥RHS which means the base case holds.
Inductive Case: Assume T(m)≥21log2(m) for all m≤k.
By definition, T(k+1)=T(⌈3k+1⌉)+1.
T(k+1)≥21log2(⌈3k+1⌉)+1≥21log2(3k+1)+1=21[log2(k+1)−log2(3)]+1=21log2(k+1)−21log2(3)+1=21log2(k+1)+0.207≥21log2(k+1) as required
Hence this formula holds for all values of $m \le k$.
3. Verify upper-bound by showing $T(n) \le 2 \log_2 n$ for all $n \ge 2$.
4. Why is the upper-bound much harder to prove than the lower-bound?
# Question 2
1. Construct recurrence relation $T(n)$ such that:
- $T(1) = 1$