Number of ways to put colored balls in bins such that each color is matched with all others exactly once

90 Views Asked by At

Suppose I have balls with $k$ possible colors, and $m$ of each color for a total of $mk$ balls. How many ways can I place all $mk$ balls into $k$ bins such that each color is placed in the same bin with the other colours exactly once e.g. a red ball and a blue ball are in the same bin once.

I have tried the usual inclusion-exclusion approaches for simpler problems but I keep getting caught out by the matching constraint causing some assignments to be suboptimal later on.

1

There are 1 best solutions below

5
On BEST ANSWER

There are $k$ colors and $m$ balls which means there is a $mk$ balls. We want to place them into $k$ bins which means each bin has $m$ balls.

Notice that if a bin is not monochrome it cannot have two balls of the same color. It follows $k\geq m$ because otherwise all bins would have to be monochrome.

Assume that there is a monochromatic bin, then that means all $m$ balls of that color are in that bin, which means that color cannot be matched to any other.

It follows that all bins contain $m$ different colors.

Notice each bin matches $\binom{m}{2}$ colors and there are $k$ bins. Since there are $\binom{k}{2}$ pairs of colors that need to be matched this means $\binom{m}{2}k = \binom{k}{2}$ or $m(m-1) = k-1$ or $k=m^2-m+1$.

Moreover if we view each color as a point and each bin as a block we must get a steiner system $S(2,m,m^2-m+1)$.

It turns out that when $m=p^a+1$ there is at least one solution because we can take a projective plane.