To do experiments, you need to generate a sequence based on the minimum value, maximum value and standard deviation. The programming language is not limited. Please provide an idea. The size of the sequence is about 1000
阿神2017-05-16 13:31:42
The questioner did not explain the specific requirements for a random number sequence, such as whether it is an integer or a real number, what statistical distribution needs to be met, etc. It is assumed here that the subject needs to generate real numbers and the distribution is centrally symmetric. This distribution might as well be constructed using the Beta
distribution, since it allows for adjustment of the standard deviation. If the random variable is taken as
$$min+(max - min) X,quad X sim Beta{(alpha, alpha)}$$
It is easy to calculate the standard deviation at this time as
$$s = frac{max - min}{2sqrt{1+2alpha}}$$
That’s
$$alpha = frac{(max-min)^2}{8s^2}-frac{1}{2}$$
Through the above analysis, it is easy to write code with Mathematica:
Test the effect. Take the minimum value 20, the maximum value 100, and the standard deviation 15: