I am trying to create an array that contains the most variety of numbers. So, I am doing an n choose k of 22 and 6 respectively. so I have around 72,000 different combinations of 6 numbers from 1-22. Now, I am trying to select an arbitrary number of these combinations to use later on in my code, but that is not really related. My problem is that when I am selecting these combinations I want to select the combinations that use the same numbers the least. For example, if I ask for 4 combinations I don't want it to give me
1 2 3 4 5 61 2 3 4 5 71 2 3 4 5 81 2 3 4 5 9
as the combinations I would more so like something that uses the most of the 22 numbers available and also when it does use a same number in multiple combinations, it puts the number with different numbers than it was placed with the first time so there is more variety. For example this would be different numbers but not much different combos when used multiple times:
1 2 3 4 5 67 8 9 10 11 121 2 3 4 5 713 14 15 16 17 1819 20 21 22 13 12
So this uses all the different numbers, but when it uses 1 again it puts it with the same numbers as before.
This would be more desirable because it puts 1 with different numbers than before:
1 2 3 4 5 67 8 9 10 11 121 9 7 14 17 1813 14 15 16 17 1819 20 21 22 13 12
Now again, I already have it generating all the combinations and I'm just figuring how to select them. I am sorry if this is confusing, I have to admit I can not put it into words very effectively because I am still not entirely sure what is possible and what I am really looking for. Thanks for help if anyone has any ideas.
Best Answer