Inversive congruential generators are a type of nonlinear congruential pseudorandom number generator, which use the modular multiplicative inverse (if it exists) to generate the next number in a sequence. The standard formula for an inversive congruential generator, modulo some prime q is:
x 0 = seed , {\displaystyle x_{0}={\text{seed}},}
x i + 1 = { ( a x i − 1 + c ) mod q if x i ≠ 0 , c if x i = 0. {\displaystyle x_{i+1}={\begin{cases}(ax_{i}^{-1}+c){\bmod {q}}&{\text{if }}x_{i}\neq 0,\\c&{\text{if }}x_{i}=0.\end{cases}}}
Such a generator is denoted symbolically as ICG(q, a, c, seed) and is said to be an ICG with parameters q, a, c and seed seed.
Period The sequence ( x n ) n ≥ 0 {\displaystyle (x_{n})_{n\geq 0}} must have x i = x j {\displaystyle x_{i}=x_{j}} after finitely many steps, and since the next element depends only on its direct predecessor, also x i + 1 = x j + 1 {\displaystyle x_{i+1}=x_{j+1}} etc. The maximum possible period for the modulus q is q itself, i.e. the sequence includes every value from 0 to q − 1 before repeating. A sufficient condition for the sequence to have the maximum possible period is to choose a and c such that the polynomial f ( x ) = x 2 − c x − a ∈ F q [ x ] {\displaystyle f(x)=x^{2}-cx-a\in \mathbb {F} _{q}[x]} (polynomial ring over F q {\displaystyle \mathbb {F} _{q}} ) is primitive. This is not a necessary condition; there are choices of q, a and c for which f ( x ) {\displaystyle f(x)} is not primitive, but the sequence nevertheless has a period of q. Any polynomial, primitive or not, that leads to a maximal-period sequence is called an inversive maximal-period (IMP) polynomial. Chou describes an algorithm for choosing the parameters a and c to get such polynomials. Eichenauer-Herrmann, Lehn, Grothe and Niederreiter have shown that inversive congruential generators have good uniformity properties, in particular with regard to lattice structure and serial correlations.
Example ICG(5, 2, 3, 1) gives the sequence 1, 0, 3, 2, 4, 1, 0, 3, 2, 4, 1, 0, ... In this example, f ( x ) = x 2 − 3 x − 2 {\displaystyle f(x)=x^{2}-3x-2} is irreducible in F 5 [ x ] {\displaystyle \mathbb {F} _{5}[x]} , as none of 0, 1, 2, 3 or 4 is a root. It can also be verified that x is a primitive element of F 5 [ x ] / ( f ) {\displaystyle \mathbb {F} _{5}[x]/(f)} and hence f is primitive.
… excerpt ends here. Continue reading the full article.


