[Haskell-beginners] Re: uses of random number generators

Aditya Mahajan adi.mahajan at gmail.com
Fri Jul 24 02:05:16 EDT 2009


On Thu, 23 Jul 2009, Michael P Mossey wrote:

> Hello,
>
> I have an application for random numbers. So far, in my journey with Haskell, 
> I have learned basics and a few things about monads, and I was hoping I could 
> get some guidance how to employ random # gens.
>
> I need to run some simulated experiments to calculate some statistics by a 
> Monte Carlo method.
>
> Can I get a few examples or pointers? I believe I will have to run this in a 
> State monad or the IO monad, will I not?

Have a look at the monte-carlo monad: 
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/monte-carlo

For example usages see 
http://quantile95.com/2008/12/31/monte-carlo-poker-odds/ and 
http://randomdeterminism.wordpress.com/2009/01/06/monty-hall-problem-using-monte-carlo-simulations/

Aditya



More information about the Beginners mailing list