This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 |
How can the result of 1/q be a random number? —Preceding unsigned comment added by 84.56.223.168 ( talk) 07:55, 16 January 2008 (UTC)
it wouldn't be truly random, but it may have properties close enough to randomness that make it valuable for some purposes. what properties? two major properties are that the numbers should be distributed appoximately according to a uniform distribution, and that the numbers are uncorrelated (that is, the second number doesn't tend to be high if first one is high, or simmilar effects). it is best for the lack of correlation to extend to multiple dimensions (that is, the first three don't have statistically important effects on the second three). 6 march 2008 198.182.163.125 ( talk) 13:15, 6 March 2008 (UTC)
I know its probably against wiki guidelines but one section appears to be just an advertisement for the SOCR website or something along those lines. -- 213.203.161.144 ( talk) 22:38, 21 July 2008 (UTC)
Gentlemen, finally a use for spam: employ it in Random number generation/Archive 1. (Implies a vibrant and creative spam producing community in your country. OK, not as good as radio, tv, clouds...)
Jidanni ( talk) 01:37, 28 December 2008 (UTC)
I like this article. But it is missing references and footnotes section. To highlight this for editor(s) I have added the template "morefootnotes" as a reminder for work to be done. A starting point is to take the 3 external references and put them into a references section; then a footnote can be added into the body. I will attempt this as soon as I can.-- Михал Орела ( talk) 13:21, 13 January 2009 (UTC)
There's terminology here that isn't clearly defined about the "quality" of random numbers and what is "truly" random. Here are some categories:
Note that secrecy, unpredictability, and mathematical generation vs. direct observation are three distinct axes. The lower digits of the S&P 500's closing price for tomorrow are unpredictable and directly observed but not secret. Numbers generated from a good passphrase (passparagraph?) are secret and mathematically generated but some folks might question whether they're "truly" random since better crypto or computing could theoretically distinguish them from random. And so on. :) —Preceding unsigned comment added by 67.119.195.43 ( talk) 23:41, 12 January 2009 (UTC)
Edit: Maybe the solution is a section, "Traits of Random Numbers", that separates out and defines (1) even statistical distribution, (2) cryptographic randomness, and (3) unpredictability regardless of computational power. 67.119.195.43 ( talk) 23:52, 12 January 2009 (UTC)
Another edit: I think better names for the traits are 1) evenly distributed, 2) indistinguishable from random, 3) truly random. The difference between secrecy and randomness (except in cryptography), and between "basic" random number generators and fancypants quantum stuff, can wait until after the basic definitions. Now, the hard part is figuring out how better to organize the info currently scattered among many, many headings. 67.119.195.43 ( talk) 08:55, 25 January 2009 (UTC)
The article had a lot of redundant sections, so I tried to collate the information and add references. I moved the section headings around to give some logical flow to the presentation. It looks like more footnotes are needed and the intro could use some cleanup. -- Hakanai ( talk) 22:35, 27 June 2009 (UTC)
Add a link to Randomness_tests ? 82.163.24.100 ( talk) 17:45, 7 July 2009 (UTC)
The article does not provide an example of a RNG that one can pop into one's code. I think really 99% of the people coming to this page would be looking for an algorithm. For "the experts" not to provide one is not meeting their needs because it is actually quite difficult to find a simple general purpose RNG on the web. I found this ( http://www.bobwheeler.com/statistics/Password/MarsagliaPost.txt) article which seems to have a very nice random number generator better than most operating systems ship standard (i.e. surely better than rand() or random() in the C libraries). Of course to provide cryptographically strong code would fill too much space, so I think the article should stop short of this. —Preceding unsigned comment added by Paulsheer ( talk • contribs) 15:46, 23 August 2009 (UTC)
The segment mentioning 'PokerStars' is entirely false. It falsely claims:
"individual statistics gathered from hundreds of multiple players and tens of thousands of played hands show that the outcome of games are nowhere near the statistical occurrences"
There is no such survey that exists.
In fact, the only published surveys find that the random shuffling processes are entirely legitimate and conform to expectation. Three such surveys exist at:
http://groups.google.com/group/rec.gambling.poker/msg/90082dfe67dc4a7f?hl=en& http://groups.google.com/group/rec.gambling.poker/msg/177010a4879f4c6b http://www.spadebidder.com
Further, Cigital has released their audit last week confirming that their shuffle is truly random:
http://www.pokerstars.com/poker/rng/cigital-rng-labresults.pdf
Since I work for PokerStars, I feel that it would be inappropriate for me to directly edit the page, but I think that the four independent sources provided above contrast with the false and unsourced claims on the page. The existing paragraph fails Wikipedia's standards on 'Verifiability', 'Identifying reliable sources', and 'Citing sources'. MichaelJosem ( talk) 04:59, 29 March 2010 (UTC)
i have a problem with the following sentense: "For instance, a system that 'randomly' selects music tracks for a background music system must only appear to be random; a true random system would have no restriction on the same item appearing two or three times in succession." it just isn't true. most systems to select random music tracks work on the principle of drawing a sample of n songs from the master list without replacement. in this paradigm, repeasts are are possible (a song could be the last in one random sample, and the first in the next), and are not prohibited by the randomness. this is not a problem with random number generators because these playlist selectors are not designed to sample with replacement. lest we all forget our introduction to statistics courses, sampling without replacement is just as random as sampling with replacement. 6 march 2008. —Preceding unsigned comment added by 198.182.163.125 ( talk) 13:07, 6 March 2008 (UTC)
I don't think they were saying it was a problem with random number generators, just that users would not want truly random behavior. The fact that it is random means it could appear multiple successive times, and users don't want that. They even see patterns where there are none, as in this newsweek article by Steven Levy. -Euicho- ( talk) 02:52, 28 July 2010 (UTC)
For instance, a system that 'randomly' selects music tracks for a background music system must only appear to be random; a true random system would have no restriction on the same item appearing two or three times in succession.
I, and anyone else who used the random repeat feature of some early software PC CD-ROM players, can attest to the fact that allowing the same selection twice (or more) in no way ensures that selection is truly random. ( Either that or my computer loved the song I hated on an otherwise good album because the track list would go something like 7,3,2,10,3,1,9,4,3,12,6,3.) Nowadays when one hears the same track several times it actually brings in question how random the selection is by ignoring dozens (or more) of other possible choices, for example if I hear #3 of a 100+ song mp3 cd four times in the first 12 selections (or something similar) and haven't set some kind of preference for it, I'd be especially dubious of its "randomness" the same way I'd wonder about a pair of dice in a craps game that tend to roll 1s and 2s.
Long story short who/what says a true random system would have no restriction on the same item appearing two or three times in succession. because it seems counterintuitive to the idea of random selection? Anynobody( ?) 06:39, 26 June 2008 (UTC)
"...A true random system would have no restriction on the same item appearing two or three times in succession."
"...Allowing the same selection twice (or more) in no way ensures that selection is truly random."
This has been discussed enough. The thread is obviously dead and any further contention seems pointless. I'm going to remove the dubious mark now. 7. September 2010 —Preceding unsigned comment added by 84.208.92.110 ( talk) 14:15, 7 September 2010 (UTC)
As far as I can tell, the work referred to by this is not a computational method, it employs two 171Yb+ qubits trapped in independent vacuum chambers -- hardly a computational element.-- 84.108.213.97 ( talk) 00:47, 23 December 2010 (UTC)
i want to add a mention about W-Chaos algorithm as yet another method to get True Random Numbers. this algo is used by cipher Mademoiselle Entropia. W-Chaos uses a list of web-resources to ping them, fluctuations of ping values allow to generate TRNs. — Preceding unsigned comment added by Evgeney Knyazhev ( talk • contribs) 23:05, 1 January 2011 (UTC)
@Hankwang why irrelevant??? app (Mademoiselle Entropia) allows not only to cipher a file, but to generate true random numbers too (with algorithm W-Chaos). You mentioned of necessity to test algorithms with independent experts. i suppose you have had knowledge to judge about generator of random numbers. -- Evgeney Knyazhev ( talk) 02:55, 4 January 2011 (UTC)
Thanks for reply, Sebastian. Actually, i've searched independent specialists to verify algorithms. -- Evgeney Knyazhev ( talk) 00:07, 5 January 2011 (UTC)
Would anyone include a picture showing the large-scale difference in patterns (or lack thereof) between random sequences and pseudo-random sequences? This example http://boallen.com/random-numbers.html clearly illustrates this difference. It would be valuable if something like this could be included in the article. 23.16.127.167 ( talk) 21:29, 13 March 2012 (UTC)
The present version of the article shows the following code for the Marsaglia MWC generator:
m_w = <choose-initializer>; /* must not be zero */
m_z = <choose-initializer>; /* must not be zero */
uint get_random()
{
m_z = 36969 * (m_z & 65535) + (m_z >> 16);
m_w = 18000 * (m_w & 65535) + (m_w >> 16);
return (m_z << 16) + m_w; /* 32-bit result */
}
However, it seems that there are different versions of this PRNG. For example Marsaglia, 12 Jan 1999: [1]
#define znew ((z=36969*(z&65535)+(z>>16))<<16)
#define wnew ((w=18000*(w&65535)+(w>>16))&65535)
#define MWC (znew+wnew)
and Marsaglia, 20 Jan 1999: [2]
#define znew (z=36969*(z&65535)+(z>>16))
#define wnew (w=18000*(w&65535)+(w>>16))
#define MWC ((znew<<16)+wnew )
Note the difference in the definition of wnew. The article implements the second one. Is the first one a mistake? The first one seems suspicious to me, since it concatenates two 16-bit random numbers; applications which use only the highest-order bit (to generate random sequences of 0 and 1) don't benefit from the additional randomness of the 'w' part. Han-Kwang ( t) 13:31, 30 October 2010 (UTC)
In this archive Marsaglia himself states (Posted: Jan 15, 1999 11:41 AM):
"In my earlier work, done in Fortran, I had implemented two 16-bit multiply-with-carry generators, say z and w, as 32-bit integers, with the carry in the top 16 bits, the output in the bottom 16. They were combined by (z<<16)+w. (In Fortran, ishft(z,16)+w.) Such a combination seemed to pass all tests. In the above- mentioned post, I used (z<<16)+(w&65525), and that does not pass all tests. So (z<<16)+w seems preferable; it is used below, providing a MWC that seems to pass all tests."
http://mathforum.org/kb/message.jspa?messageID=1524861 — Preceding unsigned comment added by 62.121.49.2 ( talk) 08:55, 5 February 2013 (UTC)
This page is redundant with Randomization and Random number generator. However, I believe it's important to make the bridge between the two.
Randomization is about taking elements and putting them in random order (i.e. shuffling) (or maybe also selecting a random subset), generating random numbers is about just creating numbers at random. The two processes are fairly equivalent.
I believe that random number generator could be merged into this page. Flammifer 09:06, 23 September 2005 (UTC)
the odd thing about this is the fact that i clicked on the Random Article link and this was the page that came up :)
I think it should be the other way round. A random number generator is an important kind of computer programme. Random number generation is the technique it uses. FSharpMajor 11:44, 23 February 2007 (UTC)
I also believe this page and random number generator should be merged. —Preceding unsigned comment added by 66.191.137.2 ( talk) 19:36, 16 October 2007 (UTC)
I'm going to express a view I'm never seen before: the only true random number generators are those implemented in software. Physical (hardware) generators have some kind of bias. Possibly quantum generators produce truly random bits, but how do we know that deficiencies in our physical setup haven't biased the quantum generator? Some software "gathers entropy" by measuring physical things (e.g. mouse movements, key-press timing, temperature of processor, disk seek time) but then goes to great efforts to convert this to a uniform distribution. Why not just use software from the start? Every time the diehard tests get another (stronger) test, authors of PRNGs re-write their software to reduce the newly-discovered bias by another order of magnitude. This arms race results in better and better PRNGs.
132.244.72.5 (
talk)
13:30, 26 March 2013 (UTC)
The subsection on generating a random variable describes how to generate a random variable with an arbitrary probability distribution from a uniform random variable. It presumes the availability of a uniform random variable. The rest of the entire entry is focused on how to acquire some approximation of a uniform random variable. This section should at the very least be moved to a different part, as it has little to do with pseudo-random number generators and entropy machines. — Preceding unsigned comment added by Geekynerdrd ( talk • contribs) 05:53, 4 January 2014 (UTC)
I get the impression from various sources on the internet that random number generators (especially of the true variety) are suposedly very hard to create. I have however managed to create a Perl script which I believe to be a pretty much bullet-proof TRNG. I would like there to be a mention of it on Wikipedia but I know very little about the protocols regarding adding an entry to Wikipedia. Please can an expert in both Wikipedia and Perl thoroughly examine my script and if you think it is worth including, please can you put it in an appropriate place and add any relevant links to it from other Wikipedia pages. Thank you very much. Here is the script:
sub TRNGrand { ($range) = @_;
#This Perl subroutine almost instantly outputs a true random #number between zero and $range inclusive to 15 decimal places. # #If you are considering purchasing a hardware TRNG, save your #money and use this script instead. # #The author has only tested this subroutine on Windows and #therefore does not know if it works on Unix. # #It works by counting the number of for-loop cycles per eight #microseconds several times and dividing the counts into two #groups. A bit (0 or 1) is then determined by which group wins. #A draw means "try again". This process is repeated for each bit. # #The very first count is not included in the groups because it #tends to be somewhat different to the other counts. # #The two groups are intermeshed according to the following pattern: # #ABABBABAABABBABABABAABABBABAABAB # #The pattern is irregular in order to guard against any regularities #in the computer. # #Tests confirm that it produces results which are fairly evenly #distributed and because of the way it operates, the results are #theoretically independent of each other. # #Unfortunately, the Perl "bignum" module and associated modules #break this subroutine so if you are writing a Perl script which #uses these modules, the author suggests that you use this #subroutine to populate an array with all of the random data your #script will need before issuing the "use bignum;" command.
use Time::HiRes qw(gettimeofday);
$decimalplace = 1; until ($decimalplace == 15) { $bitstring = ""; for ($binaryplace = 0; $binaryplace <= 3; $binaryplace++) { @loopcount = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); $loopcountsgroupA = 0; $loopcountsgroupB = 0; until ($loopcountsgroupA ne $loopcountsgroupB) { for ($runnumber = 0; $runnumber <= 32; $runnumber++) { $x8microsecondschanges = 0; $previousx8microseconds = "null"; until ($x8microsecondschanges == 2) { ($seconds,$microseconds) = gettimeofday; $x8microseconds = int($microseconds / 8); if($previousx8microseconds ne "null" && $x8microseconds ne $previousx8microseconds) { $x8microsecondschanges++; } $previousx8microseconds = $x8microseconds; if($x8microsecondschanges == 1) {$loopcount[$runnumber]++;} } } $loopcountsgroupA = $loopcount[1]+$loopcount[3]+$loopcount[6]+$loopcount[8]+ $loopcount[9]+$loopcount[11]+$loopcount[14]+$loopcount[16]+ $loopcount[18]+$loopcount[20]+$loopcount[21]+$loopcount[23]+ $loopcount[26]+$loopcount[28]+$loopcount[29]+$loopcount[31]; $loopcountsgroupB = $loopcount[2]+$loopcount[4]+$loopcount[5]+$loopcount[7]+ $loopcount[10]+$loopcount[12]+$loopcount[13]+$loopcount[15]+ $loopcount[17]+$loopcount[19]+$loopcount[22]+$loopcount[24]+ $loopcount[25]+$loopcount[27]+$loopcount[30]+$loopcount[32]; } if($loopcountsgroupA < $loopcountsgroupB) {$bit = 0;} else {$bit = 1;} $bitstring = "$bitstring$bit"; } $decimaldigit = unpack("N",pack("B32",substr("0"x32 .$bitstring,-32))); if($decimaldigit < 10) { $decimaldigits = "$decimaldigits$decimaldigit"; $decimalplace++; } } if($range eq "") {$range = 1;} return "0.$decimaldigits" * $range; }
95.172.231.160 ( talk) 18:20, 29 January 2014 (UTC)
Quote: "In particular, not all operating systems (e.g. Windows) provide time of day to microsecond resolution." Windows does support it. Otherwise my script would not work. I have successfully tested it on Windows. 95.172.231.160 ( talk) 19:35, 29 January 2014 (UTC)
https://medium.com/@betable/tifu-by-using-math-random-f1c308c4fd9d#.nj1verf8n claims that this article uses the poor example MWC1616. It would be nice if someone more qualified would check the link and article, and possibly insert a more appropriate example of a PRNG.
If the current example for chosen simplicity and briefness rather than quality, it might be reasonable to instead pick something even simpler like DJB2, which I believe is a lot easier to explain. If instead quality is an important factor, MWC1616 seems to be a poor choice even in the refined variant, according to the link. -- mafutrct ( talk) 15:12, 21 November 2015 (UTC)
@ Mafutrct: the stock standard PRNG algorithm is (as the linked article points out) the Mersenne Twister, but if you want something with a very short pseudocode and comparable quality, xorshift is just a few lines. Chrome will apparently use xorshitf128+ to replace MWC1616. -- Tgr ( talk) 23:41, 31 December 2015 (UTC)
Just as an update: MWC has since been removed from the article. Sadly without a replacement. -- mafutrct ( talk) 13:56, 18 May 2016 (UTC)
I've always been led to believe that the digits of pi are truly random. Is this so? If so, worth a mention, I would think, since pi provides . . . how many now, 1 or 2 quadrillion random digits (I don't know what the current total number of known digits of pi is right now)? (Double that since presumably a random sequence is just as random when taken backwards(?)) DoctorFun1970 ( talk) 15:03, 1 September 2016 (UTC)
The problem would be making a random number generator to provide a choice for which number in the digits of pi to use. WikipediaUserCalledChris ( talk) 20:28, 23 January 2017 (UTC)
The result of the move request was: No consensus on scope, so no consensus on move. ( non-admin closure) Red Slash 00:42, 25 April 2019 (UTC)
Random number generation → Random number generator – As suggested by the boldfaced title in the lead, the article is clearly about random number generators, which are "a process", not "the process". The target has significant history, so a history swap might be needed. GeoffreyT2000 ( talk) 19:12, 7 April 2019 (UTC)--Relisted. – Ammarpad ( talk) 14:52, 16 April 2019 (UTC)
I believe some Linux systems are always collecting key-press timings as this is a source of randomness. They also use disk track-seek timings. ( https://blog.cloudflare.com/ensuring-randomness-with-linuxs-random-number-generator/ )
I have experimented with measuring the user's reaction time when given a series of (almost random) keys to press. In my case, the idea was to use the randomness in the reaction times to generate passwords. There ought to be more material out there describing these sorts of techniques and it would be useful to include this. 108.171.128.180 ( talk) 14:38, 4 July 2019 (UTC)
I did a google search on "including the rolling of dice, coin flipping, the shuffling of playing cards, the use of yarrow stalks (for divination) in the I Ching," and found this: [4]
The question is whether we lifted it from that source or whether they lifted it from us a slapped a copyright on it. -- Guy Macon ( talk) 05:42, 27 January 2019 (UTC)
Background.
@
Netoholic,
Guy Macon,
GeoffreyT2000,
Born2cycle,
ArnoldReinhold,
Rreagan007,
Primergrey, and
Waldyrious: This article was established by merging two articles, named
random number generator and
Random number generation. For a very long time, most of the content, and also the lead, more concerned "the generator" than "the generation" - to the extent that these concepts were distinguished. moreover, there are about twice as many links to this "generation" page by means of one or another "generator" variant as directly or by another "generation" variant. Some months ago, a discussion about moving the name to the "generator" title ended in a dead-lock; see
Talk:Random_number_generation/Archive_1#Requested_move_7_April_2019. Netoholic was the main proponent for retaining the "generation" title, and also proposed that the lead be rewritten to reflect the "generation" aspect, and that the multitude of links to "generator" in most instances be split up to references to either hardware or software generators. Explicitly, he wrote
This argument seemingly had some impact. Unhappily, also seemingly, he then did not have the time to make these changes himself.
However, a few months later, here Primergrey indeed made an effort to "match the lead to the title". However, this removed the connection with the merged "generator" article, and left the overwhelmingly abundant references to "generators" unexplained. It also resulted in declaring that RNG be an abbreviation for "random numbers generator".
The present wikidata discussion.
There is an unresolved proposal to merge the wikidata item for "Random number generation" (
d:Q228206) with the one for "Random number generator" (
d:Q61722412); see
d:Wikidata:Interwiki_conflicts/Unresolved/2021#random_number_generation_(Q228206)/random_number_generator_(Q61722412). Seemingly, there was just one item until two years ago, when Waldyrious split them, and distributed some of the articles to the new item; however seemingly more by reference to the article names than to their contents. As far as I can see, most remaining Q228206 articles have names and content reflecting the enwp article (as it was before Primergrey's lead change); i. e., their titles refer to "generation" but their content to "generator". Only in a few articles (in both groups) did I find some sentence which would be more in line with Netoholic's proposal; although the guys writing their articles from scratch or translating e. g. the enwp one did not seem to indicate any conceptual difference between "processes" and "devices". (Of course, I don't really read all these languages, and e. g. had to guess about the significance of the last token in the zhwp sister article, present in the boldface article start but not in the article title.) I'm afraid that presently this has broken the interwiki connections; all the articles I've succeeded to understand anything from seem to be "true sisters".
My opinion.
There are some points to be said in favour of Netoholic's arguments - if they be realised. However, I disagree with the idea that "random numbers generator" in se is a bad term, since it may make readers confuse hardware and software generators, both named precisely generators. Actually, naming (more specific) subconcepts by the superconcept name plus a distinguishing attribute both is a very common and a very reasonable policy. Instead, I think, that if Netolothic's programme should be realised, then it would be best essentially to undo the old merge of
Random number generator and
Random number generation, splitting the two articles into a longer "generator" one and a shorter (although conceptually more general) "generation" one. If no-one in the foreseeable future is willing to and has time do this, nor to pursue Netoholic's original proposal, then I think that the lead should be made to reflect the merged article character of this article a bit better.
JoergenB (
talk)
21:20, 7 February 2021 (UTC)
Ways of accessing random numbers in various operating systems is already the subject of entirely separate articles: /dev/random and CryptGenRandom, etc. Throwing in some talk about one particular way to get them in some Unix-like operating systems seems out of place in this article. I think we should remove the textual reference to them from this article and just have a "See also" link at the top. Mr. Shoeless ( talk) 15:14, 3 September 2023 (UTC)
This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 |
How can the result of 1/q be a random number? —Preceding unsigned comment added by 84.56.223.168 ( talk) 07:55, 16 January 2008 (UTC)
it wouldn't be truly random, but it may have properties close enough to randomness that make it valuable for some purposes. what properties? two major properties are that the numbers should be distributed appoximately according to a uniform distribution, and that the numbers are uncorrelated (that is, the second number doesn't tend to be high if first one is high, or simmilar effects). it is best for the lack of correlation to extend to multiple dimensions (that is, the first three don't have statistically important effects on the second three). 6 march 2008 198.182.163.125 ( talk) 13:15, 6 March 2008 (UTC)
I know its probably against wiki guidelines but one section appears to be just an advertisement for the SOCR website or something along those lines. -- 213.203.161.144 ( talk) 22:38, 21 July 2008 (UTC)
Gentlemen, finally a use for spam: employ it in Random number generation/Archive 1. (Implies a vibrant and creative spam producing community in your country. OK, not as good as radio, tv, clouds...)
Jidanni ( talk) 01:37, 28 December 2008 (UTC)
I like this article. But it is missing references and footnotes section. To highlight this for editor(s) I have added the template "morefootnotes" as a reminder for work to be done. A starting point is to take the 3 external references and put them into a references section; then a footnote can be added into the body. I will attempt this as soon as I can.-- Михал Орела ( talk) 13:21, 13 January 2009 (UTC)
There's terminology here that isn't clearly defined about the "quality" of random numbers and what is "truly" random. Here are some categories:
Note that secrecy, unpredictability, and mathematical generation vs. direct observation are three distinct axes. The lower digits of the S&P 500's closing price for tomorrow are unpredictable and directly observed but not secret. Numbers generated from a good passphrase (passparagraph?) are secret and mathematically generated but some folks might question whether they're "truly" random since better crypto or computing could theoretically distinguish them from random. And so on. :) —Preceding unsigned comment added by 67.119.195.43 ( talk) 23:41, 12 January 2009 (UTC)
Edit: Maybe the solution is a section, "Traits of Random Numbers", that separates out and defines (1) even statistical distribution, (2) cryptographic randomness, and (3) unpredictability regardless of computational power. 67.119.195.43 ( talk) 23:52, 12 January 2009 (UTC)
Another edit: I think better names for the traits are 1) evenly distributed, 2) indistinguishable from random, 3) truly random. The difference between secrecy and randomness (except in cryptography), and between "basic" random number generators and fancypants quantum stuff, can wait until after the basic definitions. Now, the hard part is figuring out how better to organize the info currently scattered among many, many headings. 67.119.195.43 ( talk) 08:55, 25 January 2009 (UTC)
The article had a lot of redundant sections, so I tried to collate the information and add references. I moved the section headings around to give some logical flow to the presentation. It looks like more footnotes are needed and the intro could use some cleanup. -- Hakanai ( talk) 22:35, 27 June 2009 (UTC)
Add a link to Randomness_tests ? 82.163.24.100 ( talk) 17:45, 7 July 2009 (UTC)
The article does not provide an example of a RNG that one can pop into one's code. I think really 99% of the people coming to this page would be looking for an algorithm. For "the experts" not to provide one is not meeting their needs because it is actually quite difficult to find a simple general purpose RNG on the web. I found this ( http://www.bobwheeler.com/statistics/Password/MarsagliaPost.txt) article which seems to have a very nice random number generator better than most operating systems ship standard (i.e. surely better than rand() or random() in the C libraries). Of course to provide cryptographically strong code would fill too much space, so I think the article should stop short of this. —Preceding unsigned comment added by Paulsheer ( talk • contribs) 15:46, 23 August 2009 (UTC)
The segment mentioning 'PokerStars' is entirely false. It falsely claims:
"individual statistics gathered from hundreds of multiple players and tens of thousands of played hands show that the outcome of games are nowhere near the statistical occurrences"
There is no such survey that exists.
In fact, the only published surveys find that the random shuffling processes are entirely legitimate and conform to expectation. Three such surveys exist at:
http://groups.google.com/group/rec.gambling.poker/msg/90082dfe67dc4a7f?hl=en& http://groups.google.com/group/rec.gambling.poker/msg/177010a4879f4c6b http://www.spadebidder.com
Further, Cigital has released their audit last week confirming that their shuffle is truly random:
http://www.pokerstars.com/poker/rng/cigital-rng-labresults.pdf
Since I work for PokerStars, I feel that it would be inappropriate for me to directly edit the page, but I think that the four independent sources provided above contrast with the false and unsourced claims on the page. The existing paragraph fails Wikipedia's standards on 'Verifiability', 'Identifying reliable sources', and 'Citing sources'. MichaelJosem ( talk) 04:59, 29 March 2010 (UTC)
i have a problem with the following sentense: "For instance, a system that 'randomly' selects music tracks for a background music system must only appear to be random; a true random system would have no restriction on the same item appearing two or three times in succession." it just isn't true. most systems to select random music tracks work on the principle of drawing a sample of n songs from the master list without replacement. in this paradigm, repeasts are are possible (a song could be the last in one random sample, and the first in the next), and are not prohibited by the randomness. this is not a problem with random number generators because these playlist selectors are not designed to sample with replacement. lest we all forget our introduction to statistics courses, sampling without replacement is just as random as sampling with replacement. 6 march 2008. —Preceding unsigned comment added by 198.182.163.125 ( talk) 13:07, 6 March 2008 (UTC)
I don't think they were saying it was a problem with random number generators, just that users would not want truly random behavior. The fact that it is random means it could appear multiple successive times, and users don't want that. They even see patterns where there are none, as in this newsweek article by Steven Levy. -Euicho- ( talk) 02:52, 28 July 2010 (UTC)
For instance, a system that 'randomly' selects music tracks for a background music system must only appear to be random; a true random system would have no restriction on the same item appearing two or three times in succession.
I, and anyone else who used the random repeat feature of some early software PC CD-ROM players, can attest to the fact that allowing the same selection twice (or more) in no way ensures that selection is truly random. ( Either that or my computer loved the song I hated on an otherwise good album because the track list would go something like 7,3,2,10,3,1,9,4,3,12,6,3.) Nowadays when one hears the same track several times it actually brings in question how random the selection is by ignoring dozens (or more) of other possible choices, for example if I hear #3 of a 100+ song mp3 cd four times in the first 12 selections (or something similar) and haven't set some kind of preference for it, I'd be especially dubious of its "randomness" the same way I'd wonder about a pair of dice in a craps game that tend to roll 1s and 2s.
Long story short who/what says a true random system would have no restriction on the same item appearing two or three times in succession. because it seems counterintuitive to the idea of random selection? Anynobody( ?) 06:39, 26 June 2008 (UTC)
"...A true random system would have no restriction on the same item appearing two or three times in succession."
"...Allowing the same selection twice (or more) in no way ensures that selection is truly random."
This has been discussed enough. The thread is obviously dead and any further contention seems pointless. I'm going to remove the dubious mark now. 7. September 2010 —Preceding unsigned comment added by 84.208.92.110 ( talk) 14:15, 7 September 2010 (UTC)
As far as I can tell, the work referred to by this is not a computational method, it employs two 171Yb+ qubits trapped in independent vacuum chambers -- hardly a computational element.-- 84.108.213.97 ( talk) 00:47, 23 December 2010 (UTC)
i want to add a mention about W-Chaos algorithm as yet another method to get True Random Numbers. this algo is used by cipher Mademoiselle Entropia. W-Chaos uses a list of web-resources to ping them, fluctuations of ping values allow to generate TRNs. — Preceding unsigned comment added by Evgeney Knyazhev ( talk • contribs) 23:05, 1 January 2011 (UTC)
@Hankwang why irrelevant??? app (Mademoiselle Entropia) allows not only to cipher a file, but to generate true random numbers too (with algorithm W-Chaos). You mentioned of necessity to test algorithms with independent experts. i suppose you have had knowledge to judge about generator of random numbers. -- Evgeney Knyazhev ( talk) 02:55, 4 January 2011 (UTC)
Thanks for reply, Sebastian. Actually, i've searched independent specialists to verify algorithms. -- Evgeney Knyazhev ( talk) 00:07, 5 January 2011 (UTC)
Would anyone include a picture showing the large-scale difference in patterns (or lack thereof) between random sequences and pseudo-random sequences? This example http://boallen.com/random-numbers.html clearly illustrates this difference. It would be valuable if something like this could be included in the article. 23.16.127.167 ( talk) 21:29, 13 March 2012 (UTC)
The present version of the article shows the following code for the Marsaglia MWC generator:
m_w = <choose-initializer>; /* must not be zero */
m_z = <choose-initializer>; /* must not be zero */
uint get_random()
{
m_z = 36969 * (m_z & 65535) + (m_z >> 16);
m_w = 18000 * (m_w & 65535) + (m_w >> 16);
return (m_z << 16) + m_w; /* 32-bit result */
}
However, it seems that there are different versions of this PRNG. For example Marsaglia, 12 Jan 1999: [1]
#define znew ((z=36969*(z&65535)+(z>>16))<<16)
#define wnew ((w=18000*(w&65535)+(w>>16))&65535)
#define MWC (znew+wnew)
and Marsaglia, 20 Jan 1999: [2]
#define znew (z=36969*(z&65535)+(z>>16))
#define wnew (w=18000*(w&65535)+(w>>16))
#define MWC ((znew<<16)+wnew )
Note the difference in the definition of wnew. The article implements the second one. Is the first one a mistake? The first one seems suspicious to me, since it concatenates two 16-bit random numbers; applications which use only the highest-order bit (to generate random sequences of 0 and 1) don't benefit from the additional randomness of the 'w' part. Han-Kwang ( t) 13:31, 30 October 2010 (UTC)
In this archive Marsaglia himself states (Posted: Jan 15, 1999 11:41 AM):
"In my earlier work, done in Fortran, I had implemented two 16-bit multiply-with-carry generators, say z and w, as 32-bit integers, with the carry in the top 16 bits, the output in the bottom 16. They were combined by (z<<16)+w. (In Fortran, ishft(z,16)+w.) Such a combination seemed to pass all tests. In the above- mentioned post, I used (z<<16)+(w&65525), and that does not pass all tests. So (z<<16)+w seems preferable; it is used below, providing a MWC that seems to pass all tests."
http://mathforum.org/kb/message.jspa?messageID=1524861 — Preceding unsigned comment added by 62.121.49.2 ( talk) 08:55, 5 February 2013 (UTC)
This page is redundant with Randomization and Random number generator. However, I believe it's important to make the bridge between the two.
Randomization is about taking elements and putting them in random order (i.e. shuffling) (or maybe also selecting a random subset), generating random numbers is about just creating numbers at random. The two processes are fairly equivalent.
I believe that random number generator could be merged into this page. Flammifer 09:06, 23 September 2005 (UTC)
the odd thing about this is the fact that i clicked on the Random Article link and this was the page that came up :)
I think it should be the other way round. A random number generator is an important kind of computer programme. Random number generation is the technique it uses. FSharpMajor 11:44, 23 February 2007 (UTC)
I also believe this page and random number generator should be merged. —Preceding unsigned comment added by 66.191.137.2 ( talk) 19:36, 16 October 2007 (UTC)
I'm going to express a view I'm never seen before: the only true random number generators are those implemented in software. Physical (hardware) generators have some kind of bias. Possibly quantum generators produce truly random bits, but how do we know that deficiencies in our physical setup haven't biased the quantum generator? Some software "gathers entropy" by measuring physical things (e.g. mouse movements, key-press timing, temperature of processor, disk seek time) but then goes to great efforts to convert this to a uniform distribution. Why not just use software from the start? Every time the diehard tests get another (stronger) test, authors of PRNGs re-write their software to reduce the newly-discovered bias by another order of magnitude. This arms race results in better and better PRNGs.
132.244.72.5 (
talk)
13:30, 26 March 2013 (UTC)
The subsection on generating a random variable describes how to generate a random variable with an arbitrary probability distribution from a uniform random variable. It presumes the availability of a uniform random variable. The rest of the entire entry is focused on how to acquire some approximation of a uniform random variable. This section should at the very least be moved to a different part, as it has little to do with pseudo-random number generators and entropy machines. — Preceding unsigned comment added by Geekynerdrd ( talk • contribs) 05:53, 4 January 2014 (UTC)
I get the impression from various sources on the internet that random number generators (especially of the true variety) are suposedly very hard to create. I have however managed to create a Perl script which I believe to be a pretty much bullet-proof TRNG. I would like there to be a mention of it on Wikipedia but I know very little about the protocols regarding adding an entry to Wikipedia. Please can an expert in both Wikipedia and Perl thoroughly examine my script and if you think it is worth including, please can you put it in an appropriate place and add any relevant links to it from other Wikipedia pages. Thank you very much. Here is the script:
sub TRNGrand { ($range) = @_;
#This Perl subroutine almost instantly outputs a true random #number between zero and $range inclusive to 15 decimal places. # #If you are considering purchasing a hardware TRNG, save your #money and use this script instead. # #The author has only tested this subroutine on Windows and #therefore does not know if it works on Unix. # #It works by counting the number of for-loop cycles per eight #microseconds several times and dividing the counts into two #groups. A bit (0 or 1) is then determined by which group wins. #A draw means "try again". This process is repeated for each bit. # #The very first count is not included in the groups because it #tends to be somewhat different to the other counts. # #The two groups are intermeshed according to the following pattern: # #ABABBABAABABBABABABAABABBABAABAB # #The pattern is irregular in order to guard against any regularities #in the computer. # #Tests confirm that it produces results which are fairly evenly #distributed and because of the way it operates, the results are #theoretically independent of each other. # #Unfortunately, the Perl "bignum" module and associated modules #break this subroutine so if you are writing a Perl script which #uses these modules, the author suggests that you use this #subroutine to populate an array with all of the random data your #script will need before issuing the "use bignum;" command.
use Time::HiRes qw(gettimeofday);
$decimalplace = 1; until ($decimalplace == 15) { $bitstring = ""; for ($binaryplace = 0; $binaryplace <= 3; $binaryplace++) { @loopcount = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); $loopcountsgroupA = 0; $loopcountsgroupB = 0; until ($loopcountsgroupA ne $loopcountsgroupB) { for ($runnumber = 0; $runnumber <= 32; $runnumber++) { $x8microsecondschanges = 0; $previousx8microseconds = "null"; until ($x8microsecondschanges == 2) { ($seconds,$microseconds) = gettimeofday; $x8microseconds = int($microseconds / 8); if($previousx8microseconds ne "null" && $x8microseconds ne $previousx8microseconds) { $x8microsecondschanges++; } $previousx8microseconds = $x8microseconds; if($x8microsecondschanges == 1) {$loopcount[$runnumber]++;} } } $loopcountsgroupA = $loopcount[1]+$loopcount[3]+$loopcount[6]+$loopcount[8]+ $loopcount[9]+$loopcount[11]+$loopcount[14]+$loopcount[16]+ $loopcount[18]+$loopcount[20]+$loopcount[21]+$loopcount[23]+ $loopcount[26]+$loopcount[28]+$loopcount[29]+$loopcount[31]; $loopcountsgroupB = $loopcount[2]+$loopcount[4]+$loopcount[5]+$loopcount[7]+ $loopcount[10]+$loopcount[12]+$loopcount[13]+$loopcount[15]+ $loopcount[17]+$loopcount[19]+$loopcount[22]+$loopcount[24]+ $loopcount[25]+$loopcount[27]+$loopcount[30]+$loopcount[32]; } if($loopcountsgroupA < $loopcountsgroupB) {$bit = 0;} else {$bit = 1;} $bitstring = "$bitstring$bit"; } $decimaldigit = unpack("N",pack("B32",substr("0"x32 .$bitstring,-32))); if($decimaldigit < 10) { $decimaldigits = "$decimaldigits$decimaldigit"; $decimalplace++; } } if($range eq "") {$range = 1;} return "0.$decimaldigits" * $range; }
95.172.231.160 ( talk) 18:20, 29 January 2014 (UTC)
Quote: "In particular, not all operating systems (e.g. Windows) provide time of day to microsecond resolution." Windows does support it. Otherwise my script would not work. I have successfully tested it on Windows. 95.172.231.160 ( talk) 19:35, 29 January 2014 (UTC)
https://medium.com/@betable/tifu-by-using-math-random-f1c308c4fd9d#.nj1verf8n claims that this article uses the poor example MWC1616. It would be nice if someone more qualified would check the link and article, and possibly insert a more appropriate example of a PRNG.
If the current example for chosen simplicity and briefness rather than quality, it might be reasonable to instead pick something even simpler like DJB2, which I believe is a lot easier to explain. If instead quality is an important factor, MWC1616 seems to be a poor choice even in the refined variant, according to the link. -- mafutrct ( talk) 15:12, 21 November 2015 (UTC)
@ Mafutrct: the stock standard PRNG algorithm is (as the linked article points out) the Mersenne Twister, but if you want something with a very short pseudocode and comparable quality, xorshift is just a few lines. Chrome will apparently use xorshitf128+ to replace MWC1616. -- Tgr ( talk) 23:41, 31 December 2015 (UTC)
Just as an update: MWC has since been removed from the article. Sadly without a replacement. -- mafutrct ( talk) 13:56, 18 May 2016 (UTC)
I've always been led to believe that the digits of pi are truly random. Is this so? If so, worth a mention, I would think, since pi provides . . . how many now, 1 or 2 quadrillion random digits (I don't know what the current total number of known digits of pi is right now)? (Double that since presumably a random sequence is just as random when taken backwards(?)) DoctorFun1970 ( talk) 15:03, 1 September 2016 (UTC)
The problem would be making a random number generator to provide a choice for which number in the digits of pi to use. WikipediaUserCalledChris ( talk) 20:28, 23 January 2017 (UTC)
The result of the move request was: No consensus on scope, so no consensus on move. ( non-admin closure) Red Slash 00:42, 25 April 2019 (UTC)
Random number generation → Random number generator – As suggested by the boldfaced title in the lead, the article is clearly about random number generators, which are "a process", not "the process". The target has significant history, so a history swap might be needed. GeoffreyT2000 ( talk) 19:12, 7 April 2019 (UTC)--Relisted. – Ammarpad ( talk) 14:52, 16 April 2019 (UTC)
I believe some Linux systems are always collecting key-press timings as this is a source of randomness. They also use disk track-seek timings. ( https://blog.cloudflare.com/ensuring-randomness-with-linuxs-random-number-generator/ )
I have experimented with measuring the user's reaction time when given a series of (almost random) keys to press. In my case, the idea was to use the randomness in the reaction times to generate passwords. There ought to be more material out there describing these sorts of techniques and it would be useful to include this. 108.171.128.180 ( talk) 14:38, 4 July 2019 (UTC)
I did a google search on "including the rolling of dice, coin flipping, the shuffling of playing cards, the use of yarrow stalks (for divination) in the I Ching," and found this: [4]
The question is whether we lifted it from that source or whether they lifted it from us a slapped a copyright on it. -- Guy Macon ( talk) 05:42, 27 January 2019 (UTC)
Background.
@
Netoholic,
Guy Macon,
GeoffreyT2000,
Born2cycle,
ArnoldReinhold,
Rreagan007,
Primergrey, and
Waldyrious: This article was established by merging two articles, named
random number generator and
Random number generation. For a very long time, most of the content, and also the lead, more concerned "the generator" than "the generation" - to the extent that these concepts were distinguished. moreover, there are about twice as many links to this "generation" page by means of one or another "generator" variant as directly or by another "generation" variant. Some months ago, a discussion about moving the name to the "generator" title ended in a dead-lock; see
Talk:Random_number_generation/Archive_1#Requested_move_7_April_2019. Netoholic was the main proponent for retaining the "generation" title, and also proposed that the lead be rewritten to reflect the "generation" aspect, and that the multitude of links to "generator" in most instances be split up to references to either hardware or software generators. Explicitly, he wrote
This argument seemingly had some impact. Unhappily, also seemingly, he then did not have the time to make these changes himself.
However, a few months later, here Primergrey indeed made an effort to "match the lead to the title". However, this removed the connection with the merged "generator" article, and left the overwhelmingly abundant references to "generators" unexplained. It also resulted in declaring that RNG be an abbreviation for "random numbers generator".
The present wikidata discussion.
There is an unresolved proposal to merge the wikidata item for "Random number generation" (
d:Q228206) with the one for "Random number generator" (
d:Q61722412); see
d:Wikidata:Interwiki_conflicts/Unresolved/2021#random_number_generation_(Q228206)/random_number_generator_(Q61722412). Seemingly, there was just one item until two years ago, when Waldyrious split them, and distributed some of the articles to the new item; however seemingly more by reference to the article names than to their contents. As far as I can see, most remaining Q228206 articles have names and content reflecting the enwp article (as it was before Primergrey's lead change); i. e., their titles refer to "generation" but their content to "generator". Only in a few articles (in both groups) did I find some sentence which would be more in line with Netoholic's proposal; although the guys writing their articles from scratch or translating e. g. the enwp one did not seem to indicate any conceptual difference between "processes" and "devices". (Of course, I don't really read all these languages, and e. g. had to guess about the significance of the last token in the zhwp sister article, present in the boldface article start but not in the article title.) I'm afraid that presently this has broken the interwiki connections; all the articles I've succeeded to understand anything from seem to be "true sisters".
My opinion.
There are some points to be said in favour of Netoholic's arguments - if they be realised. However, I disagree with the idea that "random numbers generator" in se is a bad term, since it may make readers confuse hardware and software generators, both named precisely generators. Actually, naming (more specific) subconcepts by the superconcept name plus a distinguishing attribute both is a very common and a very reasonable policy. Instead, I think, that if Netolothic's programme should be realised, then it would be best essentially to undo the old merge of
Random number generator and
Random number generation, splitting the two articles into a longer "generator" one and a shorter (although conceptually more general) "generation" one. If no-one in the foreseeable future is willing to and has time do this, nor to pursue Netoholic's original proposal, then I think that the lead should be made to reflect the merged article character of this article a bit better.
JoergenB (
talk)
21:20, 7 February 2021 (UTC)
Ways of accessing random numbers in various operating systems is already the subject of entirely separate articles: /dev/random and CryptGenRandom, etc. Throwing in some talk about one particular way to get them in some Unix-like operating systems seems out of place in this article. I think we should remove the textual reference to them from this article and just have a "See also" link at the top. Mr. Shoeless ( talk) 15:14, 3 September 2023 (UTC)