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 [1]. 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 [2].

**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

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:

Bitwise exclusive-or (XOR) | |

& | Bitwise AND |

Shift bits to the left by b | |

Shift bits to the right by b |

Manipulating the binary representation of a number causes less correlation and a larger degree of recurrence,

In this equation,

where

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 [6].

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 [7]. 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 [8].

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 [9].

###### 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.

###### References

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

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

[3] 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].

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

[5] M. Shema, *Hacking Web Apps*, Newnes, 2012.

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

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

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

[9] 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.

I’m doing an MSci in Physics with Theoretical Physics. I’m interested in quantum field theory, quantum computing, general relativity and complexity & network science. When I’m not studying or rushing that assignment due tomorrow, I’m sketching or playing cricket.