How to solve non-homogeneous recurrence relation?

436 Views Asked by At

The relation is

$$T(n) = T(n-1)+T(n-2)-T(n-3)+1 \quad \quad (1)$$

I tried in this way but stuck at a point . Please Help

$$T(n+1) = T(n)+T(n-1)-T(n-2)+1 \quad \quad (2)$$

Subtracting $(2)$ from $(1)$ we get

$$T(n+1) = 2T(n)-2T(n-2)+T(n-3) \quad \quad (3)$$

characteristic equation is

$$r^4 -2r^3 + 2r - 1 = 0$$

$$(r-1) (r^3-r^2+r+1) = 0$$

now I am unable to find roots of cubic equation ..... Please help or suggest the correct solution. Thanks!

1

There are 1 best solutions below

4
On

The characteristic equation $r^4-2r^3+2r-1=0$ is $(r-1)(r^3-r^2\ominus r+1)=0$ (note the minus sign denoted by $\ominus$, where you used a plus), that is $(r-1)^3(r+1)=0$.

This proves the solutions are $T(n)=A+Bn+Cn^2+D(-1)^n$ for some suitable constants $(A,B,C,D)$, and surely you can finish from here...