17 May 06:15
Re: quickly pulling marbles out of urns
From: Kent Johnson <kent37 <at> tds.net>
Subject: Re: quickly pulling marbles out of urns
Newsgroups: gmane.comp.python.tutor
Date: 2008-05-17 04:15:23 GMT
Subject: Re: quickly pulling marbles out of urns
Newsgroups: gmane.comp.python.tutor
Date: 2008-05-17 04:15:23 GMT
On Fri, May 16, 2008 at 5:43 PM, Joel Miller <joel.c.miller <at> gmail.com> wrote: > I'm looking for a faster way to do the following problem: > > I have an urn with many different colors of marbles in it. I pull one > out and note the color. I do not replace it. You probably know, this is called sampling without replacement. If you can put all the 'marbles' in a list, here is a promising approach: http://groups.google.com/group/comp.lang.python/browse_thread/thread/dff9425afdb744e5/6b9a84329c0815d4?lnk=raot This is probably worth looking at too though I can't understand it at this hour: http://safari.oreilly.com/0596007973/pythoncook2-CHP-18-SECT-4 Kent _______________________________________________ Tutor maillist - Tutor <at> python.org http://mail.python.org/mailman/listinfo/tutor
RSS Feed