Mag*_*gie 9 php
在php中,我如何生成一个随机数,假设具有特定均值和标准devaition的正态分布?
Pau*_*aul 13
function nrand($mean, $sd){ $x = mt_rand()/mt_getrandmax(); $y = mt_rand()/mt_getrandmax(); return sqrt(-2*log($x))*cos(2*pi()*$y)*$sd + $mean; }
归档时间:
13 年,4 月 前
查看次数:
2910 次
最近记录: