Function Repository Resource:

# RandomDotOrgReal

Generate a random real number using the random.org service

Contributed by: Jan Mangaldan
 ResourceFunction["RandomDotOrgReal"][] gives a random real number in the range 0 to 1 using the random.org service. ResourceFunction["RandomDotOrgReal"][{xmin,xmax}] gives a random real number in the range xmin to xmax. ResourceFunction["RandomDotOrgReal"][xmax] gives a random real number in the range 0 to xmax. ResourceFunction["RandomDotOrgReal"][range,n] gives a list of n random reals. ResourceFunction["RandomDotOrgReal"][range,{n1,n2,…}] gives an n1×n2×… array of random reals.

## Details and Options

random.org is a true random number service that generates randomness via atmospheric noise, which for many purposes is better than the pseudorandom number algorithms typically used in computer programs.
ResourceFunction["RandomDotOrgReal"] gives a different sequence of random reals whenever it is evaluated.
It is more efficient to generate multiple random numbers in a single call (e.g. ResourceFunction["RandomDotOrgReal"][range,n]) instead of generating them one at a time (e.g. Table[ResourceFunction["RandomDotOrgReal"][range],{n}]).

## Examples

### Basic Examples (6)

A random real number in the range 0 to 1:

 In[1]:=
 Out[1]=

A random real number in the range -10 to 10:

 In[2]:=
 Out[2]=

A random real number in the range 0 to 10:

 In[3]:=
 Out[3]=

Five random reals in the range 0 to 1:

 In[4]:=
 Out[4]=

A 3×2 array of random reals in the range -1 to 1:

 In[5]:=
 Out[5]=

Random coordinates for 4 points in 3 dimensions:

 In[6]:=
 Out[6]=

### Applications (5)

A random walk:

 In[7]:=
 Out[7]=

Circles at random positions:

 In[8]:=
 Out[8]=

Random array of gray levels:

 In[9]:=
 Out[9]=

Spheres at random positions:

 In[10]:=
 Out[10]=

Two-dimensional random walk:

 In[11]:=
 Out[11]=

Three-dimensional random walk:

 In[12]:=
 Out[12]=

## Version History

• 1.0.0 – 09 January 2023

## Author Notes

The implementation is adapted from https://tpfto.wordpress.com/2012/05/15/using-the-random-org-generator-in-mathematica/