A simple statistical test that can be useful for testing the randomness of a distribution: Generate a uniform distribution d[0..r] using the (suspected) PseudoRandomNumberGenerator you want to test and doing N runs. N should be greater than say 10*r. The average fill in each slot in d is f = N/r ChiSquared = Sum[0<=i