Recursive function to develop permutations
thorsten at thorstenkampe.de
Fri Oct 22 12:50:56 CEST 2004
* Steve Goldman (2004-10-19 02:34 +0200)
> I am trying to come up with a way to develop all n-length permutations of a
> given list of values.
I'm sorry but there are no "n-length permutations" in
mathematics/combinatorics. There are variations and combinations -
each of them with and without repetition. The difference is that with
combinations order of the elements is irrelevant and with variations
order is relevant.
Permutations always have the full length of the original list.
Permutations are divided in permutations with and without repetition
(like combinations and variations).
For an (unoptimized) version of permutations see:
PS If you are interested I can post the code for all six
possibilities. The code computes optionally the size of the result
list (because this grows big very soon) so you don't run out of memory
More information about the Python-list