[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: random toss of discrete values with (integer) probability distribution
- From: spir <denis.spir@...>
- Date: Fri, 26 Oct 2012 22:41:13 +0200
Thank you for your nice replies.
As advised by all, I'll build a list of partial sums (actually, I did it since I
need to first traverse the list of probabilities to get the total sum, before
tossing). Sorting probabilities or binary search to accelerate determination of
final result is probably too much work in the present use case, due to a very
small count of possibilities (typically ~ 10). However, I'll keep these ideas
aside, thank you again.
Denis