in reply to Re^2: Randomizing Large Integers
in thread Randomizing Large Integers
I'm assuming you're on a Win32 system (you mention >32k integers. Win32 CRT rand is limited to 15-bits of output. Most other systems (*nix at least) have 48-bit rands in their CRTs). If that assumption is correct, you might be able to bypass the compiler issue by doing a binary install from PPD.
You don't indicate how rigourous your random requirements are, but the problem with deriving more bits of randomness from less is that the process invariably acts to compound the flaws in the underlying PRNG. If you plot the values from the Win32 Perl rand function on a 2D grid (jpg or png) and increment the color of the pixel each time you generate the same value, you very quickly see distinct banding appear where the distribution of the output is very non-uniform. If you combine random values from a flawed PRNG in an attempt to increase teh number of bits, it almost invariably compounds the banding effect and leads to a highly skewed output distribution.
Essentially, you cannot manufacture more bits of randomness, only re-use the existing ones, and that leads to a Doppler effect. The rarified (below random chance) parts of the distribution tend to get further rarified, whilst the above average parts of the distribution tend to combine and reinforce each other leading to very uneven distributions.
Maybe this doesn't affect your application, but if your algorithm depends upon an even distribution for its operation (eg. Monte Carlo Simulations), then you'd be well advise to seek a good PRNG up front rather than discovering that you are skewing your results from the outset.
|
|---|