|Learning by Simulations has been developed by Hans Lohninger to support both teachers and students in the process of knowledge transfer and acquisition . Click here for more information.|
|Home Mathematics Linear Congruential Generator|
Share this Page:
Computer languages usually offer a command to create random numbers. The generation of random numbers, however, is not an easy task for a computer, since the computer is a deterministic machine with no built-in randomness. Thus it is impossible to create true random numbers without any additional hardware.
What can be done, is to create pseudo random numbers which behave almost like random numbers but which are repeated after a fixed (mostly quite long) period. These pseudo random numbers are generated by linear congruential generators (LCG). The principle of an LCG is quite simple: a new pseudo random number is generated on the basis of the previous random number by adding a certain offset and wrapping the result if it exceeds a certain limit.