Consider n to be the number of unique elements.
For example, in case of: A B C D E , n is equal to 5
With these 5 elements 120 different combinations without repetition can be generated (5!).
- Step 1) Assume in this example (A B C D E) we can randomly change the position of only two elements (for instance A and B, to generate a new combination: B A C D E)
- With this approach we can generate 10 ( C5,2 ) unique combinations (out of 120).
- Step 2) Now assume we can repeat step 1, say a times. Each time only by changing the position of two elements. For example (1,3)(2,5), this means that first, position one and three should be swapped, so we will have= C B A D E, after that, in this new combination, position 2 and 5 should be swapped so we will have= C E A D B). With this approach how many unique combinations can we generate?
- I have calculated that when n==5 and a==2, we can generate 43 unique combinations. I'm wondering if we can have a function of n and a to calculate all unique combinations without repetition.
Any thoughts is much appreciated :).