views:

199

answers:

7

Is it possible to generate random numbers through physical process simulation?

If I simulate the physical roll of a dice (i.e. you picking it up, shaking it in your hand, releasing it onto the table and recording which side ends up "up"...) will that produce a "random" number or would I just have a complex simulation which really accomplishes nothing.

+6  A: 

You would have a complex simulation which really accomplishes nothing.

(other than to return the same value every time, or add unnecessary complexity to an existing PRNG)

Unless you seed the simulated environment with "random" variables (i.e. depend on a different means of generating random numbers), you will always get the same value back, because every step in the process will happen the same way every time.

Say you did use a base pseudo random number generator (PRNG):

Since your simulation would only be as random as the other PRNG you were using, you may as well just use the other PRNG directly, without all the extra work! (In fact, your simulation may not do anything except make the output less random than the values from your base PRNG)

Daniel LeCheminant
A: 

The later.

Unless you inject some random (or pseudo random) factors the simulation will produce the same results every time.

MarkusQ
A: 

It'll still be a pseudo-random number because presumably you'll be using a pseudo-random number generator to simulate all the bouncing around of the die in your hands.

Dana
+1  A: 

Yes, you would "just have a complex simulation which really accomplishes nothing".

Why simulate a random physical process, when you could actually use a real one?

There are stacks of questions about random number generators on SO. Here are just a few:

http://stackoverflow.com/questions/37702/true-random-number-generator

http://stackoverflow.com/questions/203382/do-stateless-random-number-generators-exist

http://stackoverflow.com/questions/426821/what-type-of-random-number-generator-is-used-in-the-gaming-industry

Mitch Wheat
+1  A: 

Your algorithm will be a pseudo-random number generator, that is to say it will take in a random seed and produce potentially large number strings which look fairly random.

There is no guarantee however that your random output will be of the quality that you need for cryptography or other purposes. I'd be inclined to think that there will be undesirable repeated patterns in your output, and that too much work will go towards the physics of the problem, and not enough to producing pseudo randomness. (Sorry for the wishy washiness, but that's it in a nutshell.) There exist effective pseudo number generators, and I would use one of the shelf.

That said, this might be an interesting and informative experiment for your own purposes.

Rob Lachlan
A: 

First you need to define 'random'. You can generate trivially unpredictable numbers by using a strange set of calculations, sure. But you won't get useful randomness or an even distribution of numbers.

A physical simulation like you describe would actually require some sort of random number generator at some point in the calculation. Fortunately, random() is easy to use.

John Fricker
A: 

Unless you're prepared to model the quantum state of two entire dies you'll have nothing random...

Dave Swersky
What is quantum state?
It's a joke... look up quantum physics...
Dave Swersky