Solve the following recurrence equation exactly:
$$T(1) = a, T(2) = b$$ $$T(n) = T(n–2) + c$$
I'm not sure what this is asking, can someone provide some insight?
Solve the following recurrence equation exactly:
$$T(1) = a, T(2) = b$$ $$T(n) = T(n–2) + c$$
I'm not sure what this is asking, can someone provide some insight?
On
If we take one case as $n$ is an even number, then let $n=2k$.
$$\begin{align} T(n) = T(2k) =& T(2k-2)+c\\ =& [T(2k-2-2) + c] + c\\ =& \{[T(2k-2-2-2) + c] + c\}+c\\ =& T(2k-3\times2) + 3c\\ =& T(2k-h\times2) + hc &\text{by induction}\\ \end{align}$$
Now, if you take an appropriate $h$ such that $T(2k-2h$) is a known value, then you can find a close form for $T(n)$, for even $n$.
The other case is similar.
It means that you are to find a function $f(n,a,b,c)$ such that $T(n) = f(n,a,b,c)$. This article on wiki has several techniques that will help you to find this solution.