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:

    We are in a period when old questions are settled and the new are not yet brought forward. Extreme party action, if continued in such a time, would ruin the party. Moderation is its only chance. The party out of power gains by all partisan conduct of those in power.
    Rutherford Birchard Hayes (1822–1893)

    And my spirit is grown to a lordly great compass within,
    That the length and the breadth and the sweep of the marshes of
    Glynn
    Will work me no fear like the fear they have wrought me of yore
    When length was failure, and when breadth was but bitterness sore,
    And when terror and shrinking and dreary unnamable pain
    Drew over me out of the merciless miles of the plain,—
    Oh, now, unafraid, I am fain to face
    The vast sweet visage of space.
    Sidney Lanier (1842–1881)