0

I have tried to make a pseudo Random Number Generator and generated 10000 numbers. I want to determine whether there exists a cycle in it? With my logic, there could be a cycle of maximum length (INT_MAX)**15 - generating and testing till that value is kind of not feasible. So, is there a way to recognize with N generated numbers(sufficiently large - 10007 numbers) to estimate what length of cycle will be there?

Possibly in R?

user3392464
  • 141
  • 1
  • 9

1 Answers1

3

The answer to your question is probably much more complex that you would like it to be. Testing weaknesses in PRNGs is not a simple question, and it is highly dependent on the algorithm used for the PRNG. If your PRNG is of type Linear congruential generator, then a test called spectral test can be used. For other types of PRNGs there are other tests.

The paper TestU01: A C Library for Empirical Testing of Random Number Generators discusses theory and contains software examples on how to test various types.

hlovdal
  • 26,565
  • 10
  • 94
  • 165