Generate N uniform random numbers with sum of one
问题 I am trying to generate 100 uniform random numbers in range [0.005, 0.008] with sum of one. I was looking to several questions which were relevant to my concerns but I did not find my answer. Could anyone give me a suggestion? 回答1: To start, I'm going to slightly modify your example, assuming the 100 variables are bounded by [0.008, 0.012] and that they sum to 1 (this ensures there are feasible points in the set you're sampling). The "hit and run" algorithm uniformly samples over a bounded