The Compadre Portal website will be unavailable Friday evening through Saturday afternoon as electrical work occurs in the American Center of Physics server room. Down time will begin at 6PM Eastern Time on Friday. Service is expected to resume by 6PM on Saturday, July 30.

Linear Congruent Random Number Generator Model Documents

This material has 2 associated documents. Select a document title to view a document's information.

Main Document

Linear Congruent Number Generator 

written by Wolfgang Christian

The Linear Congruent Random Number Generator Model generates a sequence of integers x[i] over the interval [0, m-1] by the recurrence relation

x[i+1] = (a*x[i]+c) mod m

where the modulus m is greater than zero, the multiplier a is greater than zero and less than m, and the increment c is greater than zero and less than m. All numbers are integers and all arithmetic is integer arithmetic. The initial value x[0] is known as the seed.

The Linear Congruent Number Generator Model was created using the Easy Java Simulations (EJS) modeling tool.  It is distributed as a ready-to-run (compiled) Java archive.  Double clicking the ejs_math_RandomLCG.jar file will run the program if Java is installed.

Published December 16, 2008
Last Modified June 10, 2014

This file has previous versions.

Source Code Documents

Linear Congruent Number Generator source code. 

The source code zip archive contains an XML representation of the EJS Linear Congruent Number Generator Model.   Unzip this archive in your Ejs workspace to compile and run this model using Ejs.

Last Modified June 17, 2010

This file has previous versions.