Yes, you are correct about each separate case, but to find the number of bit strings of length $8$ that either start with two zeros or end in a one (or both), we cannot simply *add* the two counts and say "we're done." We can use the sum rule, but with modifications:
If we add the counts $2^6 + 2^7$, we need to also account for having double counted those bit strings which both start with two zeros and end in a one: Subtract that number of strings from the sum, and you'll have your answer.
Clarification: The number of bit strings of length 8 of the form 0 0 x x x x x 1
will have been counted $(1)$ in the first total of all strings of the form 0 0 x x x x x x
, and $(2)$ it will have been counted in the second total of all strings of the form x x x x x x x 1
. So we need to subtract the number of strings of the form 0 0 x x x x x 1
from the combination of the first count and second count, so that they are only counted once.
So, we count the number of bit strings of the form: 0 0 x x x x x 1
,
and just as you computed the first two counts, we see that there are $2^5$ such strings which have been counted twice, so we will subtract that from the sum of the first two counts.
Total number of bit strings that start with two zeros $(2^6)$ or end in a one $(2^7)$ or both ($2^5$):
$$ 2^6 + 2^7 - 2^5$$
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$.
Best Answer
No, because you have counted $00X111$ twice. It qualifies both ways. You need to subtract out one set.