In the plane the points with integer coordinates are the vertices of unit squares. The squares are coloured alternately black and white (as on a chessboard). For any pair of positive integers $ m$ and $ n$, consider a right-angled triangle whose vertices have integer coordinates and whose legs, of lengths $ m$ and $ n$, lie along edges of the squares. Let $ S_1$ be the total area of the black part of the triangle and $ S_2$ be the total area of the white part. Let $ f(m,n) = | S_1 - S_2 |$. a) Calculate $ f(m,n)$ for all positive integers $ m$ and $ n$ which are either both even or both odd. b) Prove that $ f(m,n) \leq \frac 12 \max \{m,n \}$ for all $ m$ and $ n$. c) Show that there is no constant $ C\in\mathbb{R}$ such that $ f(m,n) < C$ for all $ m$ and $ n$.
Problem
Source: IMO 1997, Problem 1, IMO Shortlist 1997, Q1
Tags: geometry, rectangle, combinatorics, counting, IMO, IMO 1997
21.10.2007 16:00
Valentin Vornicu wrote: In the plane the points with integer coordinates are the vertices of unit squares. The squares are coloured alternately black and white (as on a chessboard). For any pair of positive integers $ m$ and $ n$, consider a right-angled triangle whose vertices have integer coordinates and whose legs, of lengths $ m$ and $ n$, lie along edges of the squares. Let $ S_1$ be the total area of the black part of the triangle and $ S_2$ be the total area of the white part. Let $ f(m,n) = | S_1 - S_2 |$. a) Calculate $ f(m,n)$ for all positive integers $ m$ and $ n$ which are either both even or both odd. b) Prove that $ f(m,n) \leq \frac 12 \max \{m,n \}$ for all $ m$ and $ n$. c) Show that there is no constant $ C\in\mathbb{R}$ such that $ f(m,n) < C$ for all $ m$ and $ n$. (a) If m and n are both even, then f(m,n) = 0. Let M be the midpoint of the hypoteneuse. The critical point is that M is a lattice point. If we rotate the triangle through 180 to give the other half of the rectangle, we find that its coloring is the same. Hence $ S_1$ and $ S_2$ for the triangle are each half their values for the rectangle. But the values for the rectangle are equal, so they must also be equal for the triangle and hence $ f(m,n) = 0$. If m and n are both odd, then the midpoint of the hypoteneuse is the center of a square and we may still find that the coloring of the two halves of the rectangle is the same. This time S1 and S2 differ by one for the rectangle, so $ f(m,n) = \frac{1}{2}$. (b) The result is immediate from (a) for m and n of the same parity. The argument in (a) fails for m and n with opposite parity, because the two halves of the rectangle are oppositely colored. Let m be the odd side. Then if we extend the side length m by 1 we form a new triangle which contains the original triangle. But it has both sides even and hence $ S_1 = S_2$. The area added is a triangle base 1 and height n, so area n/2. The worst case would be that all this area was the same color, in which case we would get $ f(m,n) = \frac{n}{2}$. But $ n \leq max(m,n)$, so this establishes the result. (c) Intuitively, it is clear that if the hypoteneuse runs along the diagonal of a series of black squares, and we then extend one side, the extra area taken in will be mainly black. We need to make this rigorous. For the diagonal to run along the diagonal of black squares we must have n = m. It is easier to work out the white area added by extending a side. The white area takes the form of a series of triangles each similar to the new n+1 x n triangle. The biggest has sides 1 and $ \frac{n}{n+1}$. The next biggest has sides $ \frac{n-1}{n}$ and $ \frac{n-1}{n+1}$, the next biggest $ \frac{n-2}{n}$ and $ \frac{n-2}{n+1}$ and so on, down to the smallest which is $ \frac{1}{n}$ by $ \frac{1}{n+1}$. Hence the additional white area is 1/2 (n/(n+1) + (n-1)2/(n(n+1)) + (n-2)2/(n(n+1)) + ... + 1/(n(n+1)) ) = 1/(2n(n+1)) (n^2 + ... + 1^2) = (2n+1)/12. Hence the additional black area is n/2 - (2n+1)/12 = n/3 - 1/12 and the black excess in the additional area is n/6 - 1/6. If n is even, then f(n,n) = 0 for the original area, so for the new triangle $ f(n+1,n) = \frac{n-1}{6}$ which is unbounded
29.09.2010 18:19
for part $c$ the triangle with lenghts $2^k$ and $2^{k-1}$ also works.
18.02.2023 05:30
Solution from Twitch Solves ISL: In general, we say the discrepancy of a region in the plane equals its black area minus its white area. We allow negative discrepancies, so discrepancy is additive and $f(m,n)$ equals the absolute value of the discrepancy of a right triangle with legs $m$ and $n$. For (a), the answers are $0$ and $1/2$ respectively. To see this, consider the figure shown below. [asy][asy] size(8cm); pair A = (0,5); pair B = (9,0); pair M = midpoint(A--B); for (int i=0; i<=5; ++i) { draw( (0,i)--(9,i), grey ); } for (int j=0; j<=9; ++j) { draw( (j,0)--(j,5), grey ); } dot("$M$", M, dir(50)); dot("$A$", A, dir(90)); dot("$B$", B, dir(0)); dot("$C$", (0,0), dir(180)); filldraw(A--B--(0,0)--cycle, invisible, black+1.5); pair P = (0,2.5); pair Q = (9,2.5); dot("$P$", P, dir(180)); dot("$Q$", Q, dir(0)); draw(P--Q--B, blue+1.5); [/asy][/asy] Notice that triangles $APM$ and $BQM$ are congruent, and when $m \equiv n \pmod 2$, their colorings actually coincide. Consequently, the discrepancy of the triangle is exactly equal to the discrepancy of $CPQB$, which is an $m \times n/2$ rectangle and hence equal to $0$ or $1/2$ according to parity. For (b), note that a triangle with legs $m$ and $n$, with $m$ even and $n$ odd, can be dissected into one right triangle with legs $m$ and $n-1$ plus a thin triangle of area $1/2$ which has height $m$ and base $1$. The former region has discrepancy $0$ by (a), and the latter region obviously has discrepancy at most its area of $m/2$, hence $f(m,n) \le m/2$ as needed. (An alternative slower approach, which requires a few cases, is to prove that two adjacent columns have at most discrepancy $1/2$.) For (c), we prove: Claim: For each $k \ge 1$, we have \[ f(2k, 2k+1) = \frac{2k-1}{6}. \]Proof. An illustration for $k=2$ is shown below, where we use $(0,0)$, $(0,2k)$, $(2k+1,0)$ as the three vertices. [asy][asy] size(8cm); fill( (0,4)--(5,0)--(5,4)--cycle, palered ); draw(box( (0,0), (5,4) ), black); fill( (0,3)--(1,3)--(1,3.2)--(0,4)--cycle, grey); fill( (1,2)--(2,2)--(2,2.4)--(1.25,3)--(1,3)--cycle, grey); fill( (2,1)--(3,1)--(3,1.6)--(2.50,2)--(2,2)--cycle, grey); fill( (3,0)--(4,0)--(4,0.8)--(3.75,1)--(3,1)--cycle, grey); fill(shift(1,0)*unitsquare, grey); fill(shift(0,1)*unitsquare, grey); for (int i=1; i<4; ++i) { draw( (0,i)--(5,i), grey ); } for (int i=1; i<5; ++i) { draw( (i,0)--(i,4), grey ); } draw( (0,4)--(5,0)--(0,0)--cycle, blue+2 ); [/asy][/asy] WLOG, the upper-left square is black, as above. The $2k$ small white triangles just below the diagonal have area sum \[ \frac12 \cdot \frac{1}{2k+1} \cdot \frac{1}{2k} \left[ 1^2 + 2^2 + \dots + (2k)^2 \right] = \frac{4k+1}{12} \]The area of the $2k$ black polygons sums just below the diagonal to \[ \sum_{i=1}^{2k} \left( 1 - \frac12 \cdot \frac{1}{2k+1} \cdot \frac{1}{2k} \cdot i^2 \right) = 2k - \frac{4k+1}{12} = \frac{20k-1}{12}. \]Finally, in the remaining $1+2+\dots+2k$ squares, there are $k$ more white squares than black squares. So, it follows \[ f(2k, 2k+1) = \left\lvert -k + \frac{20k-1}{12} - \frac{4k+1}{12} \right\rvert = \frac{2k-1}{6}. \]$\blacksquare$
22.08.2024 12:14
What is the formula of this function $f(n,m)$??? I think there is a double integral in..