Randon Number Generator
March 5, 2003 at 9:24 am #31631
Simon HartMember@Simon-Hart Include @Simon-Hart in your post and this person will
be notified via email.
What is linear-congruential method for pseudo-random number generation? and what are the possible flaws with using such a method? A data base I am looking at uses such a method, based on Visual Basic which generates pseudo-random numbers according to a specific algorithm. Are there any possible problems with using such a method, or things that I should be cautious of?0March 5, 2003 at 5:27 pm #83527
Robert ButlerParticipant@rbutler Include @rbutler in your post and this person will
be notified via email.
The linear congruential method is also known as the simple multiplicative congruential method. The basic method generates a series of pseudo random numbers using residuals obtained from division. The problem with the method is that the random numbers will exactly repeat after a given number of computations. How long the string of random numbers is before it repeats is a function of the size of the initial seed number, the choice of the modulo, and the choice of the multiplier.
It was only when attempting to study the generation of random 3 dimensional points that serious problems with the cycling of this method was discovered. The first attempt at correcting this problem involved work done by Marsaglia in 1968. Marsaglia and Bray built a composite generator that was a mix of three congruential generators- hence the mixed congruential method to correct this problem.
Unless you are trying to generate 3 dimensional random numbers the pseudo random sequence that you get from the linear method will probably be fine. The program probably has warnings concerning the minimum size of the seed, multiplier, etc. and if you observe those cautions you shouldn’t have any trouble.
If you are concerned about the sequence that your program generates there are a number of tests for randomness that you can apply to the final sequence. If you are going to test the sequence for randomness you will need to decide on the test beforehand. This is necessary since a sample of numbers, no matter how random, cannot be expected to pass a large number of statistical tests at an arbbitrary level of significance.
If you want more details you might check pp.20-22 of Quality Control and Industrial Statistics by Duncan and pp.354-355 of Methods for Statistical Analysis of Reliability and Lif Data by Mann, Schafer, and Singpurwalla.0
The forum ‘General’ is closed to new topics and replies.