I want to solve the following difference equation:
$$b_n-b_{n-1} = \frac{1}{8}(1-b_{n-3})$$
I tried to solve it similar to the solution of Fibonacci sequence here, but when I try to assume the solution will be of the form $l^n$, I end up with the following polynomial:
$$l^{n-3}(l^3-l^2+\frac{1}{8}) = \frac{1}{8}$$
Unlike in the Fibonacci sequence, we don't get a polynomial equation that can be easily solved and independent of $n$.
Any other strategy to solve this?
The reason I care about this difference equation is that it describes the probability I will get two consecutive heads on the $n$th toss of a fair coin.
Let $a_n$ be the probability that I'll reach two consecutive heads on the $n$th toss.
We know that at the time when I reach my goal on the $n$th toss, the last two tosses I saw would have both been heads.
Also, the third-from-final toss would have had to be a tails (otherwise, I would have won one toss earlier). The probability of this sequence of THH is $\frac{1}{2}\times \frac{1}{2} \times \frac{1}{2} = \frac{1}{8}$.
Before these three tosses, my probability of winning would have been by definition, $a_{n-3}$. But if I am to win in the $n$th toss, I need to exclude that event. And similarly $a_{n-4}$ and so on. This means:
$$a_n=\frac{1}{8}\left(1-\sum_{i=1}^{n-3} a_i\right)$$
Now let's define:
$$b_n = \sum_{i=1}^{n} a_i$$
which represents the probability you would have won by the $n$th toss.
Plugging this equation into the previous one we get:
$$b_n-b_{n-1} = \frac{1}{8}(1-b_{n-3})$$
The homogeneous part of $b_{n}−b_{n−1}=\frac{1}{8}(1−b_{n−3})$ is given by: $$8b_{n}-8b_{n-1}+b_{n-3}=0$$
So the characteristic equation is given by:
$$8l^3-8l^2+1=0$$
The roots are given by $l=\frac{1-\sqrt{5}}{4}, \frac{1+\sqrt{5}}{4},\frac{1}{2}$
And the answer can be taken as a constant: $b_n=c$. Substituting in $$8b_n+8b_{n-1}-b_{n-3}=1$$ We have $c=\frac{1}{15}$
Therefore the general solution can be written as:
$$b_n=\sigma_1\left(\frac{\sqrt{5}+1}{4}\right)^n+ \sigma_2\left(\frac{1-\sqrt{5}}{4}\right)^n+\sigma_3\left(\frac{1}{2}\right)^n+\frac{\sigma_4}{15}.$$
And for the two consecutive heads problem, we can use the first few values in the sequence $b_n$ in particular, $b_0=0$, $b_1=0$, $b_2=0.25$ and $b_3=0.375$ to get $\sigma_1 = -1.1708$, $\sigma_2=1.708$, $\sigma_3=0$, $\sigma_4=15$