in reply to Weighted random numbers generator
If I am correct, all solutions presented so far focus on getting one element. I've been looking for an efficient way to do exactly what spurperl is looking for, only for a number of samples. Ie., I want to say
@indices = DrawSamplesUneven(@elements, 5);
and get five indices. Any ideas?
Update: See my previous question Drawing samples from a set (regarding drawing one sample)
Update: Forgot to mention that of course I want to get five different indices.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Weighted random numbers generator
by dga (Hermit) on Mar 13, 2003 at 18:33 UTC |