[Haskell-cafe] All the random packages
alexey.skladnoy at gmail.com
Sun Jan 8 15:58:09 CET 2012
On 08.01.2012 11:18, Eugene Kirpichov wrote:
> I came across the beautiful algorithm for O(1) generation of rational
> discrete distributions http://www.keithschwarz.com/darts-dice-coins/ and
> though it'd be fun to implement it in Haskell and put on Hackage, but
> then it turned out that there's about a dozen random number packages, so
> I'm not sure to which one to contribute, or better to roll out my own
> package and encourage authors of the other packages to reference it and
> fit under their interface.
I think it was first described in the paper "Fast generation of discrete
random variables" by Marsaglia et.al. It's called squared histogram
method in the paper. Another one is quite elegand as well. They claim
claim that these algorithms are fastest.
Also I would avoid floating point numbers for following reasons. They
are tricky and difficult to reason about. Random numbers are generated
as words and conversion to float/double will inevitable lose some entropy.
> Which random number packages are considered to be most mature or perhaps
> promising - i.e., contributing to which ones will bring the community
> the most benefit?
Difficult to say. Reverse dependencies could be of interest.
> Is there any effort on unifying them going on?
I'm not aware about such thing,
More information about the Haskell-Cafe