dimanche 17 juin 2018

How to get random numbers with different probabilities in different ranges in java?

I want to get an integer random number between 0 and 100 with different probabilities in different ranges. for example I want the probability of values between 0 and 20 to be 0.5 and the probability of values between 21 and 80 to be 0.4 and the probability of values between 81 and 100 to be 0.1 .

Is there any method or class in java or any library for java to do it? If no how can I do it myself?




Aucun commentaire:

Enregistrer un commentaire