A cool problem!

What is the sum of all the 10 bit binary strings in which no three consecutive bits are the same ?

  • Binary strings consists of only zeroes and ones
  • Add the binary numbers as if they were decimal numbers. E.g. 1 + 10 + 11 = 22 1 + 10+ 11 = 22 .


The answer is 98888888879.

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.

1 solution

Alan Yan
Sep 15, 2015

We will first find the number of 10 10 digit binary strings. Let a n = number of n digit strings with 1 in the leftmost slot a_n = \text{ number of n digit strings with 1 in the leftmost slot} b n = number of n digit strings with 0 in the leftmost slot b_n = \text{ number of n digit strings with 0 in the leftmost slot}

We know that a n = b n 1 + b n 2 a_n = b_{n-1} + b_{n-2} since the leftmost part of a string that ends in 1 1 can start in two ways. Either 10 10 or 110 110 . In the former, it is just b n 1 b_{n-1} and just appending one 1 1 . In the later, it is just b n 2 b_{n-2} and just appending two 1 1 's. Similarly, we know that b n = a n 1 + a n 2 b_n = a_{n-1} + a_{n-2} . We will let X n = a n + b n = total number of n digit strings X_n = a_n + b_n = \text{ total number of n digit strings} .

By adding the two recursions we have, we get that X n = X n 1 + X n 2 X_n = X_{n-1} + X_{n-2}

We know that X 1 = 2 X_1 = 2 because we have 0 0 and 1 1 .

We know that X 2 = 4 X_2 = 4 because we have 00 00 , 01 01 , 10 10 , 11 11 .

To check our recursion, we have X 3 = 6 X_3 = 6 , because there are 2 3 2^3 ways without restriction, then we subtract two for the extraneous strings which are 111 111 and 000 000 . Therefore we have X 3 = 6 X_3=6 .

We continue from here.

X 1 = 2 X_1 = 2 X 2 = 4 X_2 = 4 X 3 = 6 X_3 = 6 X 4 = 10 X_4 = 10 X 5 = 16 X_5 = 16 X 6 = 26 X_6 = 26 X 7 = 42 X_7 = 42 X 8 = 68 X_8 = 68 X 9 = 110 X_9 = 110 X 10 = 178 X_{10} = 178 .

Therefore we know that there are 178 178 valid 10-strings. Now notice that for the k t h k^{th} 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 178 / 2 = 89 178/2 = 89 ones. (Zeroes do not matter because they sum to zero.)

Therefore, our answer is just 1111111111 89 = 98888888879 1111111111 \cdot 89 = \boxed{98888888879} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...