Discrete Mathematics – Calculating Number of Bit Strings

discrete mathematics

How many bit string of lenght 28

  • having at least one consecutive 000?
  • without consecutive 000?

I'm using ti nspire, can i do it with nCr function.

I tried to do it but i did not found a way.

thank you.

i saw this post :
Number of binary strings of length 8 that contain either three consecutive 0s or four consecutive 1s

and this one :
http://www.techtud.com/doubt/combinatorics-how-many-bit-string-length-eight-contai

but it did not help me.

Best Answer

Let $a_n$ be a bit string of length n without 000, then it can be

$a_{(n-3)}$ with 100 added at end,

or $a_{(n-2)}$ with 10 added at end,

or $a_{(n-1)}$ with 1 added at end.

So $a_n = a_{(n-1)} +a_{(n-2)} + a_{(n-3)}$

starting with $a_0 = 1, a_1=2, a_2 = 4$


The ending of any successful chain can be categorised as 1(111,101,011,001) 10(110,010) or 100.

1 can be added to any successful chain of length (n-1) no matter what it ended with.

10 can be added to any successful chain of length (n-2) no matter what it ended with.

100 can be added to any successful chain of length (n-3) no matter what it ended with.