There is a game called "Dobble" (or "Spot It!" in some countries) which implies an interesting problem I couldn't solve. The game consists of some amount of cards $c$, which have $s$ distinguishable symbols on them. For every two cards it is guaranteed that they have exactly one symbol in common. Several other questions have been asked about this game (see https://stackoverflow.com/questions/6240113/what-are-the-mathematical-computational-principles-behind-this-game), but I haven't found my question anywhere. I asked myself:
Given the total number of cards $c$ and the number of symbols $s$ per card, what is the minimum number of distinguishable symbols one has to use in order to fulfill the abovementioned condition?
I wrote an algorithm which can answer this question in a reasonable time for $c < 6$ and $s < 6$ in Java, it can be found here. I'm basically using brute-force to check all possibilities until I can be sure that I've found the optimal one. I used some if-clauses to bail out as early as possible and not generate useless possibiilities, but nevertheless the algorithm isn't fast enough for bigger numbers. If anyone is interested, I would explain the code in more detail (the comments I made are in German).
Here is a table with the values I got so far (extended table can be found here):
+---+---+---+----+----+----+----+
| | 1 | 2 | 3 | 4 | 5 | 6 | <- c
+---+---+---+----+----+----+----+
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 2 | 2 | 3 | 3 | 5 | 6 | 7 |
| 3 | 3 | 5 | 6 | 6 | 7 | 7 |
| 4 | 4 | 7 | 9 | 10 | 10 | 11 |
| 5 | 5 | 9 | 12 | 14 | 15 | 15 |
+---+---+---+----+----+----+----+
^
|
s
If $m(c, s)$ denotes the minimal number of distinguishable symbols, we can write down some (trivial) things:
- $m(1, s) = s$
- $m(2, s) = 2s - 1$
- $m(c, 1) = 1$
- $m(c, s) \le c * (s - 1) + 1$
The last inequality comes from the fact that one can always create the following configuration to meat the criterion:
1 1 1 1 ...
2 4 6 8 ...
3 5 7 9 ...
One column represents one card. This pattern can be applied to any $c$ and $s$ and the amount of different symbols is always $c * (s - 1) + 1$.
Furthermore the columns seem to develop according to $m(c, s + 1) = m(c, s) + c$ for larger $s$ and the rows form according to $m(c + 1, s) = m(c, s) + s - 1$ for larger $c$.
I've also searched the Online Encyclopedia of Integer Sequences for rows and columns of this sequence, but I couldn't find any promising results.
Nevertheless, I have no idea how to develop a formula for such a problem and would be thankful for your help.
Proof of formula for c<=s+1:
If $1\le c\le s$ then each of the $c$ cards shares one symbol with each of the other $c-1$ cards. So each card has $s-c+1$ symbols that are not used on any other cards so far. Since $c\le s$, we have $s-c+1 > 0$. So we can create card $c+1$ by choosing one of these $s-c+1$ symbols from each of the $c$ previous cards, and we can be sure there will be no duplicates in these $c$ symbols. This gives us $c$ symbols on card $c+1$, and we need to add a further $s-c$ completely new symbols (note that $s-c\ge0$). So: $$m(c+1,s) = m(c,s) + s - c$$ And we know that $m(1,s) = s$, so $m(2,s) = 2s - 1$ ; $m(3,s) = 3s -3$ ... and in general $$m(c,s) = \sum_{k=0}^{c-1}(s-k) = cs - \frac{c(c-1)}{2}$$ for $1\le c\le s+1$. And, as special cases of this general formula: $$m(s,s) = m(s+1,s) = \frac{s(s+1)}{2}$$
I still don't have a formula for $c>s+1$.