lundi 30 juillet 2018

Generate random numbers in range given a mean

How would one generate random numbers between a min and max with a supplied mean?

For example, if the min was 4 and max was 25 with an average of 7, generate random numbers in that range that bias the resulting mean (i.e. the mean of all the generate numbers would be close to 7).

I already know how to generate numbers in a range, but the mean is a new thought to me. Is there perhaps something in the <random> library that is built for this?




Aucun commentaire:

Enregistrer un commentaire