Inversive congruential generator explained

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:

x0=seed,

xi+1=\begin{cases}

-1
(ax
i

+c)\bmodq&ifxi\ne0,\\ c&ifxi=0. \end{cases}

Such a generator is denoted symbolically as and is said to be an ICG with parameters q, a, c and seed seed.

Period

The sequence

(xn)n\geq

must have

xi=xj

after finitely many steps, and since the next element depends only on its direct predecessor, also

xi+1=xj+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.

f(x)=x2-cx-a\inFq[x]

(polynomial ring over

Fq

) is primitive. This is not a necessary condition; there are choices of q, a and c for which

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, 4, 2, 1, 0, ...

In this example,

f(x)=x2-3x-2

is irreducible in

F5[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

F5[x]/(f)

and hence f is primitive.

Compound inversive generator

The construction of a compound inversive generator (CIG) relies on combining two or more inversive congruential generators according to the method described below.

Let

p1,...,pr

be distinct prime integers, each

pj\geq5

. For each index j, 1jr, let

(xn)n\geq

be a sequence of elements of
F
pj
periodic with period length

pj

. In other words,
(j)
\{x
n

\mid0\leqn\leqpj\}\in

F
pj
.

For each index j, 1 ≤ j ≤ r, we consider

Tj=T/pj

, where

T=p1pr

is the period length of the following sequence

(xn)n\geq

.

The sequence

(xn)n\geq

of compound pseudorandom numbers is defined as the sum

xn=\left(T1

(1)
x
n

+T2

(2)
x
n

+...+Tr

(r)
x
n

\right)\bmodT

.The compound approach allows combining inversive congruential generators, provided they have full period, in parallel generation systems.

Advantages of CIG

The CIG are accepted for practical purposes for a number of reasons.

Firstly, binary sequences produced in this way are free of undesirable statistical deviations. Inversive sequences extensively tested with variety of statistical tests remain stable under the variation of parameter.

Secondly, there exists a steady and simple way of parameter choice, based on the Chou algorithm that guarantees maximum period length.

Thirdly, compound approach has the same properties as single inversive generators, but it also provides period length significantly greater than obtained by a single inversive congruential generator. They seem to be designed for application with multiprocessor parallel hardware platforms.

There exists an algorithm that allows designing compound generators with predictable period length, predictable linear complexity level, with excellent statistical properties of produced bit streams.

The procedure of designing this complex structure starts with defining finite field of p elements and ends with choosing the parameters a and c for each inversive congruential generator being the component of the compound generator. It means that each generator is associated to a fixed IMP polynomial. Such a condition is sufficient for maximum period of each inversive congruential generator and finally for maximum period of the compound generator. The construction of IMP polynomials is the most efficient approach to find parameters for inversive congruential generator with maximum period length.

Discrepancy and its boundaries

Equidistribution and statistical independence properties of the generated sequences, which are very important for their usability in a stochastic simulation, can be analyzed based on the discrepancy of s-tuples of successive pseudorandom numbers with

s=1

and

s=2

respectively.

The discrepancy computes the distance of a generator from a uniform one. A low discrepancy means that the sequence generated can be used for cryptographic purposes, and the first aim of the inversive congruential generator is to provide pseudorandom numbers.

Definition

For arbitrary points

{t}1,...,{t}N-1\in[0,1)

the discrepancy is defined by

DN({t}1,...,{t}N-1)={\rmsup}J|FN(J)-V(J)|

,where the supremum is extended over all subintervals of

[0,1)s

,

FN(J)

is

N-1

times the number of points among

{t}1,...,{t}N-1

falling into and denotes the -dimensional volume of .

Until now, we had sequences of integers from 0 to, in order to have sequences of

[0,1)s

, one can divide a sequences of integers by its period .

From this definition, we can say that if the sequence

{t}1,...,{t}N-1

is perfectly random then its well distributed on the interval

J=[0,1)s

then

V(J)=1

and all points are in so

FN(J)=N/N=1

hence

DN({t}1,...,{t}N-1)=0

but instead if the sequence is concentrated close to one point then the subinterval is very small

V(j)0

and

FN(j)N/N1

so

DN({t}1,...,{t}N-1)=1

Then we have from the better and worst case:

0\leqDN({t}1,...,{t}N-1)\leq1

.

Notations

Some further notation is necessary. For integers

k\geq1

and

q\geq2

let

Ck(q)

be the set of nonzero lattice points

(h1,...,hk)\inZk

with

-q/2<hj<q/2

for

1\leqj\leqk

.

Define

r(h,q)=\begin{cases} q\sin(\pi|h|/q)&forh\inC1(q)\\ 1&forh=0 \end{cases}

and

r

k
(h,q)=\prod
j=1

r(hj,q)

for

{h}=(h1,...,hk)\inCk(q)

. For real

t

the abbreviation

e(t)={\rmexp}(2\piit)

is used, and

uv

stands for the standard inner product of

u,v

in

Rk

.

Higher bound

Let

N\geq1

and

q\geq2

be integers. Let

{t}n=yn/q\in[0,1)k

with

yn\in\{0,1,...,q-1\}k

for

0\leqn<N

.

Then the discrepancy of the points

{t}0,...,{t}N-1

satisfies

DN(t0,t1,...,tN-1)

kq
+
1N
\sum
h\in\Complexk(q)
1{r(h,q)}
|
N-1
\sum
n=0

e(htn)|

Lower bound

The discrepancy of

N

arbitrary points

t1,...,tN-1\in[0,1)k

satisfies

DN(t0,t1,...,tN-1)\ge

\pi
l
2N((\pi+1)
k
-1)\prod
j=1
{\rmmax

(1,hj)}|\sum

N-1
n=0

e(htn)|

for any nonzero lattice point

{h}=(h1,...,hk)\inZk

, where

l

denotes the number of nonzero coordinates of

{h}

.

These two theorems show that the CIG is not perfect because the discrepancy is greater strictly than a positive value but also the CIG is not the worst generator as the discrepancy is lower than a value less than 1.

There exist also theorems which bound the average value of the discrepancy for Compound Inversive Generators and also ones which take values such that the discrepancy is bounded by some value depending on the parameters. For more details see the original paper.

See also

External links