Actually I was learning PHP, so this question just came into my mind. How does the computer pick a random number?
- What is the logic behind this random number generation?
- Is the computer using garbage values for random numbers?
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 random numbers we normally have access to from code are called pseudorandom numbers. They are based on mathematical sequences of numbers that only repeat themselves after a very, very long time. The place to start in the sequence is based on the seed, which is normally taken as a function of time.
The numbers appear to be random, but in reality they’re not, and that’s why they’re called “pseudorandom”.
Further reading: http://en.wikipedia.org/wiki/Random_number_generation