Jump to content

Talk:Random number generation: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
No edit summary
Line 1: Line 1:
{{WPStatistics|class=start|importance=low}}
{{WPStatistics|class=start|importance=low}}

==Section 3.3 is irrelevant==
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.





Revision as of 05:53, 4 January 2014

WikiProject iconStatistics Start‑class Low‑importance
WikiProject iconThis article is within the scope of WikiProject Statistics, a collaborative effort to improve the coverage of statistics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the importance scale.

Section 3.3 is irrelevant

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.


Randomness is an observed entity

The article starts out with: "A random number generator (RNG) is a computational or physical device designed to generate a sequence of numbers or symbols that lack any pattern, i.e. appear random." But it should be the other way around: If an Observer find that a sequence lack any pattern, it appears random to him. Different observers may rate the same sequence differently. The randomness is not in the sequence.

Bo Domstedt http://www.trng98.se


Reference to PokerStars

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)[reply]

Example?

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 (talkcontribs) 15:46, 23 August 2009 (UTC)[reply]

??

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)[reply]

the odd thing about this is the fact that i clicked on the Random Article link and this was the page that came up :)

Yes, it should be merged with random number generator at the least. Richard001 05:09, 12 February 2007 (UTC)[reply]

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)[reply]

Yes but Random Number Generation exists outside of computer programming 71.52.51.151

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)[reply]


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)[reply]

Your view appears to be biased... A properly designed hardware RNG will be theoretically unpredictable, no measurable bias. By the way, quantum generators do exist ( http://comscire.com/cart/Files/whitepaper/Pure%20Quantum%20White%20Paper.pdf ) — Preceding unsigned comment added by 64.238.189.169 (talk) 19:57, 18 July 2013 (UTC)[reply]

Practical applications and uses of random numbers

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)[reply]

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)[reply]

Sophie Germain prime

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)[reply]

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)[reply]

Fact tag

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)[reply]

I'm assuming that you put in the "fact" tag about six months ago...
By definition, a TRULY random system, having playing one song out of one hundred, would not have a lower chance of playing that same song again. It's still one in a hundred. (If it were otherwise, that would mean we'd have a simple means of guessing what will happen next with a better than one in one hundred success. That don't sound random, do it?)
With true randomness, the sorts of flukes that you describe would actually be a quite noticeable phenomenon, especially when you consider that you'd probably notice if ANY of the one hundred songs repeated quickly. Humans are pattern-seeking animals, and we sometimes see them where they don't exist. If one NEVER saw repeating track, we probably wouldn't notice, although it would actually be gradually building evidence that it wasn't random.
But back to the nutmeat. Here's the article's statement:

"...A true random system would have no restriction on the same item appearing two or three times in succession."

And here's your statement:

"...Allowing the same selection twice (or more) in no way ensures that selection is truly random."

These two statements do not contradict each other, any more than "Eating an apple means you're eating a fruit" is contradicted by "Eating fruit doesn't ensure you're eating an apple". I've got another analogy. "Playing with matches might start a wildfire" isn't contradicted by "A wildfire's existence in no way ensures that someone played with matches".
In my analogies, and the statements, matches aren't the only way to start a fire, apples aren't the only fruit, and randomness isn't the only way to get repetitions.
Some of this may be confusing or counterintuitive to some people, and may need more explanation, but the article doesn't need a tag for citation, as it's a simple statistical truth. I think I should remove it, and I think I will.
Misha Vargas (talk) 14:48, 5 February 2009 (UTC)[reply]

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)[reply]

SOCR advertisement

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)[reply]

Spam as a source of randomness

Gentlemen, finally a use for spam: employ it in Random number generation. (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)[reply]

Entropy vs. unpredictability to an attacker

There's terminology here that isn't clearly defined about the "quality" of random numbers and what is "truly" random. Here are some categories:

  • Arbitrary numbers: the shuffle function on your MP3 player might not even try to be random, but it's not obvious either.
  • Non-cryptographic pseudorandom number generators: easy to predict future outputs from past.
  • Cryptographic *pseudo*random number generators: These take a key of, say, 256 bits. For the best generators (e.g., AES in counter mode), nobody knows a practical way to distinguish a couple gigabytes of output from true randomness. If we discover an attack on the algorithm or have a vast (qualitative) increase in computing power, that could change.
  • Typical cryptographic random number generators: These hash information that's assumed unpredictable to an attacker (e.g., details of mouse movements, precise timing of keystrokes and hard disk activity), with the goal that the attacker should have to make 2^128 or 2^256 or whatever guesses. Given good estimates of the entropy in those inputs, the generator can be rigged so the crypto algorithms only need to provide statistical mixing, and the output will still appear random no matter what advances there are in cryptanalysis and computing power.
  • Basic "true" random number generators: Based on air turbulence, the lower bits of precise temperature readings, etc. -- things we're highly confident nobody (us or anyone else) could predict. We may be able to use parts of the output directly, without a mixing function.
  • Advanced "true" random number generators: Based on timings of atomic decays, etc.

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)[reply]

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)[reply]

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)[reply]

References and footnotes

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)[reply]

I have just added two new sections: Notes and References. I put the [1] external link into the References section and made a footnote reference to the original web-page link. Looking at the result suggests that I reverse this and put the external link reference into the Notes... Will do that now!--Михал Орела (talk) 14:12, 13 January 2009 (UTC)[reply]
Skiena Mission complete! There are two more inline references still to be dealt with.--Михал Орела (talk) 14:25, 13 January 2009 (UTC)[reply]
All done! Now it would be nice to provide citations (if needed) for other claims in the body of the article.--Михал Орела (talk) 14:56, 13 January 2009 (UTC)[reply]

Cleanup

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)[reply]

See Also

Add a link to Randomness_tests ? 82.163.24.100 (talk) 17:45, 7 July 2009 (UTC)[reply]

Marsaglia MWC generator

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)[reply]

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)[reply]

"Truly random computational number generator" ???

"Only in 2010 was the first truly random computational number generator produced, recurring to principles of quantum physics.[2]"\

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)[reply]

W-Chaos

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 (talkcontribs) 23:05, 1 January 2011 (UTC)[reply]

As I mentioned in my edit summaries, there is nothing that indicates notability for this software. The SourceForge web page does not even list the name of the developer (you); it is buried inside the 7zip file. For an implementation to be mentioned on Wikipedia, it should be in widespread use or be acknowledged by independent experts as being a novel idea. Han-Kwang (t) 19:20, 2 January 2011 (UTC)[reply]
Agreed, but, actually, it cannot be done in no Time. Just a question, did you try app to generate random numbers??? — Preceding unsigned comment added by Evgeney Knyazhev (talkcontribs) 01:35, 3 January 2011 (UTC)[reply]
"try app to generate random numbers" -- I don't understand you, but anyway, I don't think the answer is relevant for this discussion. Han-Kwang (t) 22:27, 3 January 2011 (UTC)[reply]

@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)[reply]

Sorry, if there are no reputable reviews or papers mentioning W-Chaos then it shouldn't be here. Can you supply any such references? Sebastian Garth (talk) 20:46, 4 January 2011 (UTC)[reply]
Thanks for reply, Sebastian. Actually, i've searched independent specialists to verify algorithms. --Evgeney Knyazhev (talk) 00:07, 5 January 2011 (UTC)[reply]

Visual comparison of random vs. pseudo-random generators

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)[reply]

That is not a representative picture. Some PRNGs are very very good and are indistinguishable from an RNG. That website only shows a very poor PRNG and gives a false impression that all PRNGs are bad. HumphreyW (talk) 21:36, 13 March 2012 (UTC)[reply]