[Math] Discrete Mathematics- Counting Bit Strings

discrete mathematics

So I'm a little bit stuck on how to continue about this problem.
"How many bit strings of length eight do not contain six
consecutive 0s?"

So what I did first is I found the total amount of bit strings 2^8 = 256.

I know that there must be at least one string with 8 consecutive 0's, at least one with 7 consecutive 0's, and one with at least 6 consecutive 0's. But how do I find how many of each is contained without listing out all the 8 bit strings?

Thanks.

Best Answer

You are saying (correctly) that the number you are looking for is $2^8-B$ where $B$ is the number of bad strings, i.e., those containing six consecutive zeros. And to know what $B$ is you say correctly that it is the sum $B_6+B_7+B_8$, where $B_k$ is the number of $8$-bit strings containing $k$ consecutive zeros. Now, what is $B_8$ (hint: that is very easy to answer). What is $B_7$ (hint: not a large number at all, you can list all such strings). What is $B_6$ (hint: a slightly bigger number, but do you notice some symmetry?)