python3.x - Python随机数生成器的正确用法应该是什么
PHP中文网
PHP中文网 2017-04-18 09:24:33
0
3
749
PHP中文网
PHP中文网

认证0级讲师

reply all(3)
PHPzhong

The expected value is the average of a large number of experiments. This is just a single experiment. The reason why you get 0 several times is because the variance is very large, and the results are mainly distributed between large numbers and 0. The probability that the result is not 0 is the probability that 0 does not appear among 100 random numbers. This is 0.9 raised to the 100th power, which is about 0.000026. According to the theorem of large numbers (or some other theorem), this semester’s mathematical statistics and probability theory Hang up

阿神

Your random number is correct, there is something wrong with your program. In your y*=x line, as long as one x randomly reaches 0, the final y will be 0. If you loop 100 times, x will definitely reach 0 randomly. This is elementary school multiplication problem, classmate

大家讲道理

I suggest you take another look at the Theorem of Large Numbers. The hundred times you have here are just one experiment, and you need an outer loop. . .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template