RE: Random selection

2007-05-21 Thread Hamilton, William
> From: Tartifola > Hi, > I have a list with probabilities as elements > > [p1,p2,p3] > > with of course p1+p2+p3=1. I'd like to draw a > random element from this list, based on the probabilities contained in > the list itself, and return its index. > > Any help on the best way to do that? > Tha

Re: Random selection

2007-05-18 Thread Roger Miller
On May 17, 10:39 pm, Tartifola <[EMAIL PROTECTED]> wrote: > Hi, > I have a list with probabilities as elements > > [p1,p2,p3] > > with of course p1+p2+p3=1. I'd like to draw a > random element from this list, based on the probabilities contained in > the list itself, and return its index. > > Any h

Re: Random selection

2007-05-18 Thread Peter Otten
Tartifola wrote: > I have a list with probabilities as elements > > [p1,p2,p3] > > with of course p1+p2+p3=1. I'd like to draw a > random element from this list, based on the probabilities contained in > the list itself, and return its index. > > Any help on the best way to do that? import ran