Problem: Let n be a positive integer. A number is randomly chosen from 1 to 2^n. The probability that it has exactly 6 zeroes in its binary representation is 1989/16384. What is n?
Solution: For n≥7, the number of integers from 1 up to 2^n that has exactly 6 zeroes in its binary representation is (nC7). This can be seen by observing that among n candidates (for places of 0's and 1's), we need to select 7 places, 1 for the leading digit 1 and 6 more after that for the 6 zeroes. So, we get (nC7)/2^n=1989/16384. By looking at the denominators, we notice that n≥14. Since 1989 is a multiple of 9, we get n=15 as the smallest possible n. But checking this, we see it doesn't work. The next smallest n is n=18, which works since (187)=9×13×16×17=1989×16. So n=18.
The correct answer is: 18
My Question: I don't understand why you have to do nC7 and not nC6 since you are choosing 6 zeroes.
Starting with $n$ potential bits:
ooooooooooooooooooChoose $7$ bits: (You are choosing $6$ bits to be $0$s and $1$ bit to be the leftmost $1$)
The leftmost will be a $1$, the other $6$ will be $0$s
oo1o00o0o0o0ooo0oOf the remaining bits, those to the left of the $1$ will be dropped, and those to the right will be $1$s
..110010101011101