so I'm working on an algorithms assignment and am having a tough time understanding what to do:
The equation is: $$T(n) = 2T(n/4) + n = \Theta(n) = O(n)$$
Right now I have gotten this far:
$$T(1) = 1$$ This is because T(1) is constant time
Base Case = 4 so you have $$2T(4/4) + 4$$
My guess is that $$T(n) \leq c*nlogn$$
So my hypothesis is that $$T(n) \leq c*nlogn$$ $\forall n=4,...,k$
This is where I'm stuck. Trying to figure out the inductive step of the solution. I have it looking like $$T(k+1) = 2T((k+1)/4) + (k+1)$$
Am I on the right track? Any help would be greatly appreciated. I'm sorry if this isn't formatted correctly, I'm learning $\LaTeX$ and did what I could.
The recursion we are trying to solve is
$$T(n) = 2T\left(\frac{n}{4}\right)+n$$
This follows the typical form of the Master Theorem, where
$$T(n) = aT\left(\frac{n}{b}\right)+f(n)$$
and we can calculate the solution immediately as
$$T(n)=\Theta(f(n))=\Theta(n)$$
Suppose we do not have access to the Master Theorem, and we want to prove this inductively. While the inductive hypothesis $T(n) \le cn\log{n}$ is true, since we already know the solution, we can obtain a tighter bound.
Let the inductive hypothesis be $$T(n) \le cn$$ for all $n \in \mathbb{N}$ and sufficiently large $c$, which is a free constant we can identify later.
The base case is clear, since by assumption $T(1)$ is a constant.
By strong induction, let us assume the claim is true for all integers less than $n$. In particular, it is true for $n/4$. Hence
$$ \begin{align} T(n) &= 2T(n/4) + n\\ & \le 2c\frac{n}{4} + n && \text{by hypothesis}\\ & = n(\frac{c}{2}+1)\\ & \le cn && \text{for } c\ge2 \end{align} $$
which completes the proof.