Re: [Tutor] quickly pulling marbles out of urns

2008-05-16 Thread John Fouhy
On 17/05/2008, Joel Miller <[EMAIL PROTECTED]> wrote: > 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. Kent's suggest seems simplest: represent the marbles as a list of integers, where marbles[i] is the integer corresponding

Re: [Tutor] quickly pulling marbles out of urns

2008-05-16 Thread Kent Johnson
On Fri, May 16, 2008 at 5:43 PM, Joel Miller <[EMAIL PROTECTED]> 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

[Tutor] quickly pulling marbles out of urns

2008-05-16 Thread Joel Miller
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. For the programming of this, I actually know how many are yellow, green, etc. So the way the code works right now is: im