Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Pseudorandom number generator
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=={{Anchor|Potential problems with deterministic generators}}Potential issues== In practice, the output from many common PRNGs exhibit [[artifact (error)|artifact]]s that cause them to fail statistical pattern-detection tests. These include: * Shorter-than-expected periods for some seed states (such seed states may be called "weak" in this context); * Lack of uniformity of distribution for large quantities of generated numbers; * Correlation of successive values; * Poor dimensional distribution of the output sequence; * Distances between where certain values occur are distributed differently from those in a random sequence distribution. Defects exhibited by flawed PRNGs range from unnoticeable (and unknown) to very obvious. An example was the [[RANDU]] random number algorithm used for decades on [[mainframe computer]]s. It was seriously flawed, but its inadequacy went undetected for a very long time. In many fields, research work prior to the 21st century that relied on random selection or on [[Monte Carlo method|Monte Carlo]] simulations, or in other ways relied on PRNGs, were much less reliable than ideal as a result of using poor-quality PRNGs.<ref>Press et al. (2007), chap.7</ref> Even today, caution is sometimes required, as illustrated by the following warning in the ''[[International Encyclopedia of Statistical Science]]'' (2010).<ref>{{cite book |last=L'Ecuyer |first=Pierre |contribution=Uniform random number generators |page=1629 |title=[[International Encyclopedia of Statistical Science]] |editor-last=Lovric |editor-first=Miodrag |publisher=Springer |year=2010 |isbn=978-3-642-04897-5}}</ref> {{blockquote | The list of widely used generators that should be discarded is much longer [than the list of good generators]. Do not trust blindly the software vendors. Check the default RNG of your favorite software and be ready to replace it if needed. This last recommendation has been made over and over again over the past 40 years. Perhaps amazingly, it remains as relevant today as it was 40 years ago.}} As an illustration, consider the widely used programming language [[Java (programming language)|Java]]. Up until 2020, Java still relied on a [[linear congruential generator]] (LCG) for its PRNG,<ref>[https://docs.oracle.com/javase/8/docs/api/java/util/Random.html Random (Java Platform SE 8)], Java Platform Standard Edition 8 Documentation.</ref><ref>[http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/tip/src/share/classes/java/util/Random.java Random.java] at [[OpenJDK]].</ref> which is of low quality (see further below). Java support was upgraded with [[Java version history#Java 17|Java 17]]. One well-known PRNG to avoid major problems and still run fairly quickly is the [[Mersenne Twister]] (discussed below), which was published in 1998. Other higher-quality PRNGs, both in terms of computational and statistical performance, were developed before and after this date; these can be identified in the [[List of pseudorandom number generators]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)