alex Posted March 1, 2007 Posted March 1, 2007 for all you math and computor geniuses... this might be worded a bit weird(i'm not the greatest with words...) how do computors or programming languages come up with/define random sequences? example: if i tell a computer or write a program to pick a random positive integer between 1 and 100, what's going on behind the scenes? i hope my question makes sense. thanks to anyone with helpful replies... i've always been curious about this and until now have never really bothered to investigate(feel free to call me a lazy jackass...or whatever) -alex
alex Posted March 1, 2007 Author Posted March 1, 2007 whoa...i just changed from a lepton to a quark...
timo Posted March 1, 2007 Posted March 1, 2007 Pseudo-random numbers produced by the standard PC are generated by algorithms, that´s why they are pseudo-random even though the "pseudo" is often omitted. We´ve had several threads about this on SFN in the past so doing a search for the keywords "random numbers" should give some useful results.
alex Posted March 2, 2007 Author Posted March 2, 2007 i knew they were generated by algorithms...i just wanted to know the specifics behind the algorithms...and what it would take to constitue a "random" number...i guess i should have been more clear. i'll search for those threads you mentioned. -alex
Cap'n Refsmmat Posted March 2, 2007 Posted March 2, 2007 Here's a good article. Other systems simply gather data about various things the computer is doing at the moment - disk access, processor utilization, and various other things that aren't entirely predictable - and create a "pool" of randomness that they can then pick from.
the tree Posted March 2, 2007 Posted March 2, 2007 i knew they were generated by algorithms...i just wanted to know the specifics behind the algorithms...and what it would take to constitue a "random" number...i guess i should have been more clear.Different algorithms create different quality pseudo random numbers. Better quality means you have less chance of predicting what number is going to come up next, without knowing the exact parameters used. Really good quality pseudo random number generators use really long and complicated algorithms that require quite an understanding of discrete mathematics to comprehend. For example Linear Congruential Generators are fairly simple and can be hacked (predicted) without too much difficulty. You'd use this when high quality randomness is not mission critical such as a random component to some AI or the need for random choices during critical path analysis. Higher quality pseudo random number generators like Mersenne Twister that Cap'n linked to would be used for scientific research. Such as running a simulation and wanting a fair sample of possible starting variables but not having enough resources for every possible starting variable. Taking "real data" like the time, the core processor temperature et cetera might sound like a good idea at first but it is completely useless when debugging needs to be done and you want to run the program exactly the same way again.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now