What is the Modulus in Linear Congruential Generators?

  • Thread starter Thread starter elgitano77
  • Start date Start date
  • Tags Tags
    Generator Linear
Click For Summary
The discussion focuses on understanding the modulus in Linear Congruential Generators (LCGs) and how to calculate it using the equation Xn+1 = a*Xn + c (mod m). The concept of "mod m" refers to finding the remainder when a*Xn + c is divided by m. Most programming languages include a "mod" function, which efficiently computes this operation. LCGs are noted as an early form of pseudo-random number generators, with historical references dating back to the 1950s. The typical implementation involves using integer arithmetic where m is a power of 2, ensuring efficient calculations.
elgitano77
Messages
1
Reaction score
0
I am trying to understand LCG and although the equation looks really straightforward I don't know how to calculate the module of the expression.

Xn+1= a*Xn+c (mod m)

As stated before, my problem is understanding the concept of mod m and how to calculate it.

Any help and example would be appreciated.
 
Physics news on Phys.org
a*Xn+c Modulo m gives the remainder of a*Xn+c when divided by m.
See http://en.wikipedia.org/wiki/Modulo_operation

Most computer programming languages have a "mod" function. In machine language the integer divide will provide the quotient in one register, and the remainder in another - this makes this very fast. This is a very old pseudo-random number generator which was already in use in the 1950's - I used to have an IBM publication copyright 1953 or so which provided all of the details.

http://en.wikipedia.org/wiki/Linear_congruential_generator
 
Typical random number generators will use integer arithmetic, where m is 2k, where k = 1+largest single precision integer. a*Xn+c will produce an integer covering a double precision register. Keep the lower half.

The above method then is followed by division (after floating) by the float of k.
 
The standard _A " operator" maps a Null Hypothesis Ho into a decision set { Do not reject:=1 and reject :=0}. In this sense ( HA)_A , makes no sense. Since H0, HA aren't exhaustive, can we find an alternative operator, _A' , so that ( H_A)_A' makes sense? Isn't Pearson Neyman related to this? Hope I'm making sense. Edit: I was motivated by a superficial similarity of the idea with double transposition of matrices M, with ## (M^{T})^{T}=M##, and just wanted to see if it made sense to talk...

Similar threads

Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 23 ·
Replies
23
Views
4K
Replies
12
Views
9K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 28 ·
Replies
28
Views
6K
Replies
5
Views
2K
Replies
7
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K