next up previous
Next: Autocorrelation Up: Testing for randomness and Previous: Testing for randomness and

Moments

The $k-th$ moment of a distribution is defined as:
\begin{displaymath}
\langle x^k \rangle = \frac{1}{N} \sum_{i=1}^N x_i^k.
\end{displaymath} (262)

If the numbers are distributed with a uniform probability distribution $P(x)$, then (264) must correspond to the moment of $P$:

\begin{displaymath}
\int _0^1 {x^kP(x)dx} \sim \frac{1}{k+1}.
\end{displaymath}

If this holds for your generator, then you know that the distribution is uniform. If the deviation from this varies as $1/\sqrt{N}$, then you also know that the distribution is random.



Adrian E. Feiguin 2009-11-04