Statistical Quality of Number Sequences Produced by Pseudorandom Number Generators Built into Contemporary Programming Languages
The article presents the statistical quality of number sequences produced by pseudorandom number generators (PRNGs) built into or available in libraries of contemporary programming languages. Since PRNGs are foundational to many sciences, including cryptography, statistics, and simulation methods, high-quality PRNGs are crucial for reliable results. The study evaluated 143 pseudorandom generators from 17 popular programming languages. A widely recognized suite of 15 statistical tests developed by the National Institute of Standards and Technology (NIST), was used to assess randomness, and the research’s high accuracy was ensured by generating 1000 sequences for each generator, each one million bits long. The tests were performed for two variants: one with a fixed seed equal to 1 and one with a randomly selected seed. Thanks to these studies, the user can become aware of the limitations of the tools used and, if necessary, replace a weak generator with a better one. The results show that 113 of the 143 generators did not fail any test in either scenario, and 66 of them passed all tests without a single borderline result. However, four legacy linear congruential generators available in the GNU Scientific Library and both generators built into Delphi failed most of the tests, while the standard rand() function of C and C++ consistently failed the Discrete Fourier Transform test. Most borderline results were observed for the Non-overlapping Template Matching test.
Authors
- Łukasz Matuszewski (ORCID: https://orcid.org/0000-0002-5795-3246)
- Mieczysław Jessa (ORCID: https://orcid.org/0000-0002-4695-2408)
- Michał Dulek*
- Marcel Bieżuński
Institutions
- Poznań University of Technology (PL)
Publication Details
- Journal
- Applied Sciences
- Published
- 2026-10-09
- DOI
- https://doi.org/10.3390/app16209979
- Primary Topic
- Mathematical Approximation and Integration
- Type
- article
- Field-Weighted Citation Impact
- 0.00