Fix positive integers . A candy vending machine has many different colours of candy, where there are candies of each colour. A couple of kids each buys from the vending machine candies of different colours. Given that for any kids there are two kids who have at least one colour of candy in common, find the maximum number of kids.
Solution
Fix positive integers and . Consider a candy vending machine that has many different colors of candy, with candies of each color. A couple of kids each buys from the vending machine 2 candies of different colors. We are to find the maximum number of kids such that for any kids, there are two kids who have at least one color of candy in common.
We can model this problem using graph theory. Let each kid be represented by a vertex, and draw an edge between two vertices if the corresponding kids share a color of candy. The problem then reduces to finding the maximum number of vertices in a graph such that any vertices have at least one edge connecting them.
This is equivalent to finding the maximum number of vertices in a graph where the largest independent set has size . By Turán's theorem, the maximum number of vertices in such a graph is given by the Turán number , which is the maximum number of edges in a -partite graph with vertices in each part.
The answer is .
Thus, the maximum number of kids is: