Maths Olympiad Prep

Library / /171 of 520

Combinatorics Difficulty 6.7 National olympiad Find the answer

In a city of gnomes there are 10001000 identical towers, each of which has 10001000 stories, with exactly one gnome living on each story. Every gnome in the city wears a hat colored in one of 10001000 possible colors and any two gnomes in the same tower have different hats. A pair of gnomes are friends if they wear hats of the same color, one of them lives in the kk-th story of his tower and the other one in the (k+1)(k+1)-st story of his tower. Determine the maximal possible number of pairs of gnomes which are friends.

[i]Proposed by Nikola Velov[/i]

A number or a short expression. Spacing and $ signs are ignored.

Solution

1. Restate the problem with generalization:
We are given n=1000 n = 1000 towers, each with n=1000 n = 1000 stories, and each story has one gnome. Each gnome wears a hat of one of n=1000 n = 1000 colors, and no two gnomes in the same tower have the same hat color. A pair of gnomes are friends if they wear hats of the same color and live on consecutive stories in their respective towers. We need to determine the maximum number of such pairs of friends.

2. Define the problem in terms of graphs:
Let n n be any even integer. We will prove that the maximum number of pairs of friends is n34 \frac{n^3}{4} . Let ai a_i be the n n colors, and consider the n n graphs Gi G_i such that the vertices of each Gi G_i are the n n gnomes of color i i , and we connect two gnomes with an edge if and only if they are friends.

3. **Claim: Each Gi G_i is a bipartite graph.
-
Proof:**
We will prove that Gi G_i cannot have odd cycles, which implies that Gi G_i is bipartite (a well-known characterization of bipartite graphs). Assume otherwise. Assign a red candy to each gnome on the (2j+1) (2j+1) -th story for some j j , and a blue candy to each gnome on the 2j 2j -th story for some j j . Along a cycle, we alternate between gnomes with red and blue candies, making it impossible for the cycle to have odd length, as desired. \blacksquare

4. **Calculate the maximum number of edges in each Gi G_i :**
Since each Gi G_i is bipartite, it has at most n24 \frac{n^2}{4} edges. If the two parts of the graph have a a and b b vertices respectively, then a+b=n a + b = n and by the Arithmetic Mean-Geometric Mean (AM-GM) inequality, ab(a+b)24=n24 ab \leq \frac{(a+b)^2}{4} = \frac{n^2}{4} .

5. Total number of pairs of friends:
Therefore, in total, we have at most nn24=n34 n \cdot \frac{n^2}{4} = \frac{n^3}{4} pairs of friends, since those pairs appear only between vertices of the same Gi G_i .

6. Example to show attainability:
An example showing that this is attainable is the following (for n=6 n = 6 , with columns denoting towers and rows denoting stories, where the last row is the first story), which easily generalizes:
121212212121343434434343565656656565 \begin{array}{|c|c|c|c|c|c|} \hline 1 & 2 & 1 & 2 & 1 & 2 \\ \hline 2 & 1 & 2 & 1 & 2 & 1 \\ \hline 3 & 4 & 3 & 4 & 3 & 4 \\ \hline 4 & 3 & 4 & 3 & 4 & 3 \\ \hline 5 & 6 & 5 & 6 & 5 & 6 \\ \hline 6 & 5 & 6 & 5 & 6 & 5 \\ \hline \end{array}

The final answer is n34\boxed{\frac{n^3}{4}}.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.