Method to generate group division which is unique over multiple levels
Show older comments
Often I'm challenged to find unique group divisions to run my experiments. Up till now I always succeeded by looping a random generator to generate such a division. However since quantities get bigger, this does not seem to work anymore.
The problem I'm trying to solve: Each level there are 12 elements which should be divide in 4 groups (3 elements per group). There are 5 levels. The objective is that the division is unique in the way that over the 5 different levels, each element never meets another element more than once.
Example:
elements = [1:12];
- groups for level 1: [1 2 3]; [4 5 6]; [7 8 9]; [10 11 12];
- groups for level 2: [4 2 12]; [7 5 3]; [10 8 6]; [1 11 9];
Looking over these 2 different levels, each element never meets another element more than once, because:
- element 1 meets [2 3 9 11]
- element 2 meets [1 3 4 12]
- element 3 meets [1 2 5 7]
- ...
So over n levels, each element meets 2*n different elements. Over 5 levels, each element would meet 10 other elements, which is theoretically possible as there are in total 12 elements.
Does anybody has a suggestion how to generate an unique set over 5 levels?
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!