number generator

Duncan Smith buzzard at urubu.freeserve.co.uk
Wed Mar 14 10:05:35 EDT 2007


Duncan Smith wrote:
> greg wrote:
> 
>>Gabriel Genellina wrote:
>>
>>
>>>The 5th number is not "random".
>>
>>
>>More precisely, the fifth number is not *independent*
>>of the others. You can't have five independent random
>>numbers that sum to 50; only four independent numbers
>>plus a dependent one.
>>
>>-- 
>>Greg
> 
> 
> In the interests of precision, that should probably read "are
> constrained to sum to 50"; it's quite possible to generate a sequence of
> independent random variates that just happen to sum to 50 (as I'm sure
> you know).
> 
> A fairly efficient way of generating random multinomial variates (which
> would satisfy the OP's problem)

[snip]

That is, the OP's original problem (without the positivity constraint
added in a later post).

Duncan



More information about the Python-list mailing list