0
$\begingroup$

So for the first case (beginning with 2 $1's$) there are: $2*2*2*2*2=32$ ways

Second case (end with three $1's$): $2*2*2*2=16$

And then we can just sum it $32+16=48$ different bit string of length 7 that begin with 2 $1's$ or end with 3 $1's$

$\endgroup$
1
  • $\begingroup$ Need to subtract the overlap (starts 11, ends 111), you have those twice. $\endgroup$ – vonbrand Apr 17 '14 at 0:40
1
$\begingroup$

Your use of the phrase "either" is ambiguous. Can a String starting with two $1$'s not end with three $1$'s? If so, then your count is $2 * 2 * (2^{3} - 1)$ (characters 3-4 can have either $0$ or $1$, characters $5-7$ we remove the case of $111$. So there are $2^{3} - 1$ ways then to form binary strings of length $3$ that are not $111$).

For your second case, I assume that the string doesn't start with $11$. And so there are $2^{2} - 1$ ways of placing the first two characters. The last three are fixed, and so we have $2^{2} * (2^{2} - 1)$ ways of forming your string.

So by rule of sum, you add disjoint cases: $2^{5} - 2^{2} + 2^{4} - 2^{2} = 40$.

If these cases are not disjoint, then your answer is $44$.

$\endgroup$
1
$\begingroup$

You are double-counting those strings which both begin with two $1$'s and end with three $1$'s. You need to subtract these $4$ strings from your total of $48$. The correct answer is thus $44$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.