Browse · MathNet
PrintThe 35th Japanese Mathematical Olympiad
Japan counting and probability
Problem
Alice plays a game using a board with 20 rows and 25 columns. Initially, no number is written in any of the cells. The game proceeds in several turns, and on the -th turn, the following operation is performed: Choose a positive integer and empty cells such that for every integer with , the cell is adjacent to either to the right or above. Write the number in each of these cells. The game ends when all cells on the board are filled with some numbers. When Alice plays optimally to minimize the number of turns until the game ends, how many different possible numberings of the board can be obtained when the game ends? Note: Numberings that are identical under rotation or reflection are considered distinct and counted as different.
Solution
Let and be positive integers. We denote by the cell in the -th column from the left and the -th row from the bottom. For the cell , we define its height as . Note that the possible values for the height of a cell range from 1 to 44. For each integer , the sequence formed by the numbers written in the cells of height , listed from the upper-left to the lower-right, is called the level- sequence or level sequence of height .
In the operation, for the chosen cells , the height of is one more than that of for every . In particular, the following properties hold: (1) For every , the level- sequence contains no repeated numbers. (2) Let and be integers with , and let be a positive integer. If there are cells of height and with the number written in them, then for every integer with , there exists a cell of height that has the number written in it. (3) Let and be positive integers. If there exist cells of height and that both have the number written in them, then these two cells are adjacent.
Since there are 20 cells of height 20, Alice must perform at least 20 turns. Conversely, in the -th turn (), if Alice chooses and for , she can fill the entire board in exactly 20 turns. Therefore, the minimum number of turns is 20.
From now on, we consider the possible numberings when the game ends in exactly 20 turns. In this case, since only the numbers 1 through 20 are filled, by (1), the level-20 sequence must be a permutation of 1, 2, ..., 20.
Lemma 1. The level sequences of height 20, 21, ..., 25 are all identical. Proof. Since there are also 20 cells of each height 21, 22, 23, 24, and 25, by the same reason as in the case of height 20, the level sequences of height 20, 21, ..., 25 are all permutations of 1, 2, ..., 20. Let be the first term of the level-20 sequence. That is, is the number written in the cell . Then, by (3), the cell of height 21 in which is written must be . Let be the second term of the level-20 sequence. That is, is the number written in the cell . Then, by (3), the possible cells of height 21 where could be written are or . However, since is already written in , must be written in . Continuing this consideration, for every integer with , it turns out that the cell contains the -th term of the level-20 sequence. Therefore, the level-21 sequence is identical to the level-20 sequence. Similarly, the level sequences of heights 22, 23, 24, and 25 are also identical to it. ■
Lemma 2. For each integer , the level- sequence is equal to the sequence obtained from the level- sequence by deleting exactly one term while preserving the order. Proof. Suppose that appears in the level- sequence. Since the level-20 sequence is a permutation of , the number also appears in the level-20 sequence. Therefore, by (2), must also appear in the level- sequence. This shows that exactly one number appears in the level- sequence but not in the level- sequence. Let this number be the -th term of the level- sequence. Then, by applying the same argument in the proof of Lemma 1 in the order , we can show that for any integer with , the -th term of the level- sequence is equal to the -th term of the level- sequence. Similarly, by applying the same argument in the reverse order , we can show that for any integer with , the -th term of the level- sequence is equal to the -th term of the level- sequence, thus the lemma is proved. ■
Lemma 3. For each integer , the level- sequence is equal to the sequence obtained from the level- sequence by deleting exactly one term while preserving the order. Proof. The proof is similar to that of Lemma 2. ■
(i) The level sequences of height 20, 21, ..., 25 are all identical and are permutations of 1, 2, ..., 20. (ii) For every integer , the level- sequence is obtained from the level- sequence by deleting exactly one term while preserving the order. (iii) For every integer , the level- sequence is obtained from the level- sequence by deleting exactly one term while preserving the order.
Conversely, we will show that any numbering that satisfies the conditions (i), (ii), and (iii) can be realized as the final result of the game. Let be a numbering that satisfies (i), (ii), and (iii). Fix an integer with , and let be the minimum and the maximum of the heights in which the number appears in . From (i), we have and . From (ii) and (iii), it follows that for any , the level- sequence also contains the number exactly once. Suppose that appears in the -th term of the level- sequence. Then, by conditions (i), (ii), and (iii), for any , the -th cell in the level- sequence is either to the right or above the -th cell of the level- sequence. Therefore, in the -th turn, Alice can choose , and as the -th cell in the level- sequence for each , and in this case, the final numbering coincides with .
Hence, it is sufficient to count the numberings satisfying (i), (ii), and (iii). First, there are ways to fill the cells of heights 20, 21, ..., 25 satisfying (i). Fix one such filling. Then, the number of ways to fill the cells of heights 1, 2, ..., 19 satisfying (ii) is equal to the number of ways to successively remove one integer at a time from the set , which is . Similarly, the number of ways to fill the cells of heights 26, 27, ..., 44 satisfying (iii) is also . Therefore, the total number of possible final numberings is .
Final answer
20!^3
Techniques
Recursion, bijectionInvariants / monovariantsGames / greedy algorithms