This is an example of enumerating permutations. That is, it will generate every possible combination of n things taken n at a time, without duplication.

Things to do:

Enumerate permutations of n things taken x at a time (x <= n)

Enumerate permutations of n things taken x at a time, where y things can be the same (y <= x <= n)

Enumerate combinations (in permutations order is important, while in combinations it isn't)

Things to do:

Enumerate permutations of n things taken x at a time (x <= n)

Enumerate permutations of n things taken x at a time, where y things can be the same (y <= x <= n)

Enumerate combinations (in permutations order is important, while in combinations it isn't)