edited by
5,814 views
3 votes
3 votes

How many bit strings of length ten either start with a $1$ bit or end with two bits $00$ ?

  1. $320$
  2. $480$
  3. $640$
  4. $768$
edited by

2 Answers

3 votes
3 votes

Answer - (3) 640

 

The problem can be divided into two parts,

Part 1 - No. of bit strings of length 10 that start with bit 1.

So, the strings will be of the form

1 _ _ _ _ _ _ _ _ _

which means $9$ empty places to fill with either $0$ or $1$, hence $2^9$ ways.

 

Part 2 - No. of bit strings of length 10 that end with two bit zeros. 

Now, we have already counted the strings that end with two bit zeros in the part 1, but all those strings were starting with a bit 1. So, we still haven't counted the bit strings that start with a zero, and end with two zeroes. So, such strings will be of the form 

0 _ _ _ _ _ _ _ 0 0

which means 7 empty places to fill with either 0 or 1, hence $2^7$ ways.

Hence, total no. of ways = Part 1 + Part 2 (because OR)

$ = 2^9 + 2^7$

$ = 2^7 (2^2 + 1)$

$ = 2^7 (5) = 640$

 

One more way to solve this would be,

Let, $N_A$ = No. of bit strings of length 10 that start with 1 = $2^9$

$N_B$ = No. of bit strings of length 10 that end with two zeros = $2^8$ 

So, $N_{A \cap B}$ = No. of bit strings of length 10 that start with 1 and end with two zeros = $2^7$

Now, by inclusion-exclusion principle, 

No. of bit strings of length 10 that start with 1 OR end with two zeros,

$N_{A \cup B} = N_A + N_B - N_{A \cap B} = 2^9 + 2^8 - 2^7 = 2^7 (4 + 2 - 1) = 2^7 \cdot 5 = 640.$

1 votes
1 votes

According to the principle  of mutual inclusion-exclusion:

The number of strings either start with a $1$ bit or end with two bits $00 = 2^{9}+2^{8}-2^{7} = 640$

edited by
Answer:

Related questions

2 votes
2 votes
2 answers
1
Arjun asked Jul 2, 2019
7,153 views
How many ways are there to place $8$ indistinguishable balls into four distinguishable bins?$70$$165$$^8C_4$$^8P_4$
4 votes
4 votes
1 answer
2
Arjun asked Jul 2, 2019
6,046 views
How many cards must be selected from a standard deck of $52$ cards to guarantee that at least three hearts are present among them?$9$$13$$17$$42$
2 votes
2 votes
1 answer
3
Arjun asked Jul 2, 2019
2,790 views
Consider the Euler’s phi function given by$$\phi(n) = n \underset{p/n}{\Pi } \bigg( 1 – \frac{1}{p} \bigg)$$where $p$ runs over all the primes dividing $n$. What is t...
0 votes
0 votes
0 answers
4