Is it possible to predict the next number in a number generator? [closed]

ぃ、小莉子 提交于 2019-11-29 07:35:37
Bill the Lizard

Yes, it is possible to predict what number a random number generator will produce next. I've seen this called cracking, breaking, or attacking the RNG. Searching for any of those terms along with "random number generator" should turn up a lot of results.

Read How We Learned to Cheat at Online Poker: A Study in Software Security for an excellent first-hand account of how a random number generator can be attacked. To summarize, the authors figured out what RNG was being used based on a faulty shuffling algorithm employed by an online poker site. They then figured out the RNG seed by sampling hands that were dealt. Once they had the algorithm and the seed, they knew exactly how the deck would be arranged after later shuffles.

Assuming a deterministic algorithhm. Create two identical random number generators. Ask the first one what the second one will produce next -- 5 times.

The vast majority of "random number generators" are really "pseudo-random number generators", which means that, given the same starting point (seed) they will reproduce the same sequence. In theory, by observing the sequence of numbers over a period of time (and knowing the particular algorithm) one can predict the next number, very much like "cracking" an encryption.

The time/effort required to do this will vary greatly depending on the specific algorithm, of course. RNGs that are "cryptographic" will be very much harder to predict than your garden-variety RNG. But for most uses of random numbers this sort of predictability is not a problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!