More about Random Numbers

thanhnga la (tla@ucla.edu)
Sun, 05 Nov 95 03:03:23 -0800


It seems that there are some ways to get random numbers from computer
programs regardless that these numbers are truely random. First, study
means for generating equidistributed random numbers on (0,1). For most C
compilers, a floating-point equidistributed random variable x on (0,1)
can be obtained via:
#define DEN ((double) ((1<<31)-1))
double x = random()/DEN;
although one should always check documentation for the range of any
random() call. Above, it is assumed that random() returns an unsigned
integer that stays within the inclusive range 0 and 2^31. Second, just
pick an interesting expression and investigate its interation, such a
function as x = 1/x + a (mod p), where p is prime, a is constant. It
turns out that this is fairly effective for certain pairs (a,p).


Back to the Chatroom Homepage...

Back to the Stats 154A Homepage...

Back to the listings...

Send a message...


This archive was generated by hypermail 1.02.