- #1
evinda
Gold Member
MHB
- 3,836
- 0
Hello! (Wave)
I have to solve the recurrence relation
$$T(n)=\left\{\begin{matrix}
3T\left (\frac{n}{4} \right)+n & , n>1\\
1 &, n=1
\end{matrix}\right.$$
and prove by induction that the solution I found is right.
I found that the solution of the recurrence relation is $T(n)=O(n)$.
I started proving it like that:
But, then I noticed that we do not have a formula for $T \left ( \frac{n}{4} \right)$ when $n<4$ and also when $n \neq 4^k$.
So, do we have to suppose that $n \geq 4$ and $n=4^k$ ? (Thinking)
If so, at which point of the proof, do I have to claim it? (Thinking)
I have to solve the recurrence relation
$$T(n)=\left\{\begin{matrix}
3T\left (\frac{n}{4} \right)+n & , n>1\\
1 &, n=1
\end{matrix}\right.$$
and prove by induction that the solution I found is right.
I found that the solution of the recurrence relation is $T(n)=O(n)$.
I started proving it like that:
- $n=1: T(1)=1 \leq c \cdot 1 \checkmark \text{ for } c \geq 1$
- We suppose that for any $m$, $2 \leq m <n , n>2$: $T(m) \leq c \cdot m$.
- We want to show that the claim stands for $n$.
But, then I noticed that we do not have a formula for $T \left ( \frac{n}{4} \right)$ when $n<4$ and also when $n \neq 4^k$.
So, do we have to suppose that $n \geq 4$ and $n=4^k$ ? (Thinking)
If so, at which point of the proof, do I have to claim it? (Thinking)