Function Repository Resource:

Compute the radical inverse of an integer to a given base

Contributed by: Jan Mangaldan

## Details

The radical inverse is also known as the van der Corput sequence.
Integer mathematical function, suitable for both symbolic and numerical manipulation.
The base-b radical inverse of n is defined as , where is the base-b expansion of n, and m is IntegerLength[n,b].
The radical inverse is usually used for computing Halton and Hammersley low-discrepancy sequences for quasi-Monte Carlo methods.

## Examples

### Basic Examples (3)

The base-10 radical inverse of 42:

 In[1]:=
 Out[1]=

The base-2 radical inverse of 42:

 In[2]:=
 Out[2]=

 In[3]:=
 Out[3]=

### Scope (2)

Evaluate for large arguments:

 In[4]:=
 Out[4]=

 In[5]:=
 Out[5]=

### Applications (4)

Demonstrate the filling of the unit interval with the decimal radical inverse, also known as the van der Corput sequence:

 In[6]:=
 Out[6]=

Generate a 2D Halton sequence with bases 2 and 3:

 In[7]:=
 Out[7]=

Generate a 2D binary Hammersley sequence:

 In[8]:=
 Out[8]=

Compare the Halton and Hammersley sequences for approximating π by quasi-Monte Carlo integration:

 In[9]:=
 Out[9]=
 In[10]:=
 Out[10]=