Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Since computers work off formulas, without greater knowledge one would assume that it would come up with the same answer for a set formula. However, you're able to tell it to generate a random number. IE: php rand(). What's the formula that's used to get a random number? How can there be anything "random" in an algebraic expression?

Been wondering for a while, hopefully it's not blatantly obvious.

share|improve this question
    
If you have a formula for randomness, how is it random? Who decides what is random? BTW - I know the answers to these questions. –  user94648 Sep 13 '13 at 7:40

2 Answers 2

up vote 6 down vote accepted

There is a discussion in Wikipedia and many books on the subject. The numbers are deterministic but scattered. You hope that in the ways you use them, they "act like" they are truly random.

share|improve this answer
    
So based on that article, in essence the first "random" number it uses is the clock in milliseconds. Very interesting. –  bradenkeith Jan 19 '11 at 16:34
1  
That is often done, or in most cases you can supply your own seed. That is useful in debugging, so you can make sure you get the same series of "random" numbers. –  Ross Millikan Jan 19 '11 at 16:41
3  
A more useful and direct link maybe the article on PRNGs. –  Willie Wong Jan 19 '11 at 17:49

There are also hardware circuits that can produce random numbers.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.