Pseudo-Random Numbers
CSEF · 2007 Mathematics & Software Honorable_mention Award
Overview
Objectives/Goals I analyzed the quality of several random number generation algorithms and tested which constants performed best in some of the algorithms. The quality of pseudo-random numbers is crucial to the accuracy of a Monte Carlo simulation and the security of encrypted documents. Methods/Materials In my experiment I generated and tested sequences from different algorithms with a program I created in Visual Basic. To evaluate the randomness, I calculated pi with the Monte Carlo method, found the length of the period until the sequence repeats, and I calculated the average. I also measured the effect of changing the constants of the algorithm on the output sequence. Results Blum Blum Shubwas best overall because it was best on the most important tests although it was fifth on the test of the average. I was wrong in my prediction that it would be best at all of the tests. The several versions of the lagged Fibonacci generator performed differently. The exclusive-or version did worst on all of the tests. The multiplication version had repetition but did well on the Monte Carlo pi test and the mean test. The addition version had no repetition, did tolerable on the Monte Carlo pi test, and did well on the mean test. The subtraction version did satisfactory on all the tests although it was not the best. The Middle square method is not very good, because it repeats, sometimes very quickly. The Linear Congruential algorithm is very bad because although it calculated close to pi and doesn't repeat quickly, when points are graphed from the random numbers, they create a non-random pattern. My hypothesis was wrong in that the repetition did not always get consistently longer with larger values for M in the Blum Blum Shub formula. For powers of ten, the repetition period was five times larger than the previous power. I also found out that prime numbers seemed to do better than non-prime numbers even when they were close in value. In the Middle Square formula, contrary to my hypothesis, the repetition length was not directly proportional to the number of digits in the output. Conclusions/Discussion Different tests gave different algorithms the varying ratings. I believe that the most important tests were the repetition test and the Monte Carlo value of pi test.
Summary statement
I analyzed the quality of several random number generation algorithms and tested which constants performed best in some of the algorithms.
Help received
I received no help
Awards (1)
- Honorable Mention
Competition history
- CSEF 2007
Resources
Related projects
CSEF · 2007
A Pseudorandom Number Generator Based on a Suggestion by John von Neumann
CSEF · 2009
Efficient True Random Number Generation
CSEF · 2013
The Randomness of Humans and Computers
CSEF · 2008
Generating Random Numbers
ISEF · 2014
Comparison of Common Linear Pseudorandom Number Generators
CSEF · 2006
What Is the Probability that Probability Is Correct? Can a Computer Generate Random Numbers Accurately?
CSEF · 2005
Looking Out for Number One: Do Random Number Generators Follow Benford's Law?
CSEF · 2006
The Effect of a Low Precision Computational Environment on Comparative Algorithm Speed for Calculating the Value of Pi
Closest projects by meaning, across every fair and year in the corpus.
Browse more like this
Source: California Science & Engineering Fair public projects