# Going Beyond Pseudorandom Numbers

I cooked up this simple bit of code in hopes to exceed pseudorandom number generation maybe touch the face of true randomization:

    For[i = 1, i < 65, i++,
seed0 = RandomInteger[{1, 22957480^3}];
SeedRandom[seed0]; seed0 = RandomInteger[{1, 22957480^3}]];
SeedRandom[seed0];


I am concerned over the default seed value though. Anyone have a better way to generate randomness?

-
What's wrong with the default seed ("the time of day and certain attributes of the current Mathematica session")? – István Zachar Mar 7 '12 at 17:53
@Sinistar What you do does not perform any better that default initialization. In fact, there is a 1-1 mapping from the default seed to the seed you propose. Thus you introduced no additional randomness. – Sasha Mar 7 '12 at 18:05
Does anyone have an opinion on the methods offered by SeedRandom? – Sinistar Mar 7 '12 at 18:10
"MersenneTwister" Mersenne twister shift register generator "MKL" Intel MKL generator (Intel-based systems) "Rule30CA" Wolfram Rule 30 generator – Sinistar Mar 7 '12 at 18:10
@Sinistar I read your flag. Moderators cannot control how people vote, so appealing to us not to down-vote won't help. (Incidentally one of the two up-votes is mine; I thought it was a good question because of the discussion it lead to.) I suggest you add a note to the top of your question kindly asking people to stop down-voting. – Mr.Wizard Mar 20 '14 at 19:32

You cannot, by principle, get true randomness through a deterministic algorithm, no matter how sophisticated. If you need true random numbers, you'll have to collect some physical randomness. I don't know about an OS-independent way to do that, but on Linux, the pseudo-file /dev/random collects entropy from various sources.

Of course, unless you are implementing cryptography, you'll most likely not really need true randomness (and even there you generally only need it to seed the cryptographically secure pseudo-random number generator, unless you are generating an one-time pad).

-

Here is how you can get a truly random number:

http://www.idquantique.com/true-random-number-generator/products-overview.html

Quantum mechanics.

You could also use Random.org which provides random numbers based on atmospheric noise:

http://www.random.org/

But is atmospheric noise, really random enough for you?

-

To add to what @celtschk said, I've seen programs like TrueCrypt use mouse movement entropy to seed a (pseudo?)-random number generator. To get mouse input in MMA for 10 seconds, you could use something like:

mouse = {};
updateMouse[pos_] := AppendTo[mouse, pos]
Dynamic[updateMouse[MousePosition[]]]
Pause[10];
Clear[updateMouse]


I don't know much about cryptography and creating good entropy seeds, but this is the start of an approach that could be used.

-

I believe Mathematica is robust enough for writing a driver and the necessary image recognition software for this machine.

-