[issue5139] Add combinatoric counting functions to the math module.
Ezio Melotti
report at bugs.python.org
Tue Feb 3 15:49:38 CET 2009
Ezio Melotti <ezio.melotti at gmail.com> added the comment:
Should we add permutations with repetitions?
Example (from Schaum's outline of theory and problems of probability and
statistics):
The number of different permutations of the 11 letters of the word
MISSISSIPPI, which consists of 1 M, 4 I's, 4 S's and 2 P's, is
11! / (1!*4!*4!*2!) = 34650
math.perms_with_repetitions(11, [1,4,4,2])
and maybe parallel function in itertools:
itertools.permutations_with_repetitions(iterable[, r])
This should be equal to itertools.permutations(set(iterable)[, r]).
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5139>
_______________________________________
More information about the Python-bugs-list
mailing list