You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Standard PHP functions like rand or mt_rand generate random numbers with normal distribution, however sometimes it
required to generate random numbers with different distribution, for example binomial distribution.
Class constractor receives 3 arguments: low-high bounds of generated numbers and distribution function.
Distribution function receives float argument between 0 and 1 and should return some integer value >= 0, see additional examples for better understanding.
Some Additional Examples
Normal Distribution
$generator = new \Qmegas\RandomGenerator($min, $max, function() {
return1;
});