Hi,
I have 10 text strings (for this example will use colors as listed below) that I want to combine in unique non-repeating combinations from 2 to 10. (More info below colors)
Red
Green
Yellow
Blue
White
Black
Orange
Purple
Grey
Brown
So what I mean is that I would like combo's as follows:
red-green
red-yellow
...other 2 string combos
red-green-yellow
red-green-blue
....other 3 string combos
red-green-yellow-blue
red-green-yellow-white
...other 4 string combos
...all the way to 10 string combo
I have found code that will do this, the problem is that I get combo's that repeat (but in different order), like:
red-green
green-red
red-green-yellow
yellow-green-red
The key here is that the order doesn't matter, want only one instance of the colors combined for each 2,3,4, 5, etc.. value sets. I am not much of a math whiz, but believe this has to do with factorials, so the following table should represent the total number of non-repeating combinations that there would be:
10 item Combo = 1 unique combo
9 item Combo = 10 unique combos
8 item Combo = 45 unique combos
7 item Combo = 121 unique combos
6 item Combo = 210 unique combos
5 item Combo = 252 unique combos
4 item Combo = 210 unique combos
3 item Combo = 120 unique combos
2 item Combo = 45 unique combos
1 item = 10 items listed
Total unique combinations= 1,024
Any help on how to code this would be greatly appreciated.
Thanks,
Rick
I have 10 text strings (for this example will use colors as listed below) that I want to combine in unique non-repeating combinations from 2 to 10. (More info below colors)
Red
Green
Yellow
Blue
White
Black
Orange
Purple
Grey
Brown
So what I mean is that I would like combo's as follows:
red-green
red-yellow
...other 2 string combos
red-green-yellow
red-green-blue
....other 3 string combos
red-green-yellow-blue
red-green-yellow-white
...other 4 string combos
...all the way to 10 string combo
I have found code that will do this, the problem is that I get combo's that repeat (but in different order), like:
red-green
green-red
red-green-yellow
yellow-green-red
The key here is that the order doesn't matter, want only one instance of the colors combined for each 2,3,4, 5, etc.. value sets. I am not much of a math whiz, but believe this has to do with factorials, so the following table should represent the total number of non-repeating combinations that there would be:
10 item Combo = 1 unique combo
9 item Combo = 10 unique combos
8 item Combo = 45 unique combos
7 item Combo = 121 unique combos
6 item Combo = 210 unique combos
5 item Combo = 252 unique combos
4 item Combo = 210 unique combos
3 item Combo = 120 unique combos
2 item Combo = 45 unique combos
1 item = 10 items listed
Total unique combinations= 1,024
Any help on how to code this would be greatly appreciated.
Thanks,
Rick