mercredi 26 décembre 2018

Python: Generate n random integer numbers between two values summing up to a given number

I would very much like to generate n random integer numbers between two values(min,max) whose sum is equal to a given number m.

Note: I found similar questions in stackoverflow, however they do not address exactly this problem (use of dirichlet function and thus numbers between 0 and 1).

Example: I need 8 random numbers (integers) between 0 and 24 where the sum of the 8 generated numbers must be equal to 24.

Any help is appreciated. Thanks.




Aucun commentaire:

Enregistrer un commentaire