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.