Linear Congruential Generator
   HOME



picture info

Linear Congruential 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. 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_ = \left( a X_n + c \right)\bmod m where X is the sequence of pseudo-random values, and : m,\, 0 — the " modulus" : a,\,0 < a < m — the "multiplier" : c,\,0 \le c < m — the "increment" : X_0,\,0 \le X_0 < m — the "seed" or "start value" are

picture info

Linear Congruential Generator Visualisation
In mathematics, the term ''linear'' is used in two distinct senses for two different properties: * linearity of a ''function (mathematics), function'' (or ''mapping (mathematics), mapping''); * linearity of a ''polynomial''. An example of a linear function is the function defined by f(x)=(ax,bx) that maps the real line to a line in the Euclidean plane R2 that passes through the origin. An example of a linear polynomial in the variables X, Y and Z is aX+bY+cZ+d. Linearity of a mapping is closely related to ''Proportionality (mathematics), proportionality''. Examples in physics include the linear relationship of voltage and Electric current, current in an electrical conductor (Ohm's law), and the relationship of mass and weight. By contrast, more complicated relationships, such as between velocity and kinetic energy, are ''Nonlinear system, nonlinear''. Generalized for functions in more than one dimension (mathematics), dimension, linearity means the property of a function of b ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




Primitive Element (finite Field)
In field theory, a primitive element of a finite field is a generator of the multiplicative group of the field. In other words, is called a primitive element if it is a primitive th root of unity in ; this means that each non-zero element of can be written as for some natural number . If is a prime number, the elements of can be identified with the integers modulo . In this case, a primitive element is also called a primitive root modulo . For example, 2 is a primitive element of the field and , but not of since it generates the cyclic subgroup of order 3; however, 3 is a primitive element of . The minimal polynomial of a primitive element is a primitive polynomial. Properties Number of primitive elements The number of primitive elements in a finite field is , where is Euler's totient function, which counts the number of elements less than or equal to that are coprime In number theory, two integers and are coprime, relatively prime or mutually prime i ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Numerical Recipes
''Numerical Recipes'' is the generic title of a series of books on algorithm In mathematics and computer science, an algorithm () is a finite sequence of Rigour#Mathematics, mathematically rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algo ...s and numerical analysis by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery. In various editions, the books have been in print since 1986. The most recent edition was published in 2007. Overview The ''Numerical Recipes'' books cover a range of topics that include both classical numerical analysis (interpolation, Numerical integration, integration, linear algebra, differential equations, and so on), signal processing (Fast Fourier transform, Fourier methods, Digital filter, filtering), statistical treatment of data, and a few topics in machine learning (hidden Markov model, support vector machines). The writing style is acc ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

ZX Spectrum
The ZX Spectrum () is an 8-bit computing, 8-bit home computer developed and marketed by Sinclair Research. One of the most influential computers ever made and one of the all-time bestselling British computers, over five million units were sold. It was released in the United Kingdom on 23 April 1982, and around the world in the following years, most notably in Europe and the United States. The machine was designed by English entrepreneur and inventor Sir Clive Sinclair and his small team in Cambridge, and was manufactured in Dundee, Scotland by Timex Corporation. It was made to be small, simple, and most importantly inexpensive, with as few components as possible. The addendum "Spectrum" was chosen to highlight the machine's colour display, which differed from the black-and-white display of its predecessor, the ZX81. Rick Dickinson designed its distinctive case, rainbow motif, and chiclet keyboard, rubber keyboard. Video output is transmitted to a television set rather than a ded ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

ZX81
The ZX81 is a home computer that was produced by Sinclair Research and manufactured in Dundee, Scotland, by Timex Corporation. It was launched in the United Kingdom in March 1981 as the successor to Sinclair's ZX80 and designed to be a low-cost introduction to home computing for the general public. It was hugely successful; more than 1.5 million units were sold. In the United States it was initially sold as the ZX-81 under licence by Timex. Timex later produced its own versions of the ZX81: the Timex Sinclair 1000 and Timex Sinclair 1500. Unauthorized ZX81 clones were produced in several countries. The ZX81 was designed to be small, simple, and above all, inexpensive, with as few components as possible. Video output was designed for a television set rather than a dedicated monitor. Programs and data are loaded and saved onto compact audio cassettes. It uses only four silicon chips and 1 KB of memory. It has no power switch or moving parts, with the exception ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Compiler
In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language, low-level programming language (e.g. assembly language, object code, or machine code) to create an executable program.Compilers: Principles, Techniques, and Tools by Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman - Second Edition, 2007 There are many different types of compilers which produce output in different useful forms. A ''cross-compiler'' produces code for a different Central processing unit, CPU or operating system than the one on which the cross-compiler itself runs. A ''bootstrap compiler'' is often a temporary compiler, used for compiling a more permanent or better optimised compiler for a language. Related software ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Runtime Library
A runtime library is a library that provides access to the runtime environment that is available to a computer program tailored to the host platform. A runtime environment implements the execution model as required for a development environment such as a particular programming language. A runtime library may provide basic program facilities such as for memory management and exception handling. A runtime library is an artifact of the design of the toolchain used to build the program not inherently required by the host operating system or the programming language in which the program is written. The toolset is designed to abstract aspects of the host platform often to simplify tool development. The toolchain builds a program to depend on a runtime library and to use it while the program is running at program run-time. The runtime library may directly implement runtime behavior, but often it is a thin wrapper on top of operating system facilities. For example, some langua ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Spectral Test
The spectral test is a statistical test for the quality of a class of pseudorandom number generators (PRNGs), the linear congruential generators (LCGs). LCGs have a property that when plotted in 2 or more dimensions, lines or hyperplanes will form, on which all possible outputs can be found. The spectral test compares the distance between these planes; the further apart they are, the worse the generator is. As this test is devised to study the lattice structures of LCGs, it can not be applied to other families of PRNGs. According to Donald Knuth,. this is by far the most powerful test known, because it can fail LCGs which pass most statistical tests. The IBM subroutine RANDU LCG fails in this test for 3 dimensions and above. Let the PRNG generate a sequence u_1, u_2, \dots. Let 1/\nu_t be the maximal separation between covering parallel planes of the sequence \. The spectral test checks that the sequence \nu_2, \nu_3, \nu_4, \dots does not decay too quickly. Knuth recommends che ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Square-free Integer
In mathematics, a square-free integer (or squarefree integer) is an integer which is divisible by no square number other than 1. That is, its prime factorization has exactly one factor for each prime that appears in it. For example, is square-free, but is not, because 18 is divisible by . The smallest positive square-free numbers are Square-free factorization Every positive integer n can be factored in a unique way as n=\prod_^k q_i^i, where the q_i different from one are square-free integers that are pairwise coprime. This is called the ''square-free factorization'' of . To construct the square-free factorization, let n=\prod_^h p_j^ be the prime factorization of n, where the p_j are distinct prime numbers. Then the factors of the square-free factorization are defined as q_i=\prod_p_j. An integer is square-free if and only if q_i=1 for all i > 1. An integer greater than one is the kth power of another integer if and only if k is a divisor of all i such that q_i\neq 1. Th ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




Word Size
In computing, a word is any processor design's natural unit of data. A word is a fixed-sized datum handled as a unit by the instruction set or the hardware of the processor. The number of bits or digits in a word (the ''word size'', ''word width'', or ''word length'') is an important characteristic of any specific processor design or computer architecture. The size of a word is reflected in many aspects of a computer's structure and operation; the majority of the registers in a processor are usually word-sized and the largest datum that can be transferred to and from the working memory in a single operation is a word in many (not all) architectures. The largest possible address size, used to designate a location in memory, is typically a hardware word (here, "hardware word" means the full-sized natural word of the processor, as opposed to any other definition used). Documentation for older computers with fixed word size commonly states memory sizes in words rather than bytes ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Prime Factor
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways of writing it as a product, or , involve 5 itself. However, 4 is composite because it is a product (2 × 2) in which both numbers are smaller than 4. Primes are central in number theory because of the fundamental theorem of arithmetic: every natural number greater than 1 is either a prime itself or can be factorized as a product of primes that is unique up to their order. The property of being prime is called primality. A simple but slow method of checking the primality of a given number , called trial division, tests whether is a multiple of any integer between 2 and . Faster algorithms include the Miller–Rabin primality test, which is fast but has a small chance of error, and the AKS primality test, which always pro ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


If And Only If
In logic and related fields such as mathematics and philosophy, "if and only if" (often shortened as "iff") is paraphrased by the biconditional, a logical connective between statements. The biconditional is true in two cases, where either both statements are true or both are false. The connective is biconditional (a statement of material equivalence), and can be likened to the standard material conditional ("only if", equal to "if ... then") combined with its reverse ("if"); hence the name. The result is that the truth of either one of the connected statements requires the truth of the other (i.e. either both statements are true, or both are false), though it is controversial whether the connective thus defined is properly rendered by the English "if and only if"—with its pre-existing meaning. For example, ''P if and only if Q'' means that ''P'' is true whenever ''Q'' is true, and the only case in which ''P'' is true is if ''Q'' is also true, whereas in the case of ''P if Q ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]