Take the 2-minute tour ×

Let G be a generator that on each invocation yields a bit of a binary sequence of length N. Generator wraps around N, so invocation k returns the same result as k%N. What's the best way to check if the sequence has a period smaller than N? Assume N is too big to factor.

share|improve this question
add comment

1 Answer

Good question. I think it belongs on math SO. Google for "random number generator diehard test" to see a good way to test your generator.


share|improve this answer
add comment

Your Answer


