Maths Olympiad Prep

Library / Berkeley Math Circle /92 of 98

Berkeley Math Circle

Combinatorics Difficulty 5.7 AIME, harder Prove it United States

Problem:

Mathlandia has 20222022 cities. Show that the number of ways to construct 20212021 roads connecting pairs of cities such that it is possible to get between any two cities, there are no loops, and each city has exactly one or three roads coming out of it is given by
2022!⋅2019!!1012! \frac{2022 ! \cdot 2019 !!}{1012 !}
(The notation 2019!!2019!! means 2019⋅2017⋅⋯⋅3⋅12019 \cdot 2017 \cdot \cdots \cdot 3 \cdot 1.)

Solution

Solution:

If we consider the cities to be vertices and the roads to be edges, this arrangement is a type of graph known as a trivalent tree. We will find a general formula in terms of nn for the number of trivalent trees on 2n2n vertices.

We can construct such a tree as follows. First, we will choose the internal vertices (non-leaves) of TT. If there are ii internal vertices, then summing the degrees over all vertices we get
2⋅(# of edges)=2⋅(2n−1)=i⋅3+(2n−i)⋅1=2i+2n. 2 \cdot (\# \text{ of edges}) = 2 \cdot (2n-1) = i \cdot 3 + (2n-i) \cdot 1 = 2i + 2n.
Solving for ii gives i=n−1i = n-1, so there are (2nn−1)\left(\begin{array}{c}2n \\ n-1\end{array}\right) ways to choose the internal vertices. Now imagine attaching two edges to each of these n−1n-1 vertices (with the other endpoint of each edge not yet chosen). This is 2n−22n-2 edges total, so all but one edge of the graph. We can think of the other endpoint of each edge as a position that needs to be filled, so at the start there are 2n−22n-2 available positions. Now, go through the leaves in increasing order, and for each leaf, choose an edge to attach it to. The number of available edges starts at 2n−22n-2 and goes down by one at each step as one position gets taken, so the number of ways to do this is (2n−2)(2n−3)…(n−2)(2n-2)(2n-3) \ldots (n-2). After all the leaves are added, there must be at least one internal vertex both of whose edges are filled, since there are n−1n-1 internal vertices and only n−3n-3 unfilled edges left. Find the smallest such vertex, and choose an open edge to attach it to, which can be done in n−3n-3 ways. Now that vertex has all three of its neighbors chosen.

After that, there are n−2n-2 remaining internal vertices and n−4n-4 available edges, all of which are attached to one of those vertices. So again, there must be a vertex both of whose edges are filled, so we can take the smallest such vertex and choose any of the n−4n-4 edges to attach it to. We can continue this process until every internal vertex except for two of them has three edges, and at that point, we must add the final edge between those two vertices.

After this process is complete, we have a trivalent tree, but each such tree has been counted 2n−12^{n-1} times, because we considered the two edges coming out of each internal vertex to be distinct, when actually they should not be. Thus, we must divide by 2n−12^{n-1}, implying that the total number of trivalent trees is
(2nn−1)⋅(2n−2)(2n−3)⋅…⋅2⋅12n−1=(2n)!(n+1)!(2n−3)!! \left(\begin{array}{c} 2n \\ n-1 \end{array}\right) \cdot \frac{(2n-2)(2n-3) \cdot \ldots \cdot 2 \cdot 1}{2^{n-1}} = \frac{(2n)!}{(n+1)!}(2n-3)!!
Plugging in n=1011n=1011 gives the desired expression.

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

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.