# Finding the seed of a random number

I'm new to machine learning, and AI in general (but with 20+ years for programming). I'm wondering if machine learning is a good general approach to find the seed of a random number generator.

Suppose I have a list of 2000 numbers. Is there a machine learning algorithm to correctly guess the next number?

Just to be clear, as there are many random number generator algorithms. I'm taking about rand and srand from the stdlib.

Thanks, Eden

Even simple PRNGs that are not suitable for use in simulators (such as rand()) are varied enough that it is very hard to reverse engineer them statistically using generic techniques - essentially what 90% of ML does is fit a generic model to data statistically by altering parameters. The remaining 10% might do things in specialist manner, such as saving all the data and picking best option.
In theory most ML approaches would eventually solve a PRNG, however that would typically involve iterating through the entire state space of the PRNG multiple times. The statistical relationship between internal state, next state and output of a PRNG is complex by design, so that this is the only "black box" statistical approach, and this is clearly not feasible for any real implementation of a random number generator, which is going to have at least $$2^{31}$$ states on modern machines. Perhaps older 16-bit PRNGs, with a single value for state might be tractable.