Reputation: 3903
Can someone suggest an algorithm to find a random number within say a limit 'n', that could be computed in least computation time?
Upvotes: 3
Views: 147
Reputation: 226296
The Complementary-Multiply-with-Carry random number generator has a long period and with comparatively simple update operations. It strikes a nice balance between speed and quality.
To see some working code, there is a Python recipe for CMC.
Upvotes: 3