I want to perform a random roll of n k-sided dice (with values 1 to k), where only the sum of the consecutive rolls is the output I want to get. Assuming I have a (pseudo-)random number generator at hand, I can use a loop and just perform n rolls and sum the result.
However, if the number of rolls grows, so does the time it takes to compute the result. Is there a way to simulate the result without breaking it down to individual rolls, with the same probability distribution of possible values?
Aucun commentaire:
Enregistrer un commentaire