I have trouble figuring out these types of problems. Could someone help me out, with the different ways to answer it?
How many bit strings of length six contain three consecutive 1’s?
P.S i thought this recurance relation would be an-1+1 but that is counting out a lot of different factors
We interpret three consecutive $1$'s as meaning at least three.
The string of at least three consecutive $1$'s could begin at the left end. Then the last three can be filled in $2^3$ ways.
The string could begin in the second position. So there is an initial $0$, then three consecutive $1$'s. The rest can be filled in $2^2$ ways.
The string could begin in the third position. So the first entry can be chosen in $2$ ways, then we must have a $0$, then three consecutive $1$'s, with $2$ choices for the last bit, for a total of $2^2$.
Finally, the string could start at position $4$, so a $0$ in position $3$, and the first $2$ entries arbitrary, for a total of $2^2$.