Linear congruential generator

Pseudorandom number generator

Nº Q1190228 ★

Common · Knowledge

Linear congruential generator

Pseudorandom number generator

A linear congruential generator (LCG) is an algorithm that yields a sequence of pseudo-randomized numbers calculated with a discontinuous piecewise linear equation. The method represents one of the oldest and best-known pseudorandom number generator algorithms.

Last price

—

Floor price

—

7-day median

—

30-day sales

0

30-day range

—

In circulation

0

Price history

Show table
Datemedian LowHighsales

Sales history

Last sale
—
30-day average
—
30-day low
—
30-day high
—
Sales 7d
0
Sales 30d
0

No sales yet.

Anonymous sales: no buyer or seller shown. Figures count player-to-player sales only.

From Wikipedia

A linear congruential generator (LCG) is an algorithm that yields a sequence of pseudo-randomized numbers calculated with a discontinuous piecewise linear equation. The method represents one of the oldest and best-known pseudorandom number generator algorithms. The theory behind them is relatively easy to understand, and they are easily implemented and fast, especially on computer hardware which can provide modular arithmetic by storage-bit truncation. The generator is defined by the recurrence relation: X n + 1 = ( a X n + c ) mod m {\displaystyle X_{n+1}=\left(aX_{n}+c\right){\bmod {m}}} where X {\displaystyle X} is the sequence of pseudo-random values, and m , 0 < m {\displaystyle m,\,0<m} — the "modulus" a , 0 < a < m {\displaystyle a,\,0<a<m} — the "multiplier" c , 0 ≤ c < m {\displaystyle c,\,0\leq c<m} — the "increment" X 0 , 0 ≤ X 0 < m {\displaystyle X_{0},\,0\leq X_{0}<m} — the "seed" or "start value" are integer constants that specify the generator. If c = 0, the generator is often called a multiplicative congruential generator (MCG), or Lehmer RNG. If c ≠ 0, the method is called a mixed congruential generator. When c ≠ 0, a mathematician would call the recurrence an affine transformation, not a linear one, but the misnomer is well-established in computer science.

Text: Wikipédia, CC BY-SA 4.0. · Image: Cmglee (CC BY-SA 3.0) ·

Related cards

Confirmation