danomaniac
New Member
- Joined
- Feb 11, 2025
- Messages
- 2
- Office Version
- 2003 or older
- Platform
- Windows
I am trying to figure out how to generate a list of unique subsets from a larger set of numbers where each number in the larger set is evenly distributed across all subsets.
Ideally, each subset would be sorted ascending left to right.
For example, if the set is 12 numbers is 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 and I wanted to make 20 subsets of 7 numbers each, then the subsets would be something like:
subset 1: 1, 2, 3, 4, 5, 6, 7
subset 2: 1,2,8,9,10,11,12
subset 3: 3,4,5,6,7,8,9
subset 4: 2,3,4,8,9,10,11
subset 5: 1,2,5,6,7,8,9
etc. to
subset 20: 6,7,8,9,10,11,12
I know there are thousands of permutations that will be omitted with a small number of subsets, but the important thing is no duplicates and even distribution, or as close to even as possible. In this case, 20 sets of 7 numbers is 140, divided by 12 numbers is 11.667 times each, so 8 of the numbers would be used 12 times and 4 would only be used 11 times (8x12=96, + 4x11=44, 96+44=140)
Also, I'd like to be able to change the size of the sets. For example: 20 sets of 6 numbers from a set of 10, or 40 sets of 9 numbers from a set of 16. All while maintaining even distribution.
Ideally, each subset would be sorted ascending left to right.
For example, if the set is 12 numbers is 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 and I wanted to make 20 subsets of 7 numbers each, then the subsets would be something like:
subset 1: 1, 2, 3, 4, 5, 6, 7
subset 2: 1,2,8,9,10,11,12
subset 3: 3,4,5,6,7,8,9
subset 4: 2,3,4,8,9,10,11
subset 5: 1,2,5,6,7,8,9
etc. to
subset 20: 6,7,8,9,10,11,12
I know there are thousands of permutations that will be omitted with a small number of subsets, but the important thing is no duplicates and even distribution, or as close to even as possible. In this case, 20 sets of 7 numbers is 140, divided by 12 numbers is 11.667 times each, so 8 of the numbers would be used 12 times and 4 would only be used 11 times (8x12=96, + 4x11=44, 96+44=140)
Also, I'd like to be able to change the size of the sets. For example: 20 sets of 6 numbers from a set of 10, or 40 sets of 9 numbers from a set of 16. All while maintaining even distribution.