The Open Source Physics 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.

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.

Please note that this resource requires
at least version 1.5 of
Java.

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. download 121kb .zip
Last Modified: June 17, 2010
previous versions

W. Christian, Computer Program LINEAR CONGRUENT RANDOM NUMBER GENERATOR MODEL, Version 1.0 (2008), WWW Document, (http://www.compadre.org/Repository/document/ServeFile.cfm?ID=8892&DocID=1194).

W. Christian, Computer Program LINEAR CONGRUENT RANDOM NUMBER GENERATOR MODEL, Version 1.0 (2008), <http://www.compadre.org/Repository/document/ServeFile.cfm?ID=8892&DocID=1194>.

Christian, W. (2008). Linear Congruent Random Number Generator Model (Version 1.0) [Computer software]. Retrieved July 29, 2016, from http://www.compadre.org/Repository/document/ServeFile.cfm?ID=8892&DocID=1194

Christian, Wolfgang. "Linear Congruent Random Number Generator Model." Version 1.0. http://www.compadre.org/Repository/document/ServeFile.cfm?ID=8892&DocID=1194 (accessed 29 July 2016).

Christian, Wolfgang. Linear Congruent Random Number Generator Model. Vers. 1.0. Computer software. 2008. Java 1.5. 29 July 2016 <http://www.compadre.org/Repository/document/ServeFile.cfm?ID=8892&DocID=1194>.

%A Wolfgang Christian %T Linear Congruent Random Number Generator Model %D December 16, 2008 %U http://www.compadre.org/Repository/document/ServeFile.cfm?ID=8892&DocID=1194 %O 1.0 %O application/java

%0 Computer Program %A Christian, Wolfgang %D December 16, 2008 %T Linear Congruent Random Number Generator Model %7 1.0 %8 December 16, 2008 %U http://www.compadre.org/Repository/document/ServeFile.cfm?ID=8892&DocID=1194

Disclaimer: ComPADRE offers citation styles as a guide only. We cannot offer interpretations about citations as this is an automated procedure. Please refer to the style manuals in the Citation Source Information area for clarifications.