For positive integers $m,n \geq 2$, let $S_{m,n} = \{(i,j): i \in \{1,2,\ldots,m\}, j\in \{1,2,\ldots,n\}\}$ be a grid of $mn$ lattice points on the coordinate plane. Determine all pairs $(m,n)$ for which there exists a simple polygon $P$ with vertices in $S_{m,n}$ such that all points in $S_{m,n}$ are on the boundary of $P$, all interior angles of $P$ are either $90^{\circ}$ or $270^{\circ}$ and all side lengths of $P$ are $1$ or $3$.
Problem
Source: RMM Shortlist 2023 C2
Tags: grid, colouring, paths, right angle, combinatorics, RMM Shortlist
02.03.2024 23:28
We claim the answer is (2,2) and all even pairs for which 4 divides at least one of the two numbers. The proof is very visual so I attach an image, labeling each part of the proof in the order A-I: A: All of the 4 edges of the grid only consist of sides containing 2 or 4 points, so of course each side of the grid must have an even number of points, meaning m and n must be even. B: Constructions for (2,2), (4,2), and (2,4). It is also immediately clear no other solutions for m=2 or n=2 exist. C: General construction when m and n are both even, at least 4, and 4 divides at least one of them. Now all that is left is to prove is that when m and n are both 2 mod 4 and at least 6, there is no polygon P that works (the much harder part of the problem). D: Instead of looking at P as a polygon, look at it as a wire -> Imagine traveling along the loop counterclockwise, each "movement" we make is of length 1 or 3 in one of the cardinal directions. Notice how, if we checkerboard the grid with topleft square white, each vertical movement we make ends on a black square, and each horizontal movement we make ends on a white square. This makes sense since every movement we make flips what color square we are on, and naturally we have to alternate between horizontal and vertical movements. We must enter the topleft square with a left movement ending on a white square, and thus every horizontal movement ends on a white square and every vertical movement ends on a black square. E: If we have two different parts of the path right next to each other (without any squares in between), they must flow in opposite directions. In the diagram shown, we have two different parts of the path moving in the same direction-notice how there must be a path from $a_1$ to $a_2$ and a path from $b_1$ to $b_2$ but clearly there is no way to do this without at least one of these two paths going in between the 2 already drawn paths, contradicting with the fact that we specifically said these two paths don't have any squares between them and thus no path can travel between them. F: The key claim of the problem, that if we have a horizontal side of length 3, the horizontal movements we make must always alternate between going left and right (in other words are movements go up/down, left, up/down, right, up/down, left, ...). The proof goes like this: -WLOG say this movement of length 3 is moving right, and immediately after we move down. Note that this down movement must have length 1, and we must move left after that, otherwise the path flowing through that downleft square will also be moving right, which is flowing in the same direction, contradiction with E. -Until we make a movement of length 3 again, We are actually stuck going down 1 left 1 down 1 right 1 down 1 left 1 ... This is because if at any point we decide to veer off this path, for example in the drawn diagram down 1 right 1 down 1 RIGHT 1 then the square we didn't move into will now flow in the same direction which is a contradiction with E. -If our next movement of length 3 is vertical, this immediately leads to a contradiction as similar to before we get two touching paths moving in the same direction, contradiction with E. -Thus our next movement of length 3 is also horizontal, meaning we can then repeat the previous steps with this new length 3 horizontal movement to show that we can never escape constantly alternating right left right left with our horizontal movements in this path. G: Now notice if there is a horizontal movement of length 3 and a vertical movement of length 3, the path has to follow the movement up left down right up left down right (assuming we are traveling counterclockwise) and the only non-intersecting polygon that constantly turns counterclockwise 90 degrees like this is just a rectangle, which leads to a contradiction (assuming m and n at least 6) H: Now we can prove m, n 2 mod 4 and both at least 6 never works. Start in the topleft corner of the grid. Either the left movement into the corner or the down movement out of that corner must be of length 3 (if both of them are of length 1 we just get a 2x2 vertex square loop which obviously won't work), WLOG say the left movement into the corner is of length 3. Now look at the top edge of the grid. The leftmost side on this top edge has length 3, as I just said. Then, keep going along all the sides on that top edge until we reach the first side that has length 1 (since both dimensions of the grid are 2 mod 6, this side must exist). The previous side has length 3. Focus on these two sides, the one of length 3 followed by the one of length 1. I: There are only two possibilities for how the left corner of the side of length 1 can be extended: either left into the side of length 3, which causes 2 touching paths moving in the same direction, contradiction with E, or down to form a vertical side of length 3, but then there is a horizontal and a vertical side of length 3, contradiction with G. Thus polygon P cannot be constructed. Thus the answer is (2,2) and all even pairs for which 4 divides at least one of the two numbers.
Attachments:

03.03.2024 08:14
My problem! I have attached my original proposal with the solution. Some quick words about the origin of this problem:
Attachments:
1-3-polygon.pdf (149kb)