"Travis E. Oliphant" <[EMAIL PROTECTED]> writes: > > I need to simulate scenarios like the following: "You have a deck of > > 3 orange cards, 5 yellow cards, and 2 blue cards. You draw a card, > > replace it, and repeat N times." > > > Thinking about the problem as drawing sample froms a discrete > distribution defined by the population might help.
Is there some important reason you want to do this as a simulation? And is the real problem more complicated? If you draw from the distribution 100,000 times with replacement and sum the results, per the Central Limit Theorem you'll get something very close to a normal distribution whose parameters you can determine analytically. There is probably also some statistics formula to find the precise error. So you can replace the 100,000 draws with a single draw. -- http://mail.python.org/mailman/listinfo/python-list