creating array with greatest variety of numbers
Mostra commenti meno recenti
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 6
1 2 3 4 5 7
1 2 3 4 5 8
1 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 6
7 8 9 10 11 12
1 2 3 4 5 7
13 14 15 16 17 18
19 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 6
7 8 9 10 11 12
1 9 7 14 17 18
13 14 15 16 17 18
19 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.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Univariate Discrete Distributions in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!