# Are there pseudorandom sequences which cannot be learned by any ML model but which still fail the Diehard tests?

This is likely a very silly question which has a simple answer. As I understand, ML models are able to detect patterns in sequences. Given a sequence which is not truly random but rather only pseudorandom, the fact that there is some underlying pattern in such a sequence suggests that given a sufficient amount of training data, that an ML model should be able to approximately "learn" and generate the next digits of the sequence. Are there any pseudo-random sequences which could not be learned by an ML model? What is the relationship between learnability by an ML model and the ability of a pseudorandom sequence to pass the Diehard tests? i.e. does failure to be learned by any ML model imply that the pseudorandom sequence should pass the Diehard tests? Are there counterexamples to this?

Again, I am not a theoretical computer scientist, but rather a mathematician. It is likely that I am misunderstanding some key concept.

If a sequence fails some Diehard test, then the sequence is not pseudorandom, and in particular, there is some way to predict the next bit of output with probability better than $$1/2$$. Since Diehard uses fairly simple tests, the prediction algorithm will also be fairly simple. If there exists a simple algorithm to predict the next bit with probability significantly better than $$1/2$$, I expect it is likely that some ML algorithm can learn it. Therefore, if no ML algorithm can predict the next bit with probability significantly better than $$1/2$$, and if you use a sufficiently good ML method (with sufficient capacity, sufficient training data, etc.), then I expect it is likely the sequence will also pass all Diehard tests.