How does a computer program generate random numbers? Example: when you ask Siri to give you a random number between 1 to 10, how does it come up with that number?

744 viewsMathematicsOther

How does a computer program generate random numbers? Example: when you ask Siri to give you a random number between 1 to 10, how does it come up with that number?

In: Mathematics

18 Answers

Anonymous 0 Comments

There are a lot of different ways!

Sometimes they do math on a changing number, like what time you asked for a random number.

Sometimes they look one up on a list of random numbers 

Sometimes they use something else.

For the math one you could do something like take the time in milliseconds, and take the last 10 digits. Put a decimal place in front so it’s in a zero to one range. Now multiply it by the range you want a random number in. Done!

If you want you can do more math to the numbers to change them.

You are viewing 1 out of 18 answers, click here to view all answers.