Maths Olympiad Prep

Track / Stage 7 / 259 of 300 #1659 of 1964

Problem 1659

National olympiad second round; IMO P1/P4
Combinatorics Difficulty 7.6 Prove it

Alice has a map of Wonderland, a country consisting of n2n \geqslant 2 towns. For every pair of towns, there is a narrow road going from one town to the other. One day, all the roads are declared to be "one way" only. Alice has no information on the direction of the roads, but the King of Hearts has offered to help her. She is allowed to ask him a number of questions. For each question in turn, Alice chooses a pair of towns and the King of Hearts tells her the direction of the road connecting those two towns. Alice wants to know whether there is at least one town in Wonderland with at most one outgoing road. Prove that she can always find out by asking at most 4n4 n questions.

Comment. This problem could be posed with an explicit statement about points being awarded for weaker bounds cnc n for some c>4c>4, in the style of IMO 2014 Problem 6. (Thailand)

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Official solution

We will show Alice needs to ask at most 4n74 n-7 questions. Her strategy has the following phases. In what follows, SS is the set of towns that Alice, so far, does not know to have more than one outgoing road (so initially S=n|S|=n). Phase 1. Alice chooses any two towns, say AA and BB. Without loss of generality, suppose that the King of Hearts' answer is that the road goes from AA to BB. At the end of this phase, Alice has asked 1 question. Phase 2. During this phase there is a single (variable) town TT that is known to have at least one incoming road but not yet known to have any outgoing roads. Initially, TT is BB. Alice does the following n2n-2 times: she picks a town XX she has not asked about before, and asks the direction of the road between TT and XX. If it is from XX to T,TT, T is unchanged; if it is from TT to X,XX, X becomes the new choice of town TT, as the previous TT is now known to have an outgoing road. At the end of this phase, Alice has asked a total of n1n-1 questions. The final town TT is not yet known to have any outgoing roads, while every other town has exactly one outgoing road known. The undirected graph of roads whose directions are known is a tree. Phase 3. During this phase, Alice asks about the directions of all roads between TT and another town she has not previously asked about, stopping if she finds two outgoing roads from TT. This phase involves at most n2n-2 questions. If she does not find two outgoing roads from TT, she has answered her original question with at most 2n34n72 n-3 \leqslant 4 n-7 questions, so in what follows we suppose that she does find two outgoing roads, asking a total of kk questions in this phase, where 2kn22 \leqslant k \leqslant n-2 (and thus n4n \geqslant 4 for what follows). For every question where the road goes towards TT, the town at the other end is removed from SS (as it already had one outgoing road known), while the last question resulted in TT being removed from SS. So at the end of this phase, S=nk+1|S|=n-k+1, while a total of n+k1n+k-1 questions have been asked. Furthermore, the undirected graph of roads within SS whose directions are known contains no cycles (as TT is no longer a member of SS, all questions asked in this phase involved TT and the graph was a tree before this phase started). Every town in SS has exactly one outgoing road known (not necessarily to another town in SS). Phase 4. During this phase, Alice repeatedly picks any pair of towns in SS for which she does not know the direction of the road between them. Because every town in SS has exactly one outgoing road known, this always results in the removal of one of those two towns from SS. Because there are no cycles in the graph of roads of known direction within SS, this can continue until there are at most 2 towns left in SS. If it ends with tt towns left, nk+1tn-k+1-t questions were asked in this phase, so a total of 2nt2 n-t questions have been asked. Phase 5. During this phase, Alice asks about all the roads from the remaining towns in SS that she has not previously asked about. She has definitely already asked about any road between those towns (if t=2t=2). She must also have asked in one of the first two phases about at least one other road involving one of those towns (as those phases resulted in a tree with n>2n>2 vertices). So she asks at most t(nt)1t(n-t)-1 questions in this phase. At the end of this phase, Alice knows whether any town has at most one outgoing road. If t=1t=1, at most 3n34n73 n-3 \leqslant 4 n-7 questions were needed in total, while if t=2t=2, at most 4n74 n-7 questions were needed in total. Comment 1. The version of this problem originally submitted asked only for an upper bound of 5n5 n, which is much simpler to prove. The Problem Selection Committee preferred a version with an asymptotically optimal constant. In the following comment, we will show that the constant is optimal. Comment 2. We will show that Alice cannot always find out by asking at most 4n3(log2n)4 n-3\left(\log _{2} n\right)- 15 questions, if n8n \geqslant 8. To show this, we suppose the King of Hearts is choosing the directions as he goes along, only picking the direction of a road when Alice asks about it for the first time. We provide a strategy for the King of Hearts that ensures that, after the given number of questions, the map is still consistent both with the existence of a town with at most one outgoing road, and with the nonexistence of such a town. His strategy has the following phases. When describing how the King of Hearts' answer to a question is determined below, we always assume he is being asked about a road for the first time (otherwise, he just repeats his previous answer for that road). This strategy is described throughout in graph-theoretic terms (vertices and edges rather than towns and roads). Phase 1. In this phase, we consider the undirected graph formed by edges whose directions are known. The phase terminates when there are exactly 8 connected components whose undirected graphs are trees. The following invariant is maintained: in a component with kk vertices whose undirected graph is a tree, every vertex has at most [log2k\left[\log _{2} k\right\rfloor edges into it. - If the King of Hearts is asked about an edge between two vertices in the same component, or about an edge between two components at least one of which is not a tree, he chooses any direction for that edge arbitrarily. - If he is asked about an edge between a vertex in component AA that has aa vertices and is a tree and a vertex in component BB that has bb vertices and is a tree, suppose without loss of generality that aba \geqslant b. He then chooses the edge to go from AA to BB. In this case, the new number of edges into any vertex is at most max{log2a,log2b+1}log2(a+b)\max \left\{\left\lfloor\log _{2} a\right\rfloor,\left\lfloor\log _{2} b\right\rfloor+1\right\} \leqslant\left\lfloor\log _{2}(a+b)\right\rfloor. In all cases, the invariant is preserved, and the number of tree components either remains unchanged or goes down by 1. Assuming Alice does not repeat questions, the process must eventually terminate with 8 tree components, and at least

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