Bit String Combination Problem

98 Views Asked by At

How many bit strings of length 10 contain either two or seven 0's? I am not sure about how to tackle this problem because the or confuses me, am I adding the number of bit strings that have 2 0's and the number of bit strings that have 7 0's?

1

There are 1 best solutions below

1
On BEST ANSWER

Yes, you can enumerate separately the two sets and then take the sum the results.

Let $S_k$ be the set of bit strings of length $10$ that contain exactly $k$ zeros. Note that $S_0,S_1,\dots,S_n$ are all disjoint sets. It follows that "the number of bit strings of length $10$ contain either two or seven 0's" is simply: $$|S_2|+|S_7|.$$ In order to enumerate $S_k$ note that we have to count the number of ways we can choose the positions of $k$ zeros among the $10$ bits (the remaining positions will be set to $1$).