IJSEA Volume 13 Issue 12

Analysis of Pseudorandom Number Generator in Python

Anton Novikau
10.7753/IJSEA1312.1001
keywords : python, Entropy analysis, Chi-square test, Serial correlation, Randomness evaluation

PDF
This study evaluates the quality of the pseudorandom number generator (PRNG) implemented in Python's random module, which utilizes the Mersenne Twister algorithm. PRNGs are integral to numerous computational applications, and their statistical integrity directly impacts simulations, modeling, and cryptography. Using the ent toolset, we analyzed ten independent runs of the Python PRNG based on metrics including entropy, compression, chi-square tests, arithmetic mean, Monte Carlo ? estimation, and serial correlation. Results indicate near-maximum entropy, a uniform byte distribution, accurate ? estimation, and negligible serial correlation, demonstrating robust randomness properties suitable for general-purpose use. However, the deterministic nature of the Mersenne Twister limits its application in cryptographic contexts. These findings affirm the statistical reliability of Python's random module while highlighting the need for specialized algorithms for security-critical applications.
@artical{a13122024ijsea13121001,
Title = "Analysis of Pseudorandom Number Generator in Python ",
Journal ="International Journal of Science and Engineering Applications (IJSEA)",
Volume = "13",
Issue ="12",
Pages ="1 - 4",
Year = "2024",
Authors ="Anton Novikau"}