jeudi 7 mai 2015

Poisson distribution or Normal distribution

If it is needed to generate randoms in [N, M] range, but with more numbers close to avg (N <= avg <= M), which is better to use:

Seeing at examples at cppreference pages (at bottom of the pages), they both generate what is needed:

poisson_distribution at point 4:

0 *
1 *******
2 **************
3 *******************
4 *******************
5 ***************
6 **********
7 *****
8 **
9 *
10 
11 
12 
13

normal_distribution at point 5 with standard deviation 2:

-2 
-1 
 0 
 1 *
 2 ***
 3 ******
 4 ********
 5 **********
 6 ********
 7 *****
 8 ***
 9 *
10 
11 
12

What to choose? May be something else?




Aucun commentaire:

Enregistrer un commentaire