* Thomas Bartkus (2005-07-13 20:20 +0100) > "George Sakkis" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "rbt" <[EMAIL PROTECTED]> wrote: >> >>> Say I have a list that has 3 letters in it: >>> >>> ['a', 'b', 'c'] >>> >>> I want to print all the possible 4 digit combinations of those 3 >>> letters: >>> >>> 4^3 = 64 >> >> >> It's actually 3^4 = 81 (3 candidates/choice ** 4 choices) > > Yes. You get a cigar! > > Someone else (Jack Diederich) also mentioned "This is called a cartesian > product, ..." > Right again.
In set theory it's called "cartesian product" while in combinatorics it's called "variation with repetition". There is some "die-hard" terminology confusion about permutations, combinations and variations (see [1] for example). (luckily at least most of the Python "officials" (GvR and Frederik Lundh) seem to agree about this terminology) Thorsten [1] http://groups-beta.google.com/group/comp.lang.python/msg/dea80dec0192eda6?hl=en& -- http://mail.python.org/mailman/listinfo/python-list