Browse · MathNet
PrintIMO 2019 Shortlisted Problems
2019 counting and probability
Problem
Alice has a map of Wonderland, a country consisting of 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 questions.
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 questions.
Solution
We will show Alice needs to ask at most questions. Her strategy has the following phases. In what follows, is the set of towns that Alice, so far, does not know to have more than one outgoing road (so initially ).
Phase 1. Alice chooses any two towns, say and . Without loss of generality, suppose that the King of Hearts' answer is that the road goes from to . At the end of this phase, Alice has asked 1 question.
Phase 2. During this phase there is a single (variable) town that is known to have at least one incoming road but not yet known to have any outgoing roads. Initially, is . Alice does the following times: she picks a town she has not asked about before, and asks the direction of the road between and . If it is from to is unchanged; if it is from to becomes the new choice of town , as the previous is now known to have an outgoing road. At the end of this phase, Alice has asked a total of questions. The final town 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 and another town she has not previously asked about, stopping if she finds two outgoing roads from . This phase involves at most questions. If she does not find two outgoing roads from , she has answered her original question with at most questions, so in what follows we suppose that she does find two outgoing roads, asking a total of questions in this phase, where (and thus for what follows). For every question where the road goes towards , the town at the other end is removed from (as it already had one outgoing road known), while the last question resulted in being removed from . So at the end of this phase, , while a total of questions have been asked. Furthermore, the undirected graph of roads within whose directions are known contains no cycles (as is no longer a member of , all questions asked in this phase involved and the graph was a tree before this phase started). Every town in has exactly one outgoing road known (not necessarily to another town in ).
Phase 4. During this phase, Alice repeatedly picks any pair of towns in for which she does not know the direction of the road between them. Because every town in has exactly one outgoing road known, this always results in the removal of one of those two towns from . Because there are no cycles in the graph of roads of known direction within , this can continue until there are at most 2 towns left in . If it ends with towns left, questions were asked in this phase, so a total of questions have been asked.
Phase 5. During this phase, Alice asks about all the roads from the remaining towns in that she has not previously asked about. She has definitely already asked about any road between those towns (if ). 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 vertices). So she asks at most questions in this phase. At the end of this phase, Alice knows whether any town has at most one outgoing road. If , at most questions were needed in total, while if , at most questions were needed in total.
Phase 1. Alice chooses any two towns, say and . Without loss of generality, suppose that the King of Hearts' answer is that the road goes from to . At the end of this phase, Alice has asked 1 question.
Phase 2. During this phase there is a single (variable) town that is known to have at least one incoming road but not yet known to have any outgoing roads. Initially, is . Alice does the following times: she picks a town she has not asked about before, and asks the direction of the road between and . If it is from to is unchanged; if it is from to becomes the new choice of town , as the previous is now known to have an outgoing road. At the end of this phase, Alice has asked a total of questions. The final town 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 and another town she has not previously asked about, stopping if she finds two outgoing roads from . This phase involves at most questions. If she does not find two outgoing roads from , she has answered her original question with at most questions, so in what follows we suppose that she does find two outgoing roads, asking a total of questions in this phase, where (and thus for what follows). For every question where the road goes towards , the town at the other end is removed from (as it already had one outgoing road known), while the last question resulted in being removed from . So at the end of this phase, , while a total of questions have been asked. Furthermore, the undirected graph of roads within whose directions are known contains no cycles (as is no longer a member of , all questions asked in this phase involved and the graph was a tree before this phase started). Every town in has exactly one outgoing road known (not necessarily to another town in ).
Phase 4. During this phase, Alice repeatedly picks any pair of towns in for which she does not know the direction of the road between them. Because every town in has exactly one outgoing road known, this always results in the removal of one of those two towns from . Because there are no cycles in the graph of roads of known direction within , this can continue until there are at most 2 towns left in . If it ends with towns left, questions were asked in this phase, so a total of questions have been asked.
Phase 5. During this phase, Alice asks about all the roads from the remaining towns in that she has not previously asked about. She has definitely already asked about any road between those towns (if ). 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 vertices). So she asks at most questions in this phase. At the end of this phase, Alice knows whether any town has at most one outgoing road. If , at most questions were needed in total, while if , at most questions were needed in total.
Techniques
Graph TheoryInvariants / monovariantsGames / greedy algorithms