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:

    There is not any present moment that is unconnected with some future one. The life of every man is a continued chain of incidents, each link of which hangs upon the former. The transition from cause to effect, from event to event, is often carried on by secret steps, which our foresight cannot divine, and our sagacity is unable to trace. Evil may at some future period bring forth good; and good may bring forth evil, both equally unexpected.
    Joseph Addison (1672–1719)

    They raise their minds by brooding over and embellishing their sufferings, from one degree of fervid exaltation and dreary greatness to another, till at length they run amuck entirely, and whoever meets them would do well to run them thro’ the body.
    Thomas Carlyle (1795–1881)