Olympiad Maths Prep

Track / Stage 7 / 175 of 300 #1575 of 2000

Problem 1575

National olympiad second round; IMO P1/P4
Combinatorics Difficulty 7.3 Find the answer

Let Z0\mathbb{Z}_{\geqslant 0} be the set of non-negative integers, and let f:Z0×Z0Z0f: \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \rightarrow \mathbb{Z}_{\geqslant 0} be a bijection such that whenever f(x1,y1)>f(x2,y2)f\left(x_{1}, y_{1}\right)>f\left(x_{2}, y_{2}\right), we have f(x1+1,y1)>f(x2+1,y2)f\left(x_{1}+1, y_{1}\right)>f\left(x_{2}+1, y_{2}\right) and f(x1,y1+1)>f(x2+1,y2)f\left(x_{1}, y_{1}+1\right)>f\left(x_{2}+1, y_{2}\right). Let NN be the number of pairs of integers (x,y)(x, y), with 0x,y<1000 \leqslant x, y<100, such that f(x,y)f(x, y) is odd. Find the smallest and largest possible value of NN. Answer: The optimal bounds are 2500N75002500 \leqslant N \leqslant 7500.

Official solution

We defer the constructions to the end of the solution. Instead, we begin by characterizing all such functions f f , prove a formula and key property for such functions, and then solve the problem, providing constructions.

Characterization
Suppose f f satisfies the given relation. The condition can be written more strongly as
f(x1,y1)>f(x2,y2)f(x1+1,y1)>f(x2+1,y2)f(x1,y1+1)>f(x2,y2+1). \begin{aligned} f\left(x_{1}, y_{1}\right) > f\left(x_{2}, y_{2}\right) & \Longleftrightarrow f\left(x_{1}+1, y_{1}\right) > f\left(x_{2}+1, y_{2}\right) \\ & \Longleftrightarrow f\left(x_{1}, y_{1}+1\right) > f\left(x_{2}, y_{2}+1\right). \end{aligned}
In particular, this means for any (k,l)Z2,f(x+k,y+l)f(x,y)(k, l) \in \mathbb{Z}^{2}, f(x+k, y+l) - f(x, y) has the same sign for all xx and yy.

Call a non-zero vector (k,l)Z0×Z0(k, l) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} a needle if f(x+k,y)f(x,y+l)>0 f(x+k, y) - f(x, y+l) > 0 for all xx and yy. It is not hard to see that needles and non-needles are both closed under addition, and thus under scalar division (whenever the quotient lives in Z2\mathbb{Z}^{2}).

In addition, call a positive rational number kl\frac{k}{l} a grade if the vector (k,l)(k, l) is a needle. (Since needles are closed under scalar multiples and quotients, this is well-defined.)

Claim. Grades are closed upwards.
Proof. Consider positive rationals k1l1<k2l2\frac{k_1}{l_1} < \frac{k_2}{l_2}. We need to show that k2l2\frac{k_2}{l_2} is a grade. Since k1l1\frac{k_1}{l_1} is a grade, (k1,l1)(k_1, l_1) is a needle. Thus, f(x+k1,y)f(x,y+l1)>0f(x+k_1, y) - f(x, y+l_1) > 0 for all xx and yy. Since k1l1<k2l2\frac{k_1}{l_1} < \frac{k_2}{l_2}, there exists a positive integer nn such that k1l1<k2l2<k1+nl1\frac{k_1}{l_1} < \frac{k_2}{l_2} < \frac{k_1 + n}{l_1}. Therefore, (k2,l2)(k_2, l_2) is a needle, as wanted.

Claim. A grade exists.
Proof. If no positive integer nn is a grade, then f(1,0)>f(0,n)f(1, 0) > f(0, n) for all nn, which is impossible. Similarly, there is an nn such that f(0,1)>f(n,0)f(0, 1) > f(n, 0). Thus, a grade must exist.

Claim. If x1+y1α>x2+y2αx_1 + y_1 \alpha > x_2 + y_2 \alpha then f(x1,y1)>f(x2,y2)f(x_1, y_1) > f(x_2, y_2).
Proof. If both x1x2x_1 \geq x_2 and y1y2y_1 \geq y_2 this is clear. Suppose x1x2x_1 \geq x_2 and y1<y2y_1 < y_2. Then x1+y1α>x2+y2αx_1 + y_1 \alpha > x_2 + y_2 \alpha implies x1x2>(y2y1)αx_1 - x_2 > (y_2 - y_1) \alpha. Since α\alpha is a grade, (x1x2,y2y1)(x_1 - x_2, y_2 - y_1) is a needle. This gives f(x1,y1)>f(x2,y2)f(x_1, y_1) > f(x_2, y_2). Suppose x1<x2x_1 < x_2 and y1y2y_1 \geq y_2. Then x1+y1α>x2+y2αx_1 + y_1 \alpha > x_2 + y_2 \alpha implies (y1y2)α>x2x1(y_1 - y_2) \alpha > x_2 - x_1. Since α\alpha is a grade, (x2x1,y1y2)(x_2 - x_1, y_1 - y_2) is a needle. This gives f(x1,y1)>f(x2,y2)f(x_1, y_1) > f(x_2, y_2).

From this claim, we immediately get that 2500N75002500 \leq N \leq 7500; now we show that those bounds are indeed sharp.

Remember that if α\alpha is irrational then
f(a,b)=#{(x,y)Z0×Z0x+yα<a+bα}. f(a, b) = \#\{(x, y) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \mid x + y \alpha < a + b \alpha\}.

Construction for 7500
Select α199.999\alpha \approx 199.999.

Claim.
1. f(n,0)=nf(n, 0) = n for 0n1000 \leq n \leq 100.
2. f(0,k)kmod2f(0, k) \equiv k \quad \bmod 2 for 0k1000 \leq k \leq 100.

Proof.
1. f(n,0)=#{(x,y)x+yα<n}=#{(x,y)x+199y<n}=nf(n, 0) = \#\{(x, y) \mid x + y \alpha < n\} = \#\{(x, y) \mid x + 199 y < n\} = n.
2.
f(0,k)=#{(x,y)x+yα<kα}=l=0k1#{(x,l)x+lα<kα}=l=0k1#{xx<(kl)α}=l=0k1200(kl)1=200Ak \begin{aligned} & f(0, k) = \#\{(x, y) \mid x + y \alpha < k \alpha\} = \sum_{l=0}^{k-1} \#\{(x, l) \mid x + l \alpha < k \alpha\} \\ & = \sum_{l=0}^{k-1} \#\{x \mid x < (k - l) \alpha\} = \sum_{l=0}^{k-1} 200(k - l) - 1 = 200 A - k \end{aligned}
for some integer AA.

From this claim, using the equality f(x,y)+f(x+1,y+1)=f(x+1,y)+f(x,y+1)+1f(x, y) + f(x+1, y+1) = f(x+1, y) + f(x, y+1) + 1, we can prove that mod 2 the region AA looks like the following: in the rows (,2y)(- , 2y) the remainders modulo 2 alternate, while the rows (,2y+1)(- , 2y+1) contain only odd numbers.

!

The numbers mod 2 in the construction for 7500.

Construction for 2500
Select α200.001\alpha \approx 200.001.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.