|
Hi Enrico,
>You can do also in this way:
>- 1- generate n random numbers between [0-1]
>- 2- you transform them into constrained number [20%-40%]
>(simply forcing them to enter into that range:
>ex: you get 0.8, it can be seen as
>0.8/1=x/0.2 new= 0.2+x.
>- 3- then you compute all the sum of these numbers.
>And you rescale all the numbers in order to sum to one
after rescaling in step 3 you have no guarantees that the constraints are
still observed.
ciao -- Nando
|