A grid made up of squares is given. Suppose you want to distribute distinct positive integers chosen from the integers greater than or equal to and less than or equal to into square boxes of the grid. How many distinct ways of distributing the numbers are there if for any pair of boxes sharing a side the difference of the numbers inserted must be or less? Even when the two configurations of the result of distribution coincide under a rotation or flipping over, regard the configurations distinct.
, 2019
Solution
ways
From the grid of squares, we pick a four squares to fill in with numbers. Let as in the diagram (a) below , , , be the numbers inserted into the squares. Then, we see that the difference between and is or less. In fact, since both and are no more than , must be less than or equal to . If , we must have . For the same reason, we must have , but this violates the requirement that the numbers written into the boxes must be distinct. Consequently, we must have .
In view of the facts obtained above, we see that if we insert a number less than or equal to into the center square of the given grid, then the number cannot be inserted anywhere. Also, if we insert any number greater than or equal to into the center square, there will be no square to insert . Consequently, the number which can be inserted into the center square of the grid must be one of , , .
Let us first consider the case where is the one to be inserted into the center square. Then cannot be inserted into any of the squares sharing a side with the center square. So, has to be inserted into one of the squares at four corners. By rotating the diagram, if necessary, we may insert into the square located at the right lower corner. Then, we see that among the squares located at the lower right corner, the remaining two empty squares must be filled by , . So, by considering the operation of flipping over, if necessary, we may conclude that we need to consider only the allocation of numbers shown in the diagram (b). If we then let , then we see that is the only number qualified to be chosen as .
and , so the choice of is inappropriate. Since the number at the center is , we see that , . And if , then becomes only number to go into both and , it is necessary to let . Then, becomes the only possibility and , , will be determined uniquely in this order. Thus, we conclude that the method of allocation indicated in the diagram (c) is the only possibility. It is easy to check that this allocation of numbers does satisfy all the requirements of the problem.
Thus, we conclude that the methods of allocation with the center number can be obtained by considering rotations and flipping over of the allocation (c), and therefore there are ways to satisfy the conditions of the problem with the center number . Considering symmetry, we can also conclude that there are also ways of allocating numbers to satisfy the conditions of the problem with the center number .
| a | b |
|---|---|
| c | d |
| e | f | g |
|---|---|---|
| h | 4 | 6 |
| i | 7 | 9 |
| 2 | 1 | 3 |
|---|---|---|
| 5 | 4 | 6 |
| 8 | 7 | 9 |
| 1 | j | k |
|---|---|---|
| l | 5 | m |
| n | o | 9 |
| 1 | 2 | 3 |
|---|---|---|
| 4 | 5 | 6 |
| 7 | 8 | 9 |
| 1 | 2 | 4 |
|---|---|---|
| 3 | 5 | 7 |
| 6 | 8 | 9 |
Next, we consider the case where is the number to go into the center square. Then both and cannot be written into the squares sharing a side with the center square, and therefore, they have to be written into one of the four corner squares. By considering a rotation, if necessary, we may put into the upper left corner square. If we put into the upper-right or the lower-left corner square, then it becomes impossible to insert numbers into squares lying in between the squares occupied by and , so the only possibility is to put into the lower-right corner square.
Consequently, it is enough to consider which of the remaining numbers should be put into the squares , , , , , in the diagram (d). We note that the numbers that , can take have to be chosen from , , , and the numbers that , can take have to be chosen from , , . Consequently, one of , has to be assigned with a number, which is less than or equal to , and the other has to be assigned with a number greater than or equal to . So, we may assume, without loss of generality that is assigned with a number or less, and is assigned with a number or more.
Since the squares to which the numbers , are assigned share a side with square with numbers greater than or equal to , we conclude that is the only possibility, and similarly, we can conclude that is the only possibility. When , , , are determined one by one in this order to obtain the result shown in (e). When , , , are determined in this order to obtain the result shown in (f).
From each of these allocation of numbers (e) and (f), we can obtain ways to get the allocation of numbers via rotation and flipping over. Therefore, there are ways of allocating numbers to satisfy the conditions of the problem with the center number . Thus, the desired answer for the problem is .