Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

For a random whole number, n, between 0 and 4000 billion (don't know what that's called), is the probability that n is a multiple of 4096, 1/4096?

share|improve this question
    
It sounds suspiciously specific but it's not homework, promise. It's a filesize checking thing. –  Jayraj Jul 11 '12 at 20:07
    
Almost exactly $1/4096$. Is it $0$ to $4000$ billion inclusive (both ends), or exclusive? And is it US billion or British billion? The answers to the above questions make no practical difference to the answer. –  André Nicolas Jul 11 '12 at 20:33
    
Didn't know US and British billions were different. If it matters it's 4,000,000,000 x 1000. And 0 and 4000 billion both inclusive. –  Jayraj Jul 11 '12 at 20:36
1  
Traditionally, a British billion is $10^{12}$, not $10^9$. Most of my British contacts, which are not many, are using $10^9$ –  Ross Millikan Jul 11 '12 at 20:38
    
@Jayraj If it is for a practical application, can you be certain that your $n$ is really a random whole number? For instance, executable filesizes (and a few other formats) are frequently divisible by large powers of two, far more often than any random number. –  Erick Wong Jul 12 '12 at 6:42

1 Answer 1

up vote 2 down vote accepted

If one end (either $0$ or $4000$ billion) is included, the probability is exactly $\frac 1{4096}$ as $4096=2^{12}$ and 4000 billion has at least $14$ factors of $2$ (if billion = $10^9$). If both ends are excluded, there is an error of $1$ in $4000$ billion. If both ends are included, there is an error of about $1$ in $976562500$

Added: as both ends are included, the probability is $\frac {976562501}{4000000000001}$ which is not exactly $\frac 1{4096}$

share|improve this answer
    
Didn't understand "there is an error of 1 in 4000 billion". Could you please explain? Thanks –  Jayraj Jul 11 '12 at 20:40
    
@Jayraj: If you count from 0 to 10, there are 11 numbers. The extra 1 in both the numerator and denominator accounts for the error. In fact, the error is much larger, see my edit. –  Ross Millikan Jul 11 '12 at 20:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.