I would have expected item at index no. 10 to be [2][1]. No?

This happens at the end of each combination, dropping the items as the list goes higher.


List.Permutations should give you more or less the behaviour you’re expecting (except for combinations like 1+1, 2+2 etc.) as it takes into account the order of items in each sublist. List.Combinations will “only” give you unique combinations of list elements.

1 Like

If I under you correctly - if [2][1] already exists in a list, List.Combination will not return a [1][2], but the List.Permutations will. Correct?


Bewarned that using list.permutations on any list larger than 6 or 7 will suffer greatly in terms of performance since List.Permutations generates a list of length n!. That number gets big fast… and your computer will feel the pain. To test, just create a simple list 1…10…1, then run list.permutation on it. I have 32Gb of RAM and a 2.7Ghz processor, and Dynamo works for over 1o minutes when I do this before giving me a list of 3.6 million permutations.