Proof of Induction || Iteration method
Hi, I am working on a discrete math problem, and I can't figure out what to do with:
T(n) = 3 + T(n/2), T(0) = 0
I have tried Plug and Chug method and Induction method, but I can't seem to work it out.
My problem is when I try to make a general formula:
T(n) = 3 + T(n/2) => T(n/2) => 3 + T(n^2/2^2)
T(n) = 3 + (3 + T(n^2/2^2))
T(n) = 3 + 3 + T(n^2/2^2) => 3 + T(n^3/2^3)
T(n) = 3 + 3 + (3 + T(n^3/2^3))
T(n) = 3 + 3 + 3 + T(n^3/2^3)
So, g(i) = 3i + T(n^i/2^i)
Since, T(0) = 0
. I need to make n^i/2^i
equal to 0
.
n^i/2^i = 0
and I'm stuck. I've looked at the answer key, and the answer is:
T(n) = 3(⌊log2(n)⌋ + 1)
Can anyone point me to the right direction?