Maths Olympiad Prep

Library / /132 of 133

Combinatorics Difficulty 7.7 National olympiad, round 2 Prove it Saudi Arabia

Define a domino to be an ordered pair of distinct positive integers. A proper sequence of dominoes is a list of distinct dominoes in which the first coordinate of each pair after the first equals the second coordinate of the immediately preceding pair, and in which (i,j)(i, j) and (j,i)(j, i) do not both appear for any ii and jj. Let DnD_{n} be the set of all dominoes whose coordinates are no larger than nn. Find the length of the longest proper sequence of dominoes that can be formed using the dominoes of DnD_{n}.

Solution

Consider the complete graph Gn\mathcal{G}_n, over the set of vertices {1,2,,n}\{1,2, \ldots, n\}. To each domino (i,j)(i, j) in DnD_n, we associate the edge joining the two vertices i,ji, j. In this way, to each edge in Gn\mathcal{G}_n we have associated exactly two dominoes (i,j)(i, j) and (j,i)(j, i), for some 1ijn1 \leq i \neq j \leq n. A proper sequence of dominoes corresponds exactly to a path in Gn\mathcal{G}_n which visits every edge at most once. The problem asks for the length of the longest such path. We will use and prove the following:

> If a finite graph G\mathcal{G} is connected and each of its vertices has an even degree, there exists a closed path which visits all its edges exactly once. This closed path is called Eulerian.

We will prove this fact by induction on the number of edges of G\mathcal{G}.

If G\mathcal{G} has 3 edges, then it is a triangle and the statement is obvious. Assume there exists a closed Eulerian path in any connected graph with all vertices of even degree having less than or equal to mm edges.

Let G\mathcal{G} be a connected graph with m+1m+1 edges and all its vertices are of even degree. Let P\mathcal{P} be a longest path visiting each edge of G\mathcal{G} at most once.

Assume that P\mathcal{P} starts and ends at different vertices v,vv, v'. Path P\mathcal{P} visits an odd number of edges incident to vv. But the degree of vv is even. Then, there exists an edge ee incident to vv which is not visited by P\mathcal{P} and so, we can extend P\mathcal{P} with ee. This contradicts the maximality of P\mathcal{P}. Hence path P\mathcal{P} starts and ends at the same vertex.

Assume that there exists an edge ee not visited by P\mathcal{P} and let vv be a vertex incident to ee and v1v_1 a vertex visited by P\mathcal{P}. Because G\mathcal{G} is connected, there exists a path from vv to v1v_1. Replace v1v_1 by the first vertex in this connecting path visited by P\mathcal{P}. Let G\mathcal{G}' be the graph obtained by deleting from the graph G\mathcal{G} all edges visited by P\mathcal{P} and taking the connected component of v1v_1. Graph G\mathcal{G}' contains edge ee and has less than mm edges. Each vertex vv' of G\mathcal{G}' has even degree since path P\mathcal{P} has visited precisely an even number of edges incident to vv'. Hence, there exists a closed Eulerian path P\mathcal{P}' in G\mathcal{G}'. By considering in G\mathcal{G} the path starting at v1v_1 and walking along all the path P\mathcal{P} and then along all the path P\mathcal{P}' we obtain a longer path in G\mathcal{G} visiting each edge at most once. This contradicts the maximality of P\mathcal{P}. This proves that edge ee does not exist and that P\mathcal{P} is Eulerian.

Back to our problem, we will consider two cases:

If nn is an odd number, the degree of each vertex of the complete graph Gn\mathcal{G}_n is n1n-1, even, and Gn\mathcal{G}_n is connected. So there exists a path visiting all the edges of Gn\mathcal{G}_n exactly once. Hence the longest proper sequence of dominoes that can be formed using the dominoes of DnD_n uses all dominoes. It has length (n2)=n(n1)2\binom{n}{2} = \frac{n(n-1)}{2}.

If nn is an even number, the degree of each vertex of the complete graph Gn\mathcal{G}_n is odd. Let P\mathcal{P} be a longest path visiting each edge at most once. For each vertex vv different from the starting and the ending vertices of P\mathcal{P}, path P\mathcal{P} visits an even number of edges incident to vv. So there exists at least one edge incident to vv not visited by P\mathcal{P}. Because each edge is incident to two vertices, there exists at least n22\frac{n-2}{2} edges not visited by P\mathcal{P}. Hence the length of P\mathcal{P} is less than or equal to (n2)n22=n22n+22\binom{n}{2} - \frac{n-2}{2} = \frac{n^2 - 2n + 2}{2}.

Now, consider the graph Gn\mathcal{G}_n' obtained from Gn\mathcal{G}_n by deleting the edges between 11 and 33, 22 and 33, and 2i12i-1 and 2i2i, for 2in22 \leq i \leq \frac{n}{2}. Graph Gn\mathcal{G}_n' is connected and all its vertices have even degree. So there exists an Eulerian closed path P\mathcal{P}' starting and ending at 33. Extending path P\mathcal{P}' in Gn\mathcal{G}_n at the beginning with the edge between 11 and 33 and at the end with the edge between 22 and 33, we obtain a path P\mathcal{P} of length n22n+22\frac{n^2 - 2n + 2}{2} visiting each edge at most once. Hence the longest proper sequence of dominoes that can be formed using the dominoes of DnD_n has length n22n+22\frac{n^2 - 2n + 2}{2}.

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: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.