4 ms·
That's assuming that the random number generator is truly random, and not a deterministic pseudo-random-number-generator, which will _necessarily_ produce a seq
by Yen 9y ago
That's assuming that the random number generator is truly random, and not a deterministic pseudo-random-number-generator, which will _necessarily_ produce a sequence of numbers that satisfy certain statistical properties, over a long enough run.
It's unlikely, but possible, to roll a 6-sided die 100 times in a row and get 100 6's.
In basically every PRNG algorithm, there is _no_ reachable state which will result in 100 6's in a row.
- cdelsolar 9y agoAre you sure about this? The period of a Mersenne twister is 2^19937 - 1. I'm pretty sure somewhere along that inconceivably large number of states we can find 100 6s in a row.
- robocat 9y agoThat's only about 6000 decimal digits long - from a quick visual check the longest run was four sixes in sequence: http://lcn2.github.io/mersenne-english-name/m19937/prime-c.html http://lcn2.github.io/mersenne-english-name/m19937/prime-c.h... Expect to get length 1 in a number 10 digits long, 2 in a number 100 digits long (10²), 3 in a number 1000 digits long (10^1000)... So expect to find a run of 100 6s in a random number 10^googol digits long I think.
- Dylan16807 9y agoNo, the RNG doesn't output successive digits of the prime. That would be period 19937. It's period 2^19937. The random number is 10^6000 digits long. > 10 digits long[...]100 digits long[...]1000 digits long[...]10^googol digits long I think. Not 10^googol digits. Googol digits long. Except you don't even need that much, because die rolling is base 6.
- gregmac 9y ago> It's unlikely, but possible, to roll a 6-sided die 100 times in a row and get 100 6's. It's exactly as unlikely, but possible, to do the same and get the exact sequence: 6 2 2 4 5 4 4 1 4 4 4 3 5 4 2 4 6 2 4 4 1 1 2 4 4 4 6 6 4 6 6 1 1 2 4 4 1 5 1 2 3 6 3 3 3 1 6 4 1 4 1 5 4 2 2 5 6 2 1 6 3 5 3 3 2 6 6 6 3 6 5 5 1 5 4 6 2 6 4 3 2 2 5 1 5 3 3 5 4 5 6 4 1 5 5 6 6 6 6 3 (generated via https://www.random.org/integers/?num=100&min=1&max=6&col=5&base=10&format=html&rnd=new https://www.random.org/integers/?num=100&min=1&max=6&col=5&b...)