[Math] 12 bit strings with more zeros than ones

combinatorics

I'm trying to solve how many twelve bit strings have more zeros than ones. Can someone sanity check my method please?

C(12,5) = 792 +

C(12,4) = 495 +

C(12,3) = 220 +

C(12,2) = 66 +

C(12,1) = 12 +

C(12,0) = 1 =

1586 ?

Best Answer

Your method is correct (apart from the way you write it down; as written, it reads as $C(12,5)=792+C(12,4)=\ldots=1=1586$, but clearly $C(12,5)\ne 792+C(12,4)$, … and $1\ne1586$), but unnecessarily complicated. A simpler way is as follows:

There are three types of 12 bit strings:

  • Those with more zeroes than ones.
  • Those with more ones than zeroes.
  • Those with the same number of zeroes and ones.

Obviously there are $2^{12}=4096$ 12 bit strings in total. Also, the number of strings of the first two types is equal, as you get one by bit-flipping the other. Finally, the last class has $\binom{12}{6}=924$ strings.

Therefore the first class (more zeroes than ones) has $(4096-924)/2 = 1586$ elements.

Related Question