Re: Weighted choices

2013-09-10 Thread Oscar Benjamin
On 10 September 2013 03:27, Jason Friedman wrote: >> >> OK, you're well inside the "finite" domain. Also, you probably want less >> than the "natural" randomness. I'd probably shuffle the potential >> quarterbacks and the others in independent lists, and then pick one half of >> each to form a tea

Re: Weighted choices

2013-09-10 Thread Antoon Pardon
Op 10-09-13 04:27, Jason Friedman schreef: >>> I coach a flag football team of 11-year-olds. A stated goal of the >>> league is that every player should get nearly equal playing time and >>> that winning is of secondary importance. That said, some players just >>> can't throw the ball at all, and

Re: Weighted choices

2013-09-09 Thread Jason Friedman
>> I coach a flag football team of 11-year-olds. A stated goal of the >> league is that every player should get nearly equal playing time and >> that winning is of secondary importance. That said, some players just >> can't throw the ball at all, and having a quarterback who cannot throw >> is no

Re: Weighted choices

2013-09-09 Thread Antoon Pardon
Op 09-09-13 11:11, Steven D'Aprano schreef: > On Mon, 09 Sep 2013 09:12:05 +0200, Antoon Pardon wrote: > >> Op 09-09-13 02:21, Dennis Lee Bieber schreef: >>> On Sun, 08 Sep 2013 19:48:55 +0200, Antoon Pardon >>> declaimed the following: >>> Op 08-09-13 04:12, Jason Friedman schreef: > ch

Re: Weighted choices

2013-09-09 Thread Peter Otten
Jason Friedman wrote: [You may have sent this in private mail by accident, so I take the freedom to bring this back to the mailing list] > I'm realizing with your question which was roughly: Do picks from a pool influence probability of subsequent picks, i. e. weather the pool is finite or in

Re: Weighted choices

2013-09-09 Thread Steven D'Aprano
On Mon, 09 Sep 2013 09:12:05 +0200, Antoon Pardon wrote: > Op 09-09-13 02:21, Dennis Lee Bieber schreef: >> On Sun, 08 Sep 2013 19:48:55 +0200, Antoon Pardon >> declaimed the following: >> >>> Op 08-09-13 04:12, Jason Friedman schreef: choices = dict() choices["apple"] = 10 choice

Re: Weighted choices

2013-09-09 Thread Antoon Pardon
Op 09-09-13 02:21, Dennis Lee Bieber schreef: > On Sun, 08 Sep 2013 19:48:55 +0200, Antoon Pardon > declaimed the following: > >> Op 08-09-13 04:12, Jason Friedman schreef: >>> choices = dict() >>> choices["apple"] = 10 >>> choices["pear"] = 20 >>> choices["banana"] = 15 >>> choices["orange"] = 2

Re: Weighted choices

2013-09-08 Thread Cameron Simpson
On 08Sep2013 20:21, Dennis Lee Bieber wrote: | However, I would not use a dictionary for this. An ordered list should | work better... for small samples a list containing repeats (by weight) of | each choice, and then use a random integer whose range is 0..len(list)-1 | would suffice. | | c

Re: Weighted choices

2013-09-08 Thread Antoon Pardon
Op 08-09-13 04:12, Jason Friedman schreef: choices = dict() choices["apple"] = 10 choices["pear"] = 20 choices["banana"] = 15 choices["orange"] = 25 choices["kiwi"] = 30 I want to pick sets of fruit, three in a set, where the chance of selecting a given fruit is proportional to its weight. In t

Re: Weighted choices

2013-09-07 Thread Peter Otten
Jason Friedman wrote: > choices = dict() > choices["apple"] = 10 > choices["pear"] = 20 > choices["banana"] = 15 > choices["orange"] = 25 > choices["kiwi"] = 30 > > I want to pick sets of fruit, three in a set, where the chance of > selecting a given fruit is proportional to its weight. In the e

Weighted choices

2013-09-07 Thread Jason Friedman
choices = dict() choices["apple"] = 10 choices["pear"] = 20 choices["banana"] = 15 choices["orange"] = 25 choices["kiwi"] = 30 I want to pick sets of fruit, three in a set, where the chance of selecting a given fruit is proportional to its weight. In the example above, pears should appear twice a