algorithmmathcombinatoricscounting

Number of the binary strings that have the given number of occurrences


How many binary strings exists that have exactly five occurrences of "00", three of "10", three of "01" and three of "11" ?

I tried to solve it using induction, or simple counting methods, I also tried to prove that there only exists 1 such binary string but couldn't.


Solution

  • Since there must be exactly 14 pairs of adjacent bits, a matching string needs to be 15 bits long.

    There are only 32768 15-bit strings. Just test them all.