how can I choose a random number but with a normal probability distribution in PHP?
mean, php, random, standard-deviation
Solution
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;
}
Problem
In php, how can I generate a a random number assuming a normal distribution with a specific mean and standard devaition?