Linear Congruential Generator - Period Length

Period Length

The period of a general LCG is at most m, and for some choices of a much less than that. Provided that c is nonzero, the LCG will have a full period for all seed values if and only if:

  1. and are relatively prime,
  2. is divisible by all prime factors of ,
  3. is a multiple of 4 if is a multiple of 4.

These three requirements are referred to as the Hull-Dobell Theorem. While LCGs are capable of producing decent pseudorandom numbers, this is extremely sensitive to the choice of the parameters c, m, and a.

Historically, poor choices had led to ineffective implementations of LCGs. A particularly illustrative example of this is RANDU which was widely used in the early 1970s and led to many results which are currently being questioned because of the use of this poor LCG.

Read more about this topic:  Linear Congruential Generator

Famous quotes containing the words period and/or length:

    When we suffer anguish we return to early childhood because that is the period in which we first learnt to suffer the experience of total loss. It was more than that. It was the period in which we suffered more total losses than in all the rest of our life put together.
    John Berger (b. 1926)

    At length he would call to let us know where he was waiting for us with his canoe, when, on account of the windings of the stream, we did not know where the shore was, but he did not call often enough, forgetting that we were not Indians.... This was not because he was unaccommodating, but a proof of superior manners. Indians like to get along with the least possible communication and ado. He was really paying us a great compliment all the while, thinking that we preferred a hint to a kick.
    Henry David Thoreau (1817–1862)