jeudi 9 juin 2022

How to generate 6 random number where their sum is equal to a certain value? [duplicate]

I have looked at comparable questions such as:

  1. How to generate a list of random numbers so their sum would be equal to a randomly chosen number
  2. Generating a list of random numbers, summing to 1

but these do not seem to answer my question.

I would like to generate 6 random numbers where the sum of all numbers = 157750 (or well 5 random and the last to be the difference). I have looked at Dirichlet distribution and other methods but not really help.

Does anyone know how to approach this?




Aucun commentaire:

Enregistrer un commentaire