18 ms·
Do you mean, after picking a million numbers, then every number in the range should have been picked exactly once?
by p51ngh 3y ago
Do you mean, after picking a million numbers, then every number in the range should have been picked exactly once?
- jbstack 3y agoDefinitely not this. That wouldn't be random at all. For example, after picking 999,999 numbers you would be able to predict the next number with certainty. What it means is that every time you select a number, every number in the range has an equal probability of being selected.
- dtgriscom 3y agoWhich means that there must be more state in the generator than is output as a random number; otherwise each time number X was produced then number Y would follow it. (Perhaps obvious, but I like stating the obvious.)
- kortilla 3y agoNo, each number has a 1 in a 1,000,000 chance each time the generator is used.
- Tainnor 3y agoThat's not a uniform distribution. Probability doesn't remember previous state, so the chance of picking the number 241 out of 1 million numbers remains exactly the same after picking 241 once. In particular, the chance of getting no duplicate numbers if you pick a million times, is very close to zero.