cmi-entrance 2022 QB2
11 marks
View
[11 points] In the XY plane, draw horizontal and vertical lines through each integer on both axes so as to get a grid of small $1 \times 1$ squares whose vertices have integer coordinates.
(i) Consider the line segment $D$ joining $(0,0)$ with $(m,n)$. Find the number of small $1 \times 1$ squares that $D$ cuts through, i.e., squares whose interiors $D$ intersects. (Interiors consist of points for which both coordinates are non-integers.) For example, the line segment joining $(0,0)$ and $(2,3)$ cuts through 4 small squares, as you can check by drawing.
(ii) Now $L$ is allowed to be an arbitrary line in the plane. Find the maximum number of small $1 \times 1$ squares in an $n \times n$ grid that $L$ can cut through, i.e., we want $L$ to intersect the interiors of maximum possible number of small squares inside the square with vertices $(0,0)$, $(n,0)$, $(0,n)$ and $(n,n)$.