4 ms·
The clue's here: > What is the `uniform' distribution we want, anyway? It is obviously not the uniform discrete distribution on the finite set of floating-poi
by alepper 12y ago
The clue's here:
> What is the `uniform' distribution we want, anyway? It is obviously not the uniform discrete distribution on the finite set of floating-point numbers in [0, 1] -- that would be silly. For our `uniform' distribution, we would like to imagine[*] drawing a real number in [0, 1] uniformly at random, and then choosing the nearest floating-point number to it.
Because of the logarithmic representation, there are as many floating point numbers between .25 and .5 as there are between .5 and 1. If you uniformly sample numbers with an exact, finite floating point representation then you don't get something that 'looks like' a uniform distribution of real numbers in [0, 1] -- which is more likely what was wanted.
- angersock 12y agoBingo. The ongoing mindfuck of floating point representations is that sort of non-even mapping of certain intervals.
- CamperBob2 12y agoRight, which is why I said you'd have to account for the log bias when you pick a random integer exponent. Otherwise most of your results would be really tiny. The method bhickey suggests above sounds like a nifty workaround for the problem as well.
- alepper 12y agoYou're right, sorry. I responded to 'why round?' but missed that comment.