[tech-spec] Re: Random Number Generation

  • From: "Daniel Flam" <daniel@xxxxxxxxxxxxxx>
  • To: <tech-spec@xxxxxxxxxxxxx>
  • Date: Fri, 3 Dec 2004 14:50:53 -0500

Be ware of built in random number generators They are usually terrible!

If you plot a XY plot of one number after another youll see they are not
"random" at all.
You must use a cryptographic level random number generator to produce number


How about install Math::TrulyRandom and use it

----- Original Message ----- 
From: "Andrew Moe" <moebot@xxxxxxxxxxx>
To: <tech-spec@xxxxxxxxxxxxx>
Sent: Friday, December 03, 2004 2:36 PM
Subject: [tech-spec] Random Number Generation

> I'm doing several studies on random trading in the markets and wish to
> sure I'm getting a true proxy for randomness.  Currently using perl's
built in
> rand function like this:
> $number = int(rand(100));
> Gives a random number between 1 and 100.
> Using this function over a large number of simulations, a random trader's
> average trade converges to the vig/trade or to 0 with no vig - as one
> expect, so it seems I'm getting good randomness.  However I realize the
> limitations of the rand function and am wondering if anyone here has a
> method. Or is this type of rand function sufficient for an analysis of
> trading?
> Andrew Moe

Other related posts: