Random number generator

Myron W. Chew (myron@seas.ucla.edu)
Fri, 17 Nov 95 14:39:55 -0800


There are many algorithm to generate random number in Computer. One example
is using the Linear Congruential random number generator. Initially, the
user supplies an initial integer value for SEED. On each call to the random
number generator a new value of seed is calculated by taking the current
value of seed, multiplying by A, adding C, and taking the remainder Mod M of
the
result. The new value of seed is an integer between 0 and M-1. This new
value of seed is then converted in to a floating point value between 0
inclusive and 1 exclusive by dividing SEED by M. The result X is returned as
a floating point random number in the range [0,1]
Seed = (A*Seed+C)Mod M; X=Seed/M

Since there is an algorithm to generate a random number, I don't think
computer generated numbers are purely random. Well, of course depend on
how you define "purely random".



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.