In the world of computer science, mathematics, and simulations, the generation of random numbers is crucial. Many algorithms and models rely on the unpredictability of these numbers to function correctly. However, generating truly random numbers is a complex task. This leads to the question: Can the digits of Pi, the famous irrational number, be used as a reliable source of random numbers?
Pi (π), the ratio of a circle's circumference to its diameter, is an irrational number, meaning its decimal representation goes on infinitely without repeating. This seemingly endless sequence of digits has led some to wonder if it could serve as a good source for generating random numbers of Monte Carlo simulations. The idea is tempting: instead of relying on commercially available pseudorandom number generators (PRNGs) that may have known defects, why not tap into the infinite, non-repeating sequence of Pi?
While Pi appears random, it's essential to acknowledge that it isn't truly random. There are known mathematical properties and formulas, such as the Bailey-Borwein-Plouffe (BBP) formula ( Bailey–Borwein–Plouffe formula ), that allow us to calculate specific digits of Pi without computing the preceding ones.
Extracting digits from Pi can be computationally expensive, especially when needing a large number of digits. While formulas like the BBP formula exist, calculating digits further down the sequence still requires significant processing power. This computational bottleneck can be a major drawback in applications requiring rapid random number generation.
It has been observed that π doesn't equidistribute very well, this could influence with the randomness of the digits.
Timothy Chow, mentions that while there are known patterns in the bits of pi, they are so weak that they will not affect any Monte Carlo experiments.
David Eppstein, explains that no fully deterministic sequence can be a good random sequence.
Supercooldave, suggests if considering $\pi$ as a seed for cryptographic keys, an attacker can mimic that generator, creating problems with the chain.
Due to the limitation of $\pi$, you could also consider:
The digits of Pi possess a certain allure as a potential source of random numbers. However, they are not truly random and should be used with caution. For applications where true randomness is critical, or where speed is essential, dedicated PRNGs or cryptographic generators are more suitable choices. While using Pi might uncover hidden patterns, as suggested by James Propp, it's usually best to stick with established methods for reliable random number generation.