vendredi 21 août 2015

random numbers from exponential distribution such that their sum equals SUM

i'm a bit lost as I am not familiar with stochastic and therefore lack the understanding of what I actually have to do. I need to program the following in python3:

I want to draw k random numbers i_1,...,i_k with min <= i <= max from an exponentially shaped distribution of values with m,std being median and standard of the population's values. The sum(i1,..,ik) should equal a given parameter SUM.

Example:
Given:

k = 10
SUM = 175
min = 8
max = 40
m = 14

Desired: [9, 10, 11, 12, 14, 17, 23, 30, 39]

I don't know if this is actually possible without depending on luck to draw a combination satisfying the SUM rule. I'd appreciate any kind of help or comment. Thank you.




Aucun commentaire:

Enregistrer un commentaire