Function Repository Resource:

NoiseSphere

Source Notebook

Visualize the noise sphere of a set of random numbers

Contributed by: Jan Mangaldan

ResourceFunction["NoiseSphere"][{r1,,rn}]

plots Pickover's noise sphere visualization of the numbers ri.

Details

A noise sphere maps a sequence of uniformly-distributed random numbers to spherical coordinate triples. This is useful for visually detecting any unexpected correlations in the random number sequence.
The ri are taken to be in the range 0 to 1.
ResourceFunction["NoiseSphere"] takes the same options as Graphics3D.

Examples

Basic Examples (1) 

Noise sphere for the default generator used by RandomReal:

In[1]:=
ResourceFunction["NoiseSphere"][
 BlockRandom[SeedRandom[42]; RandomReal[1, 1*^4]]]
Out[1]=

Scope (4) 

Noise sphere of the IBM RANDU generator; the structured appearance suggests unwanted correlations:

In[2]:=
ResourceFunction["NoiseSphere"][
 BlockRandom[
  SeedRandom[1, Method -> {"Congruential", "Multiplier" -> 65539, "Increment" -> 0,
      "Modulus" -> 2^31}]; RandomReal[1, 1*^4]]]
Out[2]=

Noise sphere of a linear congruential generator from L'Ecuyer:

In[3]:=
ResourceFunction["NoiseSphere"][
 BlockRandom[
  SeedRandom[1, Method -> {"Congruential", "Multiplier" -> 85876534675, "Increment" -> 0, "Modulus" -> 137438953447}]; RandomReal[1, 1*^4]]]
Out[3]=

Noise sphere of the legacy pseudorandom number generator used by the Wolfram Language:

In[4]:=
ResourceFunction["NoiseSphere"][
 BlockRandom[SeedRandom[42, Method -> "Legacy"]; RandomReal[1, 1*^4]]]
Out[4]=

The following shows an example of a poor pseudorandom sequence:

In[5]:=
ResourceFunction["NoiseSphere"][
 Table[FractionalPart[Sqrt[2 n] // N], {n, 1, 500}]]
Out[5]=

Version History

  • 1.0.0 – 08 June 2021

Source Metadata

Related Resources

License Information