Lagged Fibonacci generator

This may be either addition, subtraction, multiplication, or the bitwise exclusive-or operator (XOR).

Generators of this type employ k words of state (they 'remember' the last k values).

If the operation used is addition, then the generator is described as an Additive Lagged Fibonacci Generator or ALFG, if multiplication is used, it is a Multiplicative Lagged Fibonacci Generator or MLFG, and if the XOR operation is used, it is called a Two-tap generalised feedback shift register or GFSR.

The maximum period of lagged Fibonacci generators depends on the binary operation

For the generator to achieve this maximum period, the polynomial: must be primitive over the integers mod 2.

If addition is used, it is required that at least one of the first k values chosen to initialise the generator be odd.

[4] In a paper on four-tap shift registers, Robert M. Ziff, referring to LFGs that use the XOR operator, states that "It is now widely known that such generators, in particular with the two-tap rules such as R(103, 250), have serious deficiencies.

The basic problem of two-tap generators R(a, b) is that they have a built-in three-point correlation between

A three-tap LFG has been shown to eliminate some statistical problems such as failing the Birthday Spacings and Generalized Triple tests.

[4] Wikipedia page 'List of random number generators' lists other PRNGs including some with better statistical qualitites: