Maths Olympiad Prep

Library / /2 of 10

Combinatorics Difficulty 8.5 Shortlist Prove it United States

A country has nn cities, labeled 11, 22, 33, \dots, nn. It wants to build exactly n1n-1 roads between certain pairs of cities so that every city is reachable from every other city via some sequence of roads. However, it is not permitted to put roads between pairs of cities that have labels differing by exactly 11, and it is also not permitted to put a road between cities 11 and nn. Let TnT_n be the total number of possible ways to build these roads.

a. For all odd nn, prove that TnT_n is divisible by nn.

b. For all even nn, prove that TnT_n is divisible by n/2n/2.

Solutions — 2

Solution 1

Solution 1 (by Jon Schneider). Let AA be the set of good trees. Consider the operation SS which takes a tree, and replaces each edge connecting vertices xx and yy with an edge connecting vertices x+1x+1 and y+1y+1 (labels taken modulo nn). Note that SS is invertible and sends good trees to good trees, so it partitions the set AA into several orbits (where two trees are in the same orbit if you can reach one from the other by repeatedly applying SS). We will show that all orbits either have size nn or n/2n/2, thus proving the required statement.

Given any tree TT, note that SnT=TS^n T = T (because x+nx(modn)x+n \equiv x \pmod{n}). Now, if the orbit that TT belongs to has size rr, then rr is the smallest positive value satisfying SrT=TS^r T = T, and it follows that rr must divide nn. We now have two cases.

* Case 1 In this case, we assume that rr does not divide n/2n/2. Consider any edge (x,y)(x, y) of TT. Note that if SrT=TS^r T = T, then this implies that the edge (x+r,y+r)(x+r, y+r) is also in TT, so in particular, the n/rn/r edges
(x,y),(x+r,y+r),(x+2r,y+2r),,(xr,yr) (x, y), (x+r, y+r), (x+2r, y+2r), \dots, (x-r, y-r)
must belong to TT. Now, note that all of these edges are distinct; indeed, if the edges (x,y)(x, y) and (x+ar,y+ar)(x + ar, y + ar) are the same (for some 1a<nr1 \le a < \frac{n}{r}), then the only way this can happen is if (because xx+arx \ne x + ar)
xy+aryx+ar \begin{aligned} x &\equiv y + ar \\ y &\equiv x + ar \end{aligned}
But this can only happen if xx+2arx \equiv x + 2ar, or equivalently, n2arn|2ar. If nn is odd, then this means that narn|ar, which cannot happen for 1a<nr1 \le a < \frac{n}{r}. Likewise, if nn is even, because rr does not divide n2\frac{n}{2}, this likewise implies that narn|ar, and again this cannot happen for our choices of aa. Therefore, we can partition the edges of TT into groups of nr\frac{n}{r} edges. However, TT has n1n-1 edges, and nr\frac{n}{r} cannot divide n1n-1 unless r=nr=n, because gcd(n1,n)=1\gcd(n-1, n) = 1. It follows that rr must equal nn, and therefore that the orbit has size nn.

* Case 2 In this case, we assume that rr divides n2\frac{n}{2} (in particular, nn is even). We proceed similarly as in the first case. The only difference this time is that if y=x+n2y = x + \frac{n}{2}, then we only have a group of n2r\frac{n}{2r} distinct edges (because in this case, the edges (x+ar,y+ar)(x + ar, y + ar) are only distinct for 0a<n2r0 \le a < \frac{n}{2r}). Nonetheless, we can still partition the edges of TT into groups of either nr\frac{n}{r} edges or n2r\frac{n}{2r} edges, which means that n1n-1 must be divisible by n2r\frac{n}{2r}. But again, because gcd(n1,n)=1\gcd(n-1, n) = 1, this can only happen if r=n2r = \frac{n}{2}, and therefore our orbit has size n/2n/2.

Solution 2

Solution 2 (by the poser). There are many spanning trees which avoid edges between consecutive labels. Separate them into groups as follows. Given such a labeled spanning tree TT, consider the tree TT' obtained by taking TT, and replacing each label ii with i+1i+1, and replacing the label nn with 11. This cycles the labels on the vertices. Say that two trees are of the same type if they can be reached from each other by performing this simple cycling operation some number of times. Importantly, the cycling operation respects the property that no consecutively-labeled vertices span an edge.

Clearly, this completely partitions the spanning trees counted by TnT_n into some collection of types. It suffices to show that for each fixed type, the number of spanning trees of that type is divisible by nn when nn is odd, and divisible by n/2n/2 when nn is even. For this, we will need the following lemma:

Lemma 4. Let TT be a tree with vertices labeled 1,,n1, \dots, n, and let π:[n][n]\pi : [n] \to [n] be an automorphism of TT, i.e., where vertices ii and jj are adjacent in TT if and only if π(i)\pi(i) and π(j)\pi(j) are adjacent in TT. Then π\pi must have a fixed point π(i)=i\pi(i) = i or a fixed edge {π(i),π(j)}={i,j}\{\pi(i), \pi(j)\} = \{i, j\}.

Proof. Suppose for contradiction that π\pi does not have a fixed point. Then, for every vertex ii, the permutation π\pi maps it to some vertex π(i)\pi(i) somewhere else in the tree. Because trees are acyclic and connected, there is a unique path from ii to π(i)\pi(i), and it departs from ii along an edge incident to ii. Draw an arrow on that edge indicating the direction of departure, and do this for every vertex.

Because there are nn vertices and only n1n-1 edges, the pigeonhole principle implies that some edge {i,j}\{i, j\} receives two arrows. By construction, those two arrows on the same edge must be in different directions, and must indicate that π(i)\pi(i) is on the jj-side of the edge, and π(j)\pi(j) is on the ii-side (according to TT). Yet because π\pi is an automorphism, we must have that π(i)\pi(i) and π(j)\pi(j) are adjacent in TT, which therefore implies that π(i)=j\pi(i) = j and π(j)=i\pi(j) = i, producing the fixed edge. \square

We now apply lemma 4. Consider a particular labeled tree TT counted by TnT_n. The number of other trees of the same type is precisely equal to the minimum number of times kk that one must apply the cycling operation to TT before obtaining TT itself again. This corresponds precisely to an automorphism π\pi which itself is a cyclic shift ii+ki \mapsto i + k (where n+1n + 1 corresponds to 11, etc). It is clear that fixed points do not arise unless nkn \mid k, and fixed edges (transpositions) never arise for odd nn, immediately proving that nTnn \mid T_n when nn is odd.

For even nn, observe that the only way a cyclic shift can produce a transposition is when kk is an odd multiple of n/2n/2, because we would need that i+k+k=ii + k + k = i. Therefore, the period of cycling is either n/2n/2 or nn, but fortunately both are divisible by n/2n/2, and so we are done.

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 reproduced verbatim; metadata (topic, difficulty) added by this project.