Skip to main content
1 of 3
riwalk
  • 7.7k
  • 3
  • 31
  • 32

Depends heavily on how you are trying to make the prediction.

Most PRNG's that I've used usually operate on a ring of numbers within a finite range. The seed decides what number you start on, and you progress around the ring one number at a time. The order of the numbers appears random, but their order is actually very deterministic.

For example, lets say that your prng generates numbers on the ring 0-6. If your seed is 1, then it might cycle through numbers in this way:

1 -> 6 -> 2 -> 4 -> 0 -> 3 -> 5 -> 1 -> 6 -> ...

Some important things to note:

  • Once you reach the seed again, the values repeat.
  • Apparent randomness is achieved by generating a ring that appears to "scatter" numbers around and choosing a different seed every time you run the generator.

When looking at it in this respect, it is actually quite easy to predict the next random number that comes from a typical prng--all you need to know is the function that generated the ring of numbers and the last number that was pulled from the sequence.

It might be tough to understand why the numbers appear random in the first place (especially when looking at the sequence above). The thing to understand is that the range of numbers is usually enormous (on the scale of 2^31-ish), and therefore it is EXTREMELY unlikely that you will land in the same section of the ring on subsequent runs of the program.

So depending on your situation, what you are doing could be quite easy--if you know the function that is generating the sequence of numbers, then all you need is the last number pulled and you're done! No neural network needed.

If you don't know the function that generates the ring of numbers, then it is very unlikely that a neural network will help. The function that generates the cycle of numbers is designed to be a one-way function (a.k.a., you can't invert the function to figure out the values used within the function).

If you're interested in pursuing this further, I highly recommend that you study PRNG's in depth. The math is fairly simple for mere mortals to understand, and knowing how they work will give you a better idea of how they work--and what their limitations are.

riwalk
  • 7.7k
  • 3
  • 31
  • 32