Defined:
Pseudo-random number: A numerical sequence produced by a mathematical formula or algorithm. Although pseudo-random numbers are not random in mathematical sense, they can be used as true random numbers if they can be statistically verified. algorithm:
The most basic idea of pseudo-random number generation is the uniform distribution (of course, this is not the only idea). Generally speaking, the random number function used in the mainstream programming language is basically using this idea of uniform distribution, and the most commonly used algorithm is "linear with congruential". The pseudo-random number generator is as follows:
xn= (axn−1+b) mod (m)
The a,b,m are constants set by the generator, with a period of M.
High performance linear congruence algorithm parameter values:
(1) multiplier a satisfies a=4p+1, and Delta B satisfies b=2q+1. Where p,q are positive integers.
(2) The M-value is preferably larger, the M-value directly affects the period of the pseudo-random number sequence.
(3) The greater the value of a and B, the more evenly the pseudo-random number is generated.
(4) A and M coprime, the resulting random number effect is less coprime good.
Resources:
Http://www.cnblogs.com/forget406/p/5294143.html