[{"@context":"http:\/\/schema.org\/","@type":"BlogPosting","@id":"https:\/\/wiki.edu.vn\/en\/wiki24\/linear-congruential-generator-wikipedia\/#BlogPosting","mainEntityOfPage":"https:\/\/wiki.edu.vn\/en\/wiki24\/linear-congruential-generator-wikipedia\/","headline":"Linear congruential generator – Wikipedia","name":"Linear congruential generator – Wikipedia","description":"before-content-x4 Algorithm for generating pseudo-randomized numbers Two modulo-9 LCGs show how different parameters lead to different cycle lengths. Each row","datePublished":"2022-08-22","dateModified":"2022-08-22","author":{"@type":"Person","@id":"https:\/\/wiki.edu.vn\/en\/wiki24\/author\/lordneo\/#Person","name":"lordneo","url":"https:\/\/wiki.edu.vn\/en\/wiki24\/author\/lordneo\/","image":{"@type":"ImageObject","@id":"https:\/\/secure.gravatar.com\/avatar\/c9645c498c9701c88b89b8537773dd7c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c9645c498c9701c88b89b8537773dd7c?s=96&d=mm&r=g","height":96,"width":96}},"publisher":{"@type":"Organization","name":"Enzyklop\u00e4die","logo":{"@type":"ImageObject","@id":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","url":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","width":600,"height":60}},"image":{"@type":"ImageObject","@id":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/0\/02\/Linear_congruential_generator_visualisation.svg\/480px-Linear_congruential_generator_visualisation.svg.png","url":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/0\/02\/Linear_congruential_generator_visualisation.svg\/480px-Linear_congruential_generator_visualisation.svg.png","height":"160","width":"480"},"url":"https:\/\/wiki.edu.vn\/en\/wiki24\/linear-congruential-generator-wikipedia\/","wordCount":13933,"articleBody":" (adsbygoogle = window.adsbygoogle || []).push({});before-content-x4Algorithm for generating pseudo-randomized numbers Two modulo-9 LCGs show how different parameters lead to different cycle lengths. Each row shows the state evolving until it repeats. The top row shows a generator with m\u00a0=\u00a09, a\u00a0=\u00a02, c\u00a0=\u00a00, and a seed of 1, which produces a cycle of length 6. The second row is the same generator with a seed of 3, which produces a cycle of length 2. Using a\u00a0=\u00a04 and c\u00a0=\u00a01 (bottom row) gives a cycle length of 9 with any seed in [0,\u00a08]. (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4A 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: (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4Xn+1=(aXn+c)modm{displaystyle X_{n+1}=left(aX_{n}+cright){bmod {m}}}where X{displaystyle X} is the sequence of pseudo-random values, and (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4m,0X01{displaystyle a-1} is divisible by 4 if m{displaystyle m} is divisible by 4.These three requirements are referred to as the Hull\u2013Dobell Theorem.[14][15]This form may be used with any m, but only works well for m with many repeated prime factors, such as a power of 2; using a computer’s word size is the most common choice. If m were a square-free integer, this would only allow a\u00a0\u2261\u00a01 (mod\u00a0m), which makes a very poor PRNG; a selection of possible full-period multipliers is only available when m has repeated prime factors.Although the Hull\u2013Dobell theorem provides maximum period, it is not sufficient to guarantee a good generator. For example, it is desirable for a\u00a0\u2212\u00a01 to not be any more divisible by prime factors of m than necessary. Thus, if m is a power of 2, then a\u00a0\u2212\u00a01 should be divisible by 4 but not divisible by 8, i.e.\u00a0a\u00a0\u2261\u00a05\u00a0(mod\u00a08).[1]:\u200a\u00a73.2.1.3\u200aIndeed, most multipliers produce a sequence which fails one test for non-randomness or another, and finding a multiplier which is satisfactory to all applicable criteria[1]:\u200a\u00a73.3.3\u200a is quite challenging. The spectral test is one of the most important tests.[16]Note that a power-of-2 modulus shares the problem as described above for c\u00a0=\u00a00: the low k bits form a generator with modulus 2k and thus repeat with a period of 2k; only the most significant bit achieves the full period. If a pseudorandom number less than r is desired, \u230arX\/m\u230b is a much higher-quality result than X mod r. Unfortunately, most programming languages make the latter much easier to write (X\u00a0% r), so it is the more commonly used form.The generator is not sensitive to the choice of c, as long as it is relatively prime to the modulus (e.g. if m is a power of 2, then c must be odd), so the value c=1 is commonly chosen.The series produced by other choices of c can be written as a simple function of the series when c=1.[1]:\u200a11\u200a Specifically, if Y is the prototypical series defined by Y0 =\u00a00 and Yn+1 =\u00a0aYn+1 mod\u00a0m, then a general series Xn+1 =\u00a0aXn+c mod\u00a0m can be written as an affine function of Y:Xn=(X0(a\u22121)+c)Yn+X0=(X1\u2212X0)Yn+X0(modm).{displaystyle X_{n}=(X_{0}(a-1)+c)Y_{n}+X_{0}=(X_{1}-X_{0})Y_{n}+X_{0}{pmod {m}}.}More generally, any two series X and Z with the same multiplier and modulus are related byXn\u2212X0X1\u2212X0=Yn=an\u22121a\u22121=Zn\u2212Z0Z1\u2212Z0(modm).{displaystyle {X_{n}-X_{0} over X_{1}-X_{0}}=Y_{n}={a^{n}-1 over a-1}={Z_{n}-Z_{0} over Z_{1}-Z_{0}}{pmod {m}}.}Parameters in common use[edit]The following table lists the parameters of LCGs in common use, including built-in rand() functions in runtime libraries of various compilers. This table is to show popularity, not examples to emulate; many of these parameters are poor. Tables of good parameters are available.[10][2]Sourcemodulusmmultiplieraincrementcoutput bits of seed in rand() or Random(L)ZX81216 + 17574Numerical Recipes from the “quick and dirty generators” list, Chapter 7.1, Eq. 7.1.6 parameters from Knuth and H. W. Lewis23216645251013904223Borland C\/C++232226954771bits 30..16 in rand(), 30..0 in lrand()glibc (used by GCC)[17]231110351524512345bits 30..0ANSI C: Watcom, Digital Mars, CodeWarrior, IBM VisualAge C\/C++[18]C90, C99, C11: Suggestion in the ISO\/IEC 9899,[19]C17231110351524512345bits 30..16Borland Delphi, Virtual Pascal2321347758131bits 63..32 of (seed \u00d7 L)Turbo Pascal232134775813 (808840516)1Microsoft Visual\/Quick C\/C++232214013 (343FD16)2531011 (269EC316)bits 30..16Microsoft Visual Basic (6 and earlier)[20]2241140671485 (43FD43FD16)12820163 (C39EC316)RtlUniform from Native API[21]231 \u2212 12147483629 (7FFFFFED16)2147483587 (7FFFFFC316)Apple CarbonLib, C++11’s minstd_rand0,[22] MATLAB’s v4 legacy generator mcg16807[23]231 \u2212 1168070see MINSTDC++11’s minstd_rand[22]231 \u2212 1482710see MINSTDMMIX by Donald Knuth26463641362238467930051442695040888963407Newlib26463641362238467930051bits 62..32 (46..32 for 16-bit int)Musl26463641362238467930051bits 63..33VMS’s MTH$RANDOM,[24] old versions of glibc23269069 (10DCD16)1Java’s java.util.Random, POSIX [ln]rand48, glibc [ln]rand48[_r]24825214903917 (5DEECE66D16)11bits 47..16random0[25][26][27][28][29]134456 = 2375812128411Xn134456{displaystyle {frac {X_{n}}{134456}}}POSIX[30] [jm]rand48, glibc [mj]rand48[_r]24825214903917 (5DEECE66D16)11bits 47..15POSIX [de]rand48, glibc [de]rand48[_r]24825214903917 (5DEECE66D16)11bits 47..0cc65[31]22365793 (1010116)4282663 (41592716)bits 22..8cc6523216843009 (101010116)826366247 (3141592716)bits 31..16cc6523216843009 (101010116)3014898611 (B3B3B3B316)previously bits 31..16, current bits 31..16 xor bits 14..0Formerly common: RANDU[11]231655390As shown above, LCGs do not always use all of the bits in the values they produce. For example, the Java implementation operates with 48-bit values at each iteration but returns only their 32 most significant bits. This is because the higher-order bits have longer periods than the lower-order bits (see below). LCGs that use this truncation technique produce statistically better values than those that do not. This is especially noticeable in scripts that use the mod operation to reduce range; modifying the random number mod 2 will lead to alternating 0 and 1 without truncation.Advantages and disadvantages[edit]LCGs are fast and require minimal memory (one modulo-m number, often 32 or 64 bits) to retain state. This makes them valuable for simulating multiple independent streams. LCGs are not intended, and must not be used, for cryptographic applications; use a cryptographically secure pseudorandom number generator for such applications. Although LCGs have a few specific weaknesses, many of their flaws come from having too small a state. The fact that people have been lulled for so many years into using them with such small moduli can be seen as a testament to the strength of the technique. A LCG with large enough state can pass even stringent statistical tests; a modulo-2 LCG which returns the high 32 bits passes TestU01’s SmallCrush suite,[citation needed] and a 96-bit LCG passes the most stringent BigCrush suite.[32]For a specific example, an ideal random number generator with 32 bits of output is expected (by the Birthday theorem) to begin duplicating earlier outputs after \u221am \u2248 216 results. Any PRNG whose output is its full, untruncated state will not produce duplicates until its full period elapses, an easily detectable statistical flaw. For related reasons, any PRNG should have a period longer than the square of the number of outputs required. Given modern computer speeds, this means a period of 264 for all but the least demanding applications, and longer for demanding simulations.One flaw specific to LCGs is that, if used to choose points in an n-dimensional space, the points will lie on, at most, n\u221an!\u22c5m hyperplanes (Marsaglia’s theorem, developed by George Marsaglia).[7] This is due to serial correlation between successive values of the sequence Xn. Carelessly chosen multipliers will usually have far fewer, widely spaced planes, which can lead to problems. The spectral test, which is a simple test of an LCG’s quality, measures this spacing and allows a good multiplier to be chosen.The plane spacing depends both on the modulus and the multiplier. A large enough modulus can reduce this distance below the resolution of double precision numbers. The choice of the multiplier becomes less important when the modulus is large. It is still necessary to calculate the spectral index and make sure that the multiplier is not a bad one, but purely probabilistically it becomes extremely unlikely to encounter a bad multiplier when the modulus is larger than about 264.Another flaw specific to LCGs is the short period of the low-order bits when m is chosen to be a power of 2. This can be mitigated by using a modulus larger than the required output, and using the most significant bits of the state.Nevertheless, for some applications LCGs may be a good option. For instance, in an embedded system, the amount of memory available is often severely limited. Similarly, in an environment such as a video game console taking a small number of high-order bits of an LCG may well suffice. (The low-order bits of LCGs when m is a power of 2 should never be relied on for any degree of randomness whatsoever.) The low order bits go through very short cycles. In particular, any full-cycle LCG, when m is a power of 2, will produce alternately odd and even results.LCGs should be evaluated very carefully for suitability in non-cryptographic applications where high-quality randomness is critical. For Monte Carlo simulations, an LCG must use a modulus greater and preferably much greater than the cube of the number of random samples which are required. This means, for example, that a (good) 32-bit LCG can be used to obtain about a thousand random numbers; a 64-bit LCG is good for about 221 random samples (a little over two million), etc. For this reason, in practice LCGs are not suitable for large-scale Monte Carlo simulations.Sample code[edit]Python code[edit]The following is an implementation of an LCG in Python, in the form of a generator:from collections.abc import Generatordef lcg(modulus: int, a: int, c: int, seed: int) -> Generator[int, None, None]: \"\"\"Linear congruential generator.\"\"\" while True: seed = (a * seed + c) % modulus yield seedFree Pascal[edit]Free Pascal uses a Mersenne Twister as its default pseudo random number generator whereas Delphi uses a LCG. Here is a Delphi compatible example in Free Pascal based on the information in the table above. Given the same RandSeed value it generates the same sequence of random numbers as Delphi.unit lcg_random;{$ifdef fpc}{$mode delphi}{$endif}interfacefunction LCGRandom: extended; overload; inline;function LCGRandom(const range:longint): longint; overload; inline;implementationfunction IM: cardinal; inline;begin RandSeed := RandSeed * 134775813 + 1; Result := RandSeed;end;function LCGRandom: extended; overload; inline;begin Result := IM * 2.32830643653870e-10;end;function LCGRandom(const range: longint): longint; overload; inline;begin Result := IM * range shr 32;end;Like all pseudorandom number generators, a LCG needs to store state and alter it each time it generates a new number. Multiple threads may access this state simultaneously causing a race condition. Implementations should use different state each with unique initialization for different threads to avoid equal sequences of random numbers on simultaneously executing threads.LCG derivatives[edit]There are several generators which are linear congruential generators in a different form, and thus the techniques used to analyze LCGs can be applied to them.One method of producing a longer period is to sum the outputs of several LCGs of different periods having a large least common multiple; the Wichmann\u2013Hill generator is an example of this form. (We would prefer them to be completely coprime, but a prime modulus implies an even period, so there must be a common factor of 2, at least.) This can be shown to be equivalent to a single LCG with a modulus equal to the product of the component LCG moduli.Marsaglia’s add-with-carry and subtract-with-borrow PRNGs with a word size of b=2w and lags r and s (r\u00a0>\u00a0s) are equivalent to LCGs with a modulus of br\u00a0\u00b1\u00a0bs\u00a0\u00b1\u00a01.[33][34]Multiply-with-carry PRNGs with a multiplier of a are equivalent to LCGs with a large prime modulus of abr\u22121 and a power-of-2 multiplier b.A permuted congruential generator begins with a power-of-2-modulus LCG and applies an output transformation to eliminate the short period problem in the low-order bits.Comparison with other PRNGs[edit]The other widely used primitive for obtaining long-period pseudorandom sequences is the linear-feedback shift register construction, which is based on arithmetic in GF(2)[x], the polynomial ring over GF(2). Rather than integer addition and multiplication, the basic operations are exclusive-or and carry-less multiplication, which is usually implemented as a sequence of logical shifts. These have the advantage that all of their bits are full-period; they do not suffer from the weakness in the low-order bits that plagues arithmetic modulo 2k.[35]Examples of this family include xorshift generators and the Mersenne twister. The latter provides a very long period (219937\u22121) and variate uniformity, but it fails some statistical tests.[36]Lagged Fibonacci generators also fall into this category; although they use arithmetic addition, their period is ensured by an LFSR among the least-significant bits.It is easy to detect the structure of a linear-feedback shift register with appropriate tests[37] such as the linear complexity test implemented in the TestU01 suite; a boolean circulant matrix initialized from consecutive bits of an LFSR will never have rank greater than the degree of the polynomial. Adding a non-linear output mixing function (as in the xoshiro256** and permuted congruential generator constructions) can greatly improve the performance on statistical tests.Another structure for a PRNG is a very simple recurrence function combined with a powerful output mixing function. This includes counter mode block ciphers and non-cryptographic generators such as SplitMix64.A structure similar to LCGs, but not equivalent, is the multiple-recursive generator: Xn\u00a0= (a1Xn\u22121\u00a0+ a2Xn\u22122\u00a0+ \u00b7\u00b7\u00b7\u00a0+ akXn\u2212k) mod\u00a0m for k\u00a0\u2265\u00a02. With a prime modulus, this can generate periods up to mk\u22121, so is a useful extension of the LCG structure to larger periods.A powerful technique for generating high-quality pseudorandom numbers is to combine two or more PRNGs of different structure; the sum of an LFSR and an LCG (as in the KISS or xorwow constructions) can do very well at some cost in speed.See also[edit]^ a b c d e f g Knuth, Donald (1997). Seminumerical Algorithms. The Art of Computer Programming. Vol.\u00a02 (3rd\u00a0ed.). Reading, MA: Addison-Wesley Professional. pp.\u00a010\u201326.^ a b c Steele, Guy; Vigna, Sebastiano (15 January 2020). “Computationally easy, spectrally good multipliers for congruential pseudorandom number generators”. arXiv:2001.05304 [cs.DS]. At this point it is unlikely that the now-traditional names will be corrected. Mathematics of Computation (to appear). Associated data at https:\/\/github.com\/vigna\/CPRNG.^ Lehmer, Derrick H. (1951). “Mathematical methods in large-scale computing units”. Proceedings of 2nd Symposium on Large-Scale Digital Calculating Machinery: 141\u2013146.^ Thomson, W. E. (1958). “A Modified Congruence Method of Generating Pseudo-random Numbers”. The Computer Journal. 1 (2): 83. doi:10.1093\/comjnl\/1.2.83.^ Rotenberg, A. (1960). “A New Pseudo-Random Number Generator”. Journal of the ACM. 7 (1): 75\u201377. doi:10.1145\/321008.321019. S2CID\u00a016770825.^ L’Ecuyer, Pierre (13 July 2017). Chan, W. K. V.; D’Ambrogio, A.; Zacharewicz, G.; Mustafee, N.; Wainer, G.; Page, E. (eds.). History of Uniform Random Number Generation (PDF). Proceedings of the 2017 Winter Simulation Conference (to appear). Las Vegas, United States. hal-01561551.^ a b Marsaglia, George (September 1968). “Random Numbers Fall Mainly in the Planes” (PDF). PNAS. 61 (1): 25\u201328. Bibcode:1968PNAS…61…25M. doi:10.1073\/pnas.61.1.25. PMC\u00a0285899. PMID\u00a016591687.^ Park, Stephen K.; Miller, Keith W. (October 1988). “Random Number Generators: Good Ones Are Hard To Find” (PDF). Communications of the ACM. 31 (10): 1192\u20131201. doi:10.1145\/63039.63042. S2CID\u00a0207575300.^ H\u00f6rmann, Wolfgang; Derflinger, Gerhard (1993). “A Portable Uniform Random Number Generator Well Suited for the Rejection Method” (PDF). ACM Transactions on Mathematical Software. 19 (4): 489\u2013495. CiteSeerX\u00a010.1.1.52.3811. doi:10.1145\/168173.168414. S2CID\u00a015238956. a multiplier about as small as \u221am, produces random numbers with a bad one-dimensional distribution.^ a b L’Ecuyer, Pierre (1999). “Tables of Linear Congruential Generators of Different Sizes and Good Lattice Structure”. Mathematics of Computation. 68 (225): 249\u2013260. Bibcode:1999MaCom..68..249L. CiteSeerX\u00a010.1.1.34.1024. doi:10.1090\/S0025-5718-99-00996-5. Be sure to read the Errata as well.^ a b Press, William H.; et\u00a0al. (1992). Numerical Recipes in Fortran 77: The Art of Scientific Computing (2nd\u00a0ed.). ISBN\u00a0978-0-521-43064-7.^ Jain, Raj (9 July 2010). “Computer Systems Performance Analysis Chapter 26: Random-Number Generation” (PDF). pp.\u00a019\u201320. Retrieved 2017-10-31.^ Fenerty, Paul (11 September 2006). “Schrage’s Method”. Retrieved 2017-10-31.^ Hull, T. E.; Dobell, A. R. (July 1962). “Random Number Generators” (PDF). SIAM Review. 4 (3): 230\u2013254. Bibcode:1962SIAMR…4..230H. doi:10.1137\/1004061. hdl:1828\/3142. Retrieved 2016-06-26.^ Severance, Frank (2001). System Modeling and Simulation. John Wiley & Sons, Ltd. p.\u00a086. ISBN\u00a0978-0-471-49694-6.^ Austin, David (March 2008). “Random Numbers: Nothing Left to Chance”. American Mathematical Society.^ Implementation in glibc-2.26 release. See the code after the test for “TYPE_0”; the GNU C library’s rand() in stdlib.h uses a simple (single state) linear congruential generator only in case that the state is declared as 8 bytes. If the state is larger (an array), the generator becomes an additive feedback generator (initialized using minstd_rand0) and the period increases. See the simplified code that reproduces the random sequence from this library.^ K. Entacher (21 August 1997). A collection of selected pseudorandom number generators with linear structures. CiteSeerX\u00a010.1.1.53.3686. Retrieved 16 June 2012.^ “Last public Committee Draft from April 12, 2011” (PDF). p.\u00a0346f. Retrieved 21 Dec 2014.^ “How Visual Basic Generates Pseudo-Random Numbers for the RND Function”. Microsoft. 24 June 2004. Archived from the original on 21 July 2020. Retrieved 17 June 2011.^ In spite of documentation on MSDN, RtlUniform uses LCG, and not Lehmer’s algorithm, implementations before Windows Vista are flawed, because the result of multiplication is cut to 32 bits, before modulo is applied^ a b “ISO\/IEC 14882:2011”. ISO. 2 September 2011. Retrieved 3 September 2011.^ “Creating and Controlling a Random Number Stream”. MathWorks. Retrieved 7 June 2021.^ “GNU Scientific Library: Other random number generators”.^ Stephen J. Chapman.“Example 6.4 \u2013 Random Number Generator”.“MATLAB Programming for Engineers”.2015.pp. 253\u2013256.^ Stephen J. Chapman.“Example 6.4 \u2013 Random Number Generator”.“MATLAB Programming with Applications for Engineers”.2012.pp. 292\u2013295.^ S. J. Chapman.random0.2004.^ Stephen J. Chapman.“Introduction to Fortran 90\/95”.1998.pp. 322\u2013324.^ Wu-ting Tsai.“‘Module’: A Major Feature of the Modern Fortran”.pp. 6\u20137.^ The Open Group Base Specifications Issue 7IEEE Std 1003.1, 2013 Edition^ Cadot, Sidney. “rand.s”. cc65. Retrieved 8 July 2016.^ O’Neill, Melissa E. (5 September 2014). PCG: A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation (PDF) (Technical report). Harvey Mudd College. pp.\u00a06\u20137. HMC-CS-2014-0905.^ Tezuka, Shu; L’Ecuyer, Pierre (October 1993). On the Lattice Structure of the Add-with-Carry and Subtract-with-Borrow Random Number Generators (PDF). Workshop on Stochastic Numerics. Kyoto University.^ Tezuka, Shi; L’Ecuyer, Pierre (December 1992). Analysis of Add-with-Carry and Subtract-with-Borrow Generators (PDF). Proceedings of the 1992 Winter Simulation Conference. pp.\u00a0443\u2013447.^ Gershenfeld, Neil (1999). “Section 5.3.2: Linear Feedback”. The Nature of Mathematical Modeling (First\u00a0ed.). Cambridge University Press. p.\u00a059. ISBN\u00a0978-0-521-57095-4.^ Matsumoto, Makoto; Nishimura, Takuji (January 1998). “Mersenne twister: a 623-dimensionally equidistributed uniform pseudo-random number generator” (PDF). ACM Transactions on Modeling and Computer Simulation. 8 (1): 3\u201330. CiteSeerX\u00a010.1.1.215.1141. doi:10.1145\/272991.272995. S2CID\u00a03332028. Archived from the original (PDF) on 2017-11-07.^ Eastlake, Donald E. 3rd; Schiller, Jeffrey I.; Crocker, Steve (June 2005). “Traditional Pseudo-random Sequences”. Randomness Requirements for Security. IETF. sec.\u00a06.1.3. doi:10.17487\/RFC4086. BCP 106. RFC 4086.References[edit]Press, WH; Teukolsky, SA; Vetterling, WT; Flannery, BP (2007), “Section 7.1.1. Some History”, Numerical Recipes: The Art of Scientific Computing (3rd\u00a0ed.), New York: Cambridge University Press, ISBN\u00a0978-0-521-88068-8Gentle, James E., (2003). Random Number Generation and Monte Carlo Methods, 2nd edition, Springer, ISBN\u00a00-387-00178-6.Joan Boyar (1989). “Inferring sequences produced by pseudo-random number generators” (PDF). Journal of the ACM. 36 (1): 129\u2013141. doi:10.1145\/58562.59305. S2CID\u00a03565772. (in this paper, efficient algorithms are given for inferring sequences produced by certain pseudo-random number generators).External links[edit]The simulation Linear Congruential Generator visualizes the correlations between the pseudo-random numbers when manipulating the parameters.Security of Random Number Generation: An Annotated BibliographyLinear Congruential Generators post to sci.mathThe “Death of Art” computer art project at Goldstein Technologies LLC, uses an LCG to generate 33,554,432 imagesP. L’Ecuyer and R. Simard, “TestU01: A C Library for Empirical Testing of Random Number Generators”, May 2006, revised November 2006, ACM Transactions on Mathematical Software, 33, 4, Article 22, August 2007.Article about another way of cracking LCG (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4"},{"@context":"http:\/\/schema.org\/","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/wiki.edu.vn\/en\/wiki24\/#breadcrumbitem","name":"Enzyklop\u00e4die"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/wiki.edu.vn\/en\/wiki24\/linear-congruential-generator-wikipedia\/#breadcrumbitem","name":"Linear congruential generator – Wikipedia"}}]}]