Reply
Sat 19 Nov, 2022 12:10 am
Given the range 1-10
Form all possible pairs: [1,2], [1,3], [1,4], [1,5], [2,3], [2,4],[2,5],[3,4],[3,5],[4,5]
I would like some help with an algorithm to do the following:
Combine numbers into a minimal list of five numbers to ensure all pairs are covered with minimum duplication.
In the list below all pairs are covered i.e 1 with every other number, 2 with every other number etc.
For example the last line could be removed because the second and second last line already have these pairs represented.
1,2,3,4,5
1,6,7,8,9
1,10,2,6,7
2,8,9,10,3
3,6,7,8,9
3,10,4,6,7
4,8,9,10,5
5,10,6,7,8
@millamber,
10 * 10 = 100 pairs. Smooth sailing from there ...
@Agent Smith,
Hi Agent Smith,
I'm not after the formula for working out how many pairs there are, that part is pretty straight forward.
I am more interested in how to combine each of the pairs into groups of five numbers and doing this with a minimum number of groups.
@millamber,
There are 100 unique permutations.
Permutations possible in fives = 100 * 100 * 100 * 100 * 100 = 10,000,000,000 or 10 billion