# Thread: How do Computers pick Random?

1. I don't want specifics, just theory on how computers, the solid, fact machines pick random numbers.
Thanks!

2.

3. They don't make real random numbers and that causes problems sometimes.

Computers can make Pseudo-random numbers which for most uses are good enough. Computer random number generators require a seed which is a number to start the computer going on a random sequence. If you give another computer, using the same pseudo-random number generator the same seed it will create the same sequence of "random" numbers. But if I were to give you that sequence it would look very random.

There are statistical tests to evaluate if a sequence is random. For example the Pearson's chi-square test

4. Actually computers can produce really random numbers. Consider Linux's /dev/random as an example. It accumulated information from low level events (thread interaction, network and so on), hashes it all at an entropy pool and releases to programs of demand. WinAPI has similar capabilities.

5. Say "BlasW" I did not know about /dev/random and I run Linux exclusively. I have abstracted myself too far from core. I normally just use high level programs like Mathematica, IDL etc.

Thanks.

6. Generally speaking, those two methods are the only two ways computers generate random numbers (either pulled from a source of entropy, or made algorithmically, which only makes pseudo-random numbers).

7. Thanks!
I though that computers could get true random numbers just from non-physical sources.

8. You can make pseudo random numbers using methods such as the logistic difference equation. Truely random sequences are however impossible as far as I know. You can make random numbers that are random enough even for most scientific studies, but at the core it is still a deterministic algorithm and the sequence can be predicted if you know the initial state of the generative system.

9. You can make true random numbers if you have a source of entropy. The user or users can sometimes provide that.

On the other hand, a purely algorithmic random number generator can't produce true random numbers (just pseudo-random).

The logistic equation isn't usually used to produce random numbers though. The simplest generators are called linear congruential generators and take the seed (all pseudo-random number generators need a seed), multiply it by something, add something and finally take the remainder modulo some third number, and return that as the next number. They use the same number as the next seed.

For example, let's take the multiply as 31, the add as 8, then the mod as 225, and the seed as 111. When you go to get the next number, you'll get
(31 * 111 + 8) mod 225 = 74
then
(31 * 74 + 8) mod 225 = 52
then
45, 53, 76, 114, 167, 10, 93, 191, 79, 207, 125, 58, ... (eventually giving each of the numbers from 0 to 224)

Which looks fairly random at a glance, but it really isn't. LCGs are typically considered very bad generators. There are several other common algorithms that are still fast and give better quality output.

10.

11. Neat idea. Chaos isn't often used so directly. (It doesn't use the logistic map though.)

 Bookmarks
##### Bookmarks
 Posting Permissions
 You may not post new threads You may not post replies You may not post attachments You may not edit your posts   BB code is On Smilies are On [IMG] code is On [VIDEO] code is On HTML code is Off Trackbacks are Off Pingbacks are Off Refbacks are On Terms of Use Agreement