# How Random is Random?

Feb 7, 2022 Viraj Patel

###### Introduction

Having completed the Computational Physics module last term, I wanted to investigate further into the importance of random numbers in physics and how true random numbers can be generated. In this article, I will discuss the main types of random numbers and their applications in physics.

There are many areas of physics that employ the use of randomness, especially in Computational Physics, an area that specialises in simulating physical processes as realistically as possible. In statistical physics and quantum physics, many processes are believed to be stochastic, so mathematical and computational models must be treated as such . The main issue that we face today is: are these random numbers that we generate random enough? We are currently facing this issue in quantum computing, as scientists are trying to find ways to improve the security of encryption algorithms. One of the most common cracking techniques exploits the fact that computer generated random numbers can be backtracked to find the encryption key . Figure 1: A Gaussian random walk (Source: https://bookdown.org/probability/bookdown-demo/random-walks.html)
###### Pseudo random numbers

You are probably most familiar with pseudo random numbers. These are a sequence of numbers with very little correlation, and there are many algorithms that can achieve this. The most basic one being a linear congruential generator (LCG): This is an iterative function where the “mod” operation is the (modulo) remainder operation. The constants and are chosen by the system, and the initial value is known as the seed. The biggest issue with the LCG is that, at best, it repeats every iterations. Setting to a very large number reduces the effect of this problem, but can cause the generator to run slowly for larger sequences .

The Mersenne Twister (MT) is a better pseudo random number generator than the LCG. It is widely used in programming and is, in fact, the default random number generator in Python and R. Rather than purely using mathematical operations, as in the LCG, the MT algorithm uses bitwise logic operators:

Manipulating the binary representation of a number causes less correlation and a larger degree of recurrence, . The algorithm is as follows: In this equation, is the rightmost (arbitrary constant) bits of , is the leftmost ( is the number of bits to represent a number) bits, the pipe symbol represents concatenation, and A is a matrix defined as follows: where is the bottom row of . This algorithm has been made in such a way that, if given a 32-bit number, it cannot output the subsequent 32-bit number, which leads to a very high degree of unpredictability .

Pseudorandom numbers might seem pointless, given that they are periodic and the sequence can be determined from the seed (starting value(s)). However, for the purpose of simulation, these properties are desirable. If one needed to compare different simulations of the same stochastic process, a fair test would require all simulations to have the same input. True random number sequences can’t be reproduced, but pseudorandom sequences can.

###### True random numbers

As discussed previously, pseudorandom numbers aren’t truly random, just very uncorrelated. Pseudorandom number generators (PRNGs) use mathematical and logical operations to generate numbers that may be used to simulate a stochastic physical process. In contrast, true random number generators (TRNGs) use measurements of real physical processes as random numbers .

These physical processes can vary from the time between keystrokes by a user of a device, to a radioactive decay. In fact, radioactive decays are used quite often as they are completely unpredictable and they can be easily detected. Another, very creative, TRNG is called LavaRnd, which uses the random motion of lava lamps to produce random numbers, it also happens to be one of the most secure random number generators that is used in cryptography . Although these methods are useful, they require expensive and extensive apparatus to detect and make measurements. There are cheaper methods that still use the entropy of natural phenomena. One of the most common methods measures atmospheric noise using a simple radio. The disadvantage of this is that the fan from the device you may be working on can cause periodic (yet predictive) variations in atmospheric noise, reducing the randomness of the sample.

Another common method used by physicists is laser-based generation. There are different ways to produce laser-based generators, one is having two photons race each other, with the faster one representing the chosen value of a binary random number generator. Photons travel at the speed of light but may have slight variations in their speed due to the environment they are in, which is purely random. Physicists have also generated random numbers by measuring the varying intensity of a chaotic laser, with this generator being one of the fastest random number generators available .

The benefit of using true random numbers lies in what they are used for. In Monte Carlo processes, it is common to use a Maxwell-Boltzmann distribution to draw pseudorandom numbers from. To do this, the computer will have to perform some intermediate steps to convert a uniform distribution into the desired distribution. If the computer was able to draw measurements from a thermodynamic system, not only would these numbers be truly random, but they would automatically follow the Maxwell-Boltzmann distribution .

###### Conclusion

We have discussed the two main types of random numbers: pseudorandom numbers and true random numbers. There are some more types of random numbers but they generally fall into one of these two categories. For example, quasi-random numbers can be classified as pseudorandom and quantum random numbers are just true random numbers generated by measurements of a quantum system. Despite pseudorandom numbers being periodic, we found that this could help for simulations, but could pose as threats to cybersecurity. Moreover, true random numbers cannot be reproduced, but they are also difficult and often expensive to generate in the first place. Random numbers and randomness have many applications to other areas of physics, including complexity science, and it will be interesting to see how we can improve random number generating algorithms and processes in the future.

 N. Metropolis, “The Beginning of the Monte Carlo Method,” Los Alamos Science, no. Special, pp. 125-130, 1987.

 N. Metropolis, “The Beginning of the Monte Carlo Method,” Los Alamos Science, no. Special, pp. 125-130, 1987.

 D. D. Johnson and D. M. Ceperley, “Generation of Random Numbers,” 2001. [Online]. Available: https://courses.physics.illinois.edu/phys466/sp2013/lnotes/random_numbers.html. [Accessed 14 January 2022].

 A. Jagannatam, “Mersenne Twister – A Pseudo Random Generator and its Variants,” George Mason University, Department of Electrical and Computer Engineering, 2008.

 M. Shema, Hacking Web Apps, Newnes, 2012.

 M. Haahr, “Introduction to Randomness and Random Numbers,” June 1999. [Online]. Available: https://www.random.org/randomness/. [Accessed 26 January 2022].

 LavaRnd Number Generator, “LavaRnd,” 2000. [Online]. Available: http://www.lavarnd.org/lavarnd.html. [Accessed 26 January 2022].

 D. F. DiCarlo, “Random number generation: Types and Techniques,” 2012.

 Y. Ilan, “Generating randomness: making the most out of disordering a false order into a real one,” Journal of translational medicine, vol. 17, no. 1, pp. 1-12, 2019.