jeudi 25 août 2016

Generate random numbers in a specific range with a standard deviation?

I already know how to generate random numbers in a range. I can do this by using

rand.nextInt((max - min) + 1) + min;

or by

randomNum = ThreadLocalRandom.current().nextInt(min, max + 1);

The problem is that I would also like to set a standard deviation for these numbers. I looked at the official documentation of this clas http://ift.tt/2bIWTZY but I could not find anything.

EDIT Actually I would prefer an answer using the first library and not ThreadLocalRandom because in ThreadLocalRandom I cannot set the seed.




Aucun commentaire:

Enregistrer un commentaire