View Single Post
Old 07-17-2009, 07:53 PM
ultrafilter ultrafilter is offline
Join Date: Nov 2006
Posts: 374

Originally Posted by Dr T Non-Fan View Post
Question: is RAND() random? Meaning, can you create a program that predicts the next number it will create?
RAND() is not random, and its output can be predicted. The fundamental issue with generating random numbers on a computer is that software is deterministic--if you run a program multiple times with the same inputs*, you'll get the same outputs every time. Whether this is a problem or not depends on how hard to predict your sequence needs to be. For most purposes, something like a Mersenne Twister implementation is fine--that's much harder to learn than something like RAND() (at least as far as we know)--but if you need something that absolutely can't be predicted, you're looking at buying specialized hardware**.

*: For purposes of this discussion, let's ignore issues of statefulness and assume that everything the program uses to compute its output is part of the current input.
**: The major CPU manufacturers have discussed including random number generators in future chipsets, but so far as I know, no one has concrete plans to do so.
Reply With Quote
Page generated in 0.09921 seconds with 9 queries