[Math] Recurrence Relation for Strassen

recurrence-relationsrecursive algorithms

I'm trying to solve the following recurrence relation (Strassen's):-
$$
T(n) =\begin{cases} 7T(n/2) + 18n^2 & \text{if } n > 2\\
1 & \text{if } n \leq 2
\end{cases}
$$
So I multiplied the $7$ by $2$ several times and the 18n^2^2 several times and ended up with this general equation:-
$$
7k T(n/2^k) + 18n^2k
$$
but, well, firstly, is this correct? and also, how do I find the value of k from that beast?!

Many thanks in advance everyone, I really appreciate all your help.

Best Answer

Write $n = 2^k$ and define $U_k = T(2^k)$. The relation beocmes

$$U_k - 7\, U_{k-1} = 18 \cdot 2^{2 k}$$

with the initial condition being

$$U_1 = 1$$

I broke the equation up into a homogeneous solution and an particular solution, then applied the initial condition, as follows:

$$U_k = H_k + P_k$$

$$H_k - 7 H_{k-1} = 0 \implies H_k = A \cdot 7^k$$

Choose $P_k = B \cdot 4^k$; then

$$B \cdot 4^k - \frac{7}{4} B \cdot 4^k = 18 \cdot 4^k \implies B = -24$$

Then $U_k = A \cdot 7^k - 24 \cdot 4^k$. Use $U_1=1$ to get that

$$7 A - 96 = 1 \implies A = \frac{97}{7}$$

The result is

$$U_k =97 \cdot 7^{k-1} -96 \cdot 4^{k-1}$$

To recover $T(n)$, substitute $k=\log_2{n}$ into $U_k$. The result is

$$T(n) = \frac{97}{7} n^{\log_2{7}} - 24 n^2$$