What is the sum of all the 10 bit binary strings in which no three consecutive bits are the same ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We will first find the number of 1 0 digit binary strings. Let a n = number of n digit strings with 1 in the leftmost slot b n = number of n digit strings with 0 in the leftmost slot
We know that a n = b n − 1 + b n − 2 since the leftmost part of a string that ends in 1 can start in two ways. Either 1 0 or 1 1 0 . In the former, it is just b n − 1 and just appending one 1 . In the later, it is just b n − 2 and just appending two 1 's. Similarly, we know that b n = a n − 1 + a n − 2 . We will let X n = a n + b n = total number of n digit strings .
By adding the two recursions we have, we get that X n = X n − 1 + X n − 2
We know that X 1 = 2 because we have 0 and 1 .
We know that X 2 = 4 because we have 0 0 , 0 1 , 1 0 , 1 1 .
To check our recursion, we have X 3 = 6 , because there are 2 3 ways without restriction, then we subtract two for the extraneous strings which are 1 1 1 and 0 0 0 . Therefore we have X 3 = 6 .
We continue from here.
X 1 = 2 X 2 = 4 X 3 = 6 X 4 = 1 0 X 5 = 1 6 X 6 = 2 6 X 7 = 4 2 X 8 = 6 8 X 9 = 1 1 0 X 1 0 = 1 7 8 .
Therefore we know that there are 1 7 8 valid 10-strings. Now notice that for the k t h slot for any string, the number of strings with one in the k slot is equal to the number of strings with zero in the k slot.
This is because we can simply switch 1 to 0 and 0 to 1 to form a one - one correspondence.
Therefore, for each slot, there are 1 7 8 / 2 = 8 9 ones. (Zeroes do not matter because they sum to zero.)
Therefore, our answer is just 1 1 1 1 1 1 1 1 1 1 ⋅ 8 9 = 9 8 8 8 8 8 8 8 8 7 9 .