Comment

Comment by EGreg

Of course it does, because there is going to be a maximum of the range A, B. Even if the maximum itself would have a uniform distribution, the fact is that all numbers drawn from the samples will be below it.

So the probability that the number starts with a 5 (in decimal representation) is sort of like the probability of the sum over all N of:

(Maximum > N) (Number starts with 5 given that Maximum is N)

The thing is that when N is anything less than 9,999 etc. the second probability IS NOT 1/10. It is skewed towards the lower numbers due to the most significant digit being less than 9 more frequently!!!

So this is the real explanation. And I just came up with it on the spot while writing this. Yay!

Hehe

parent EGreg 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton