Simple Normality Test with Application to Random Number Generation

Numbers such as π, e, log 2 or √2 have binary digits (bits) that look randomly distributed. They are very good candidates to generate randomness especially in cryptography. One way to assess their randomness is by proving that they are normal numbers. Such a proof has remained elusive for centuries. Here I focus on a different type of numbers that seem a lot easier to handle, such as (2π)-1 arccos(3/5).

To test normality, the most well-known tool is the Weyl criterion. Here I build a much simpler version yet equivalent to the original Weyl criterion, requiring much fewer computations, and done in a very efficient way given the length of the digit sequences involved, with more than 210,000 digits. It relies on a discrete quadratic dynamical system whose state space consists of 2 x 2 matrices with determinant and spectral radius equal to 1, involving Chebyshev polynomials and their asymptotic bounds when the argument is a rational number in the interval [-1, 1].

The associated Python code showcases high performance computing with the gmpy2 library. The second program does exact computations and requires both deep engineering and computer science skills combined with substantial scientific or mathematical knowledge to make it work with insanely large integers, as needed. Would you be able to write a version that does the job far more efficiently than mine? Look at it and let me know what you come up with. The goal is to find patterns that would eventually lead to a proof of normality.

Convergence of red and blue curves to zero indicates the digits are random

Download the paper and Python code

Available as technical paper #59, here. It is included in my new eBook on secure AI, available here. Links are clickable in the eBook (PDF). To no miss future articles, subscribe to my AI newsletter, here.

About the Author

Towards Better GenAI: 5 Major Issues, and How to Fix Them

Vincent Granville is a pioneering GenAI scientist, co-founder at BondingAI.io, the LLM 2.0 platform for hallucination-free, secure, in-house, lightning-fast Enterprise AI at scale with zero weight and no GPU. He is also author (Elsevier, Wiley), publisher, and successful entrepreneur with multi-million-dollar exit. Vincent’s past corporate experience includes Visa, Wells Fargo, eBay, NBC, Microsoft, and CNET. He completed a post-doc in computational statistics at University of Cambridge.

Leave a Reply

Discover more from NextGen AI Technology

Subscribe now to keep reading and get access to the full archive.

Continue reading