2

I have twelve items, numbered 1 through 12.

I want to generate twelve different combinations, each containing three items, with three rules:

  1. each item appears in exactly three different combinations
  2. no two combinations have more than one item in common
  3. (this rule is more complicated; see below)

For example, this set of combinations satisfies rules #1 and #2: [1,2,3], [1,4,9], [2,6,7], [3,8,9], [8,10,12], [1,11,12], [2,5,12], [3,5,7], [4,7,11], [6,8,11], [4,6,10], [5,9,10].

As you can see, rules #1 and #2 guarantee that, for each combination A, there are six other combinations that A shares an item with. Continuing the example, if A is [1,4,9], then it shares an item with each of [1,2,3], [3,8,9], [4,7,11], [4,6,10], [5,9,10], and [1,11,12].

Now, as for rule #3 . . . for each combination A, I want to split its six "overlapping" combinations into three pairs (B,C) such that A and B share one item, B and C share a different item, and A and C share a third item. Continuing the example, if A is [1,4,9], then one valid triple (A,B,C) is ([1,4,9],[1,2,3],[3,8,9]), where A and B both contain 1, B and C both contain 3, and A and C both contain 9. An overall split for [1,4,9] could be ([1,4,9],[1,2,3],[3,8,9]), ([1,4,9],[4,7,11],[1,11,12]), ({[1,4,9],[4,6,10],[5,9,10]).

As you can see, that works perfectly for [1,4,9]. But it doesn't work for all combinations; for example, if A is [4,7,11], then there are only two possible triples (A,B,C). (And in the other direction: if A is [1,2,3], then there are four possible triples (A,B,C).)

So, the above example doesn't satisfy rule #3.

Is it possible to generate a set of combinations that does satisfy all three rules? If so, how?

ruakh
  • 175,680
  • 26
  • 273
  • 307
Xiis
  • 53
  • 5
  • I tried to make it clearer – Xiis Jun 19 '20 at 18:22
  • In my considerations i also thought to approach the problem from behind, i.e. to build valid 6 overlaps. I think a valid set of 6 * 3 overlap numbers must consist of exactly 3 * 2 numbers of A + 3 * 2 numbers not in A [Z] and 6 different numbers not in A and Z, so every number has to accure at least once and not more than twice. TBH I don't think its possible. Thanks ruakh, well edited! – Xiis Jun 19 '20 at 22:01
  • Sounds like it's related to this question about the Spot-It game: https://stackoverflow.com/questions/52822827/spot-it-algorithm-js/52846660 – m69's been on strike for years Jun 20 '20 at 20:35

0 Answers0