Pseudorandomness

From TheAlmightyGuru
Jump to: navigation, search
Pixels plotted using a pseudorandom algorithm to determine their color.

Pseudorandomness describes anything which appears to be random, typically a sequence of numbers, but is actually determined, and, therefore, predictable when the generation process is known. Pseudorandom numbers are usually generated with an algorithm, and many have been conceived of over the years. In order to appear random, the results should be statistically random across a large sample, that is, the numbers should be equally spread across their range and not patterned. In information theory, pseudorandomness is often contrasted against true randomness which cannot be predicted.

Generating random numbers is important to many different fields including data sampling, simulating systems, cryptography, and games of chance. While the study of randomness predates history, the study of using algorithms to generate pseudorandom numbers didn't began until the mid-1900s.

Any time you see randomness in a video game or computer program, it is most likely pseudorandomness and not true randomness.

Personal

When I first started programming around the age of 10, I used the RND function in GW-BASIC to generate pseudorandom numbers. Most likely the first program I used was copied from a book and included the command RANDOMIZE TIMER to get an unpredictable seed. However, I do remember being surprised when I didn't include the command the numbers were the same every time I ran the program. At the time I didn't give it much thought and just always remembered to start my programs with that command. However, in high school I learned more about how seed values worked and that pseudorandom number generators were entirely determined. I still didn't understand the algorithms which generated them, but I at least knew that they didn't actually generate "true" random numbers. Later in life, as I started hacking programs, I discovered I could feed in specific seed values to programs in order to force specific "random" numbers, and I became more interested in the cryptographic side of randomness. At age 42, I started becoming interested in the actual algorithms used to generate pseudorandom numbers and started programming my own based on the algorithms.

Although I like the idea of true randomness, I actually prefer pseudorandomness because I think it's a more complex and interesting problem.

Pseudorandom Number Generators

Media

PBS - How to Generate Pseudorandom Numbers.

Links

Link-Wikipedia.png