Binary String’s set of elements

binarycombinatorics

Example: How many 7-digit binary strings have three 1's?
Answer: $ { 7 \choose 3} = 35 $

definition of $ { n \choose k} $ : If n and k are integers, then $ { n \choose k} $ denotes the number of subsets that can be made by choosing k elements from an n-element set.

According to the above definition, $ { 7 \choose 3} = \frac{7!}{3!4!} = 35 $

My difficulty: in the example we're choosing 3 elements from from a 7-element set, however what is this 7-element set?

I thought about this because when we calculate 7! , it means we have some set of 7 elements, and in this example's case we have a binary string, which is composed of the set { 0 , 1 } , i.e. a 2-element set and not a 7-element set.

Best Answer

You can think of it this way: Your seven-element set is $\{1, 2, 3, 4, 5, 6, 7\}$, corresponding to the indices of the digits which form your string (i.e., $3$ corresponds to the third digit).

Now you choose three elements out of this set, corresponding to the spots of your string where a "one digit" should appear. (This is a binary decision, meaning that the other elements are "zero digits".)