Possible Duplicate:
how does random() actually work?
My art teacher used to always tell us how computational randomity is never truly random. As a determinist I don’t think that randomity exists at all, but my programming-related question is this:
How exactly does a computer produce a “random” number?
Random numbers produced by computers are typically pseudo random. See: pseudorandom number generator.
Basically there is an algorithm that produces a sequence of values deterministically. These values are spread across the range so they look like random, but they are completely predictable. Typically you start generator with some seed and if you use the same seed, generator will produce the exact same output every time.
See also
http://www.random.org/ – truly random number based on atmospheric noise
http://www.entropykey.co.uk/ – hardware USB device based on analog noise in transistors