What Is Stochastic Programming?

A pseudo-random number is a sequence of random numbers from a uniform distribution of [0,1] calculated using a deterministic algorithm. It is not truly random, but has statistical characteristics similar to random numbers, such as uniformity and independence. When the pseudo-random number is calculated, if the initial value (seed) used is unchanged, the sequence of the pseudo-random number is also unchanged. Pseudo-random numbers can be generated by a large number of computers. In order to improve simulation efficiency in simulation research, pseudo-random numbers are generally used instead of real random numbers. Generally used in the simulation is a pseudo-random number with a very long cycle period and can pass the random number test to ensure the randomness of the calculation result. [1]

Pseudo-random number

Generally, there are three main methods for generating pseudo-random numbers:
(1) direct method (Direct Method), generated according to the physical meaning of the distribution function. The disadvantage is that it only applies to some random numbers with special distributions, such as binomial distribution and Poisson distribution.
(2) reversal method (Inversion Method), U is assumed to obey [0,1] uniformly distributed within the interval, so that X = F-1 (U), the cumulative distribution function (CDF) of the X is F. The method is simple in principle, convenient in programming, and widely applicable.
(3) Acceptance-Rejection Method: Assume that you want to generate random numbers
C language program example
Let's look at such a C program:
Repeat N = 10,000 experiments, each time generating S = 20 and S = 100 randomly distributed samples, and use the Kolmogorov-Smirnov hypothesis test to determine whether the samples meet the uniform distribution. Provisions:
0 hypothesis (null hypothesis) uniform distribution of the sample; 1 is assumed (alternative hypothesis) of the sample is not uniformly distributed.
Measured by the P value ( [0, 1]), the closer the P value is to 0, the more reason to reject the 0 hypothesis, that is, the sample does not obey the uniform distribution; the closer the P value is to 1, the more reason to accept 0 The assumption is that the samples obey a uniform distribution.
As shown in Figure 1 and Figure 2: As the P value decreases, the sample becomes less and less subject to uniform distribution. In practice, the larger the value of P, the better. However, statistical conclusions show, P value of a certain uniform distribution, and N, regardless of the size of S, which shows that due to the randomness, there is always a particular sample obtained by sampling disobedience, even far from a uniform distribution. In addition, the different sample sizes cause different test standards. Intuitively, the uniform distribution corresponding to S = 100 is generally more uniform than that corresponding to S = 20. Therefore, the difference of evenly distributed PRNG is particularly serious in the case of small samples.

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?