mardi 3 novembre 2015

Generate 20 random number in a range with enthropy

I'm looking for solution to my problem. Say I have a number X, now I want to generate 20 random numbers whose sum would equal to X, but I want those random numbers to have enthropy in them. So for example, if X = 50, the algorithm should generate

  • 3
  • 11
  • 0
  • 6
  • 19
  • 7

etc. The sum of given numbres should equal to 50. Is there any simple way to do that?

Thanks




Aucun commentaire:

Enregistrer un commentaire