Can someone suggest an algorithm to find a random number within say a limit ‘n’, that could be computed in least computation time?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.