Probability and counting bit string

719 Views Asked by At

How many 10-bit strings are there subject to each of the following restrictions if the first two bits are the same as the last two bits?

My answer:

1) So for the first $2$ bits and the last $2$ bits we only have $2$ choices: either those $4$ bits are all 0s or all 1s. So $2$ choices.

2) Then we have $(10-2-2)$ $6$ bits left with $2$ choices so $6^2$.

Conclusion : $2 * 2^6$ or $2^7$

But, I just read that the solution is $2^8$ I don't understand why since 4 bits should be exactly the same

thanks

3

There are 3 best solutions below

0
On

I think you misinterpreted "first two bits are the same as the last two bits." It is possible that the first two bits are 01, and that the last two bits are 01, for example. Thus there are $4$ possibilities for these four bits, and then multiplied by $2^6$ for the remaining six bits yields $2^8$.

0
On

If the last two bits have to be the same as the first two bits, then effectively you can only vary the first $8$ bits. So: $2^8$possible bit strings

0
On

Each of the first $8$ bits can be either $0$ or $1$. Once the the first $8$ bits are determined, the last two bits must match the first two bits, so there are no remaining choices for the string. Thus, the number of strings in which the first two bits are the same as the last two bits is $2^8$