A way to solve the recurrence relation $T_i = T_{i-1} + 2 T_{i-2} + 2^{i - 2} - (i - 2)^2$

46 Views Asked by At

Given the recurrence relation $$ T_i = T_{i-1} + 2 T_{i-2} + 2^{i - 2} - (i - 2)^2,\quad T_0 = 0,\quad T_1 = 1. $$

I need to solve it. I tried to solve the relation using generating function, but eventually I came to system of linear equations with dimension $6$.

Maybe I have to use another way to solve the relation

1

There are 1 best solutions below

3
On

The roots of the characteristic polynomial of the homogeneous part are $2$ and $-1$. To this list, we need to add $2$ again (from the exponential part of the recurrence) and $1$ three times (from the polynomial part of degree $2$). This means that the general form of the solution will be $$ T_i = (ai^2+bi+c)+(di+e)2^i+f(-1)^i $$ for some constants $a,b,c,d,e,f$. Using the first six values and solving the resulting system of linear equations yields the formula $$ T_i = \frac{i^2+i+2}{2} +\frac{3 i-14}{9} 2^{i-1} -\frac{2 }{9}(-1)^i. $$ The generating function method should work equally well and lead to the same solution.