WOLFRAM|DEMONSTRATIONS PROJECT

Testing an Intuitive Random Generator with the Task of Emptying a Cube

​
sites along any side of the cube, n
8
number of gray reference curves, m
3
modified logarithmic representation
seed for Mathematica's random generator
0
seed for the sine-floor random generator
0
sine-floor factor
1000000
It is to be expected that the less significant digits of
sin(k)
depend on the integer argument
k
in a chaotic manner so that the formula
g(k)=1000000sin(k)-⌊1000000sin(k)⌋
(where
⌊x⌋
is the floor of
x
) is expected to define a uniformly distributed sequence in the unit interval
[0,1)
. This Demonstration lets you use this formula as a random generator and perform a rather selective test with it. We compute an entity (the blue curve) that—under the assumption that the random generator is perfect—is a realization of a certain stochastic process: emptying a cube. All properties of this process can be computed exactly and are shown by the green curve (decay of the "mean occupation number") and the two red curves (mean occupation number ± one standard deviation). The random generator passes the test if the blue curve remains approximately between the red lines.
The blue curve shows a simulated population decay of the cube emptying process, which is a discrete-time stochastic process on a finite probability space. The random decisions are based on random numbers delivered by the sine-floor generator
g(k)
. A simulation method is used that assumes statistical independence of successive triplets of random values.
The gray curves show simulated population decay according to a simpler simulation method. It is based on Mathematica's default random generator and only assumes uniformity of the random values.
The sine-floor generator passes the test if the blue curve can be considered an inconspicuous member of the ensemble of the gray curves. This method is more direct and more universal than trying an analytical representation of population mean values and variances as functions of the process step. In this elementary case, this analytical representation can be obtained from moment-generating functions.
The exact population mean together with ± one standard deviation of the emptying process is given as the green curve and the two red curves.
More explanations on controlling this Demonstration and its meaning are given in the mouse-based annotations ("tooltips") to the graphics and in the Details section.