How many of the 1024 integers in the set (1024, 1025, 1026, . . . , 2047) have more 1’s than 0’s in their binary representation?

60 Views Asked by At

How many of the 1024 integers in the set {1024, 1025, 1026, . . . , 2047} have more 1’s than 0’s in their binary representation?

1

There are 1 best solutions below

0
On

These numbers are of the form $n = 1XXXXXXXXXX$, where $X$ can either be a $0$ or a $1$. So, the equivalent question here is, how many $10$-digit binary numbers have at least as many $1$'s as $0$'s? If and only if this is the case, the the number $n$ will have more $1$'s than $0$'s.

Let's split this into two cases: 1) how many $10$-digit binary numbers have as many ones as zeroes? and 2) how many $10$-digit binary numbers have more ones than zeroes?

  1. We must have $5$ zeroes and $5$ ones, so there are ${10 \choose 5} = 252$ ways to organize them in distinct orders.
  2. There are $1024$ ten-digit binary numbers, and since there are $252$ numbers with equal number of zeroes and ones, there must be $1024-252=772$ numbers with a non-equal number of zeroes and ones. But wait... would it make sense if there were more numbers with more zeroes than ones than the other way around? No! So by symmetry, we conclude that there must be $772/2 = 386$ numbers with more ones than zeroes.

Adding these two cases together, we have $252 + 386 = 638$ numbers in this range that have more ones than zeroes.