<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Terry Reedy wrote: > >> >> Are the dice identical or distinguishable (marked). In other words, >> with 2 >> dice, is 1,2 the same as 2,1 or different? Note that in most dice >> games, >> such as craps, the dice are not distinguished, but probability >> calculations >> must treast them as if they were to get the elementary events. >> > they are distinct. This isn't necessarily about simulating a game. So > yes the dice are marked and I want to track those different > possibilties.
Then your dice problem is equivalent to generating all n-digit base-d numbers, which is also the n-fold cartesian product of a set with itself. Sequential generation amounts to a 'plus-1' operation. tjr -- http://mail.python.org/mailman/listinfo/python-list