I've been having some trouble with what I thought at first should be quite a simple problem.
I have n events in total and they can only be 0 or 1 (so it's a binomial). Lets say the probability of a single event being equal to 1 is X [and therefore $P(1)=X$ and $P(0)=1-X$].
I'm only interested in situations where 2 adjacent events are equal to 1. i.e. $P(11), P(110), P(011), P(111)$ but not $P(101)$ because the events equal to 1 are not adjacent.
I'm trying to find how the probability of having at least 2 adjacent events out of n total.
So far I've managed to get to $n=5$, but i'm struggling to find a solution to the general problem
$n=3, P=X^3 + 2(X^2)(1-X)$
$n=4, P=X^3 + 4(X^3)(1-X) + 3(X^2)((1-X)^2)$
$n=5, P=X^4 + 5(X^4)(1-X) + 9(X^3)((1-X)^2) + 4(X^2)((1-X)^3)$