Unfriendly neighbours

Find the greatest positive integer N N , such that for any arrangement of the positive integers 1 , 2 , 3 , , 1600 1, 2, 3, \ldots , 1600 in a 40 × 40 40 \times 40 table, there exists two numbers located in the same row or in the same column such that the (positive) difference of these numbers is not less than N N .


The answer is 819.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Tan Wee Kean
Sep 17, 2014

Consider the numbers 1 to 381 \color{#20A900}{\text{1 to 381}} and 1200 to 1600 \color{#20A900}{\text{1200 to 1600}} .

The numbers 1 to 381 \color{#20A900}{\text{1 to 381}} must be in at least 20 roles while the numbers 1200 to 1600 \color{#20A900}{\text{1200 to 1600}} must be in at least 21 roles. So, one of the numbers from 1 to 381 \color{#20A900}{\text{1 to 381}} must be in the same role as one of the numbers 1200 to 1600 \color{#20A900}{\text{1200 to 1600}} .

1200-381=819. \color{#20A900}{\text{1200-381=819.}}

But we are not done.

To show 819 is possible, imagine that the 40 by 40 square is cut along the middle vertical line into 2 20 by 40 rectangles. Then, in one of the 20 by 40 rectangles, place the numbers 1 to 800 \color{#D61F06}{\text{1 to 800}} in order. I.e. first row is 1,2,3,...20. Second row is 21,22,...40.

Then, in the other 20 by 40 rectangle, place the number 801 to 1600 \color{#D61F06}{\text{801 to 1600}} in a similar way.

Then the 40 by 40 rectangle would be:

1st row: 1,2,...,20,800,801,802,803,...820

2nd row: 21.22.23... 821,822,...840

Since the maximum and minimum number both increases by 20, the maximum difference for each row is 819.

1st column: 1,21,41,61...781

2nd column: 2,22,42,62...782

21st column: 801,821,841,...1581

22nd column: 802,822,842,...1582

Here, since the maximum and minimum value increases by 1. the maximum difference for each column is 781-1=780.

And thus 819 is possible and the maximum value of N.

How did you get the number 381?

Wanchun Shen - 6 years, 8 months ago

Log in to reply

In general, for any 4 n 2 , 4n^2, considering the numbers n 2 n + 1 n^2-n+1 and 3 n 2 n + 1 3n^2-n+1 does the job. This is not too hard to motivate by looking at small cases.

Sreejato Bhattacharya - 6 years, 8 months ago

For a set of integers S { 1 , 2 , , 1600 } , S \subset \{1, 2, \cdots , 1600\}, let r ( S ) , c ( S ) r(S), c(S) be the smallest integers r ( S ) r(S) and c ( S ) c(S) such that all numbers in S S appear a r ( S ) × c ( S ) r(S) \times c(S) subgrid. Notice that a total of r ( S ) c ( S ) r(S)c(S) numbers appear in those r ( S ) r(S) rows and c ( S ) c(S) columns, so r ( S ) c ( S ) S r ( S ) + c ( S ) 2 S . r(S)c(S) \geq |S| \implies r(S) + c(S) \geq 2 \sqrt{|S|}. Let S 1 = { 1 , 2 , , 381 } . S_1= \{1, 2, \cdots , 381\}. It's easy to verify that

( 39 2 ) 2 < S 1 39 < 2 S 1 r ( S 1 ) + c ( S 1 ) > 39 r ( S 1 ) + c ( S 1 ) 40. \left( \dfrac{39}{2} \right) ^2 < |S_1| \implies 39 < 2 \sqrt{|S_1|} \implies r(S_1) + c(S_1) > 39 \\ \implies r(S_1) + c(S_1) \geq 40.

Let S 2 = { 1200 , 1201 , , 1600 } . S_2= \{1200, 1201, \cdots , 1600\}. Notice that S 2 = 401 > 400 2 S 2 > 40 r ( S 2 ) + c ( S 2 ) > 40. |S_2| = 401 > 400 \implies 2|S_2| > 40 \implies r(S_2) + c(S_2) > 40. Combining them, we find out that r ( S 1 ) + r ( S 2 ) + c ( S 1 ) + c ( S 2 ) > 80. r(S_1) + r(S_2) + c(S_1) + c(S_2) > 80. Hence, max { r ( S 1 ) + r ( S 2 ) , c ( S 1 ) + c ( S 2 ) } > 40. \max \{r(S_1) + r(S_2), c(S_1) + c(S_2)\} > 40. WLOG assume r ( S 1 ) + r ( S 2 ) > 40 r(S_1) + r(S_2) > 40 (otherwise flip the board by 9 0 90^{\circ} ).

Since r ( S 1 ) + r ( S 2 ) r(S_1) + r(S_2) exceeds the total number of rows, some of these rows must overlap, so there must exist a a S 1 a \in S_1 and b S 2 b \in S_2 in the same row. But, the minimum of b a b-a is 1200 381 = 819 , 1200- 381 = 819, so there must exist two numbers in the same row differing by at least 819 819 .

Consider a board where the i th i^{\text{th}} row and j th j^{\text{th}} column has the number 20 ( i 1 ) + j 20(i-1)+j written on it if j 20 j \leq 20 and 720 + 20 i + j 720 + 20i + j if j > 20 j>20 . It is easy to see that this construction ensures that the difference between any two numbers doesn't exceed 819 819 .

Hence, our answer is 819 . \boxed{819}.

Lu Chee Ket
Jan 6, 2015

Got what the question asked for, here is the formula:

T (n+2) = T (n) + 2 n + 3 where T (0) = 2, {T (1) = 0}

T (40) = 819.

Answer wanted is 819.

Lu, I was just about to reply to your email. I'm glad you figured it out. Do you still think that the phrasing is unclear? If so, do you have any suggestions for how to improve it?

Also, I do not think that an induction approach would work for this problem. Could you explain how you did it?

Calvin Lin Staff - 6 years, 5 months ago

Log in to reply

Calvin, many times I found needs to ask a question before answering. Unless the question was purposely set to utilize trials, I found ambiguities which were strictly affecting our answers. To convert long analysis into short, let me just suggest that 'there exists' to be changed into 'there must be'.

I quoted 'greatest', 'any', 'there exists', 'not less than' to consider with 'greatest possible', 'any once', 'there valid with possibility' and 'greater than or equal to else equal to'. My first thought had been many trials to turn out with a chance of getting a valid case with 1 and 1600 to align. It is random rather than a highly ordered. There shall be 2/ 40 - (1/ 40)^2 chance for 1599 to exist. From wording , 1 could also become the answer. I simulated the random cases to prove.

Finally, I must tune my mind to answer according to what you want for remained possibility. Analysis shows that even numbers are easy to arrange while odd numbers are not that easy; nevertheless all of them could share the same simple formula.

1, 5, 9, 13, 17, 21, 25, 29 (The upper right corner for 64 - 29 = 35)

2, 6, 10, 14, 18, 22, 26, 30

3, 7, 11, 15, 19, 23, 27, 31

4, 8, 12, 16, 20, 24, 28, 32

33, 37, 41, 45, 49, 53, 57, 61

34, 38, 42, 46, 50, 54, 58, 62

35, 39, 43, 47, 51, 55, 59, 63

36, 40, 44, 48, 52, 56, 60, 64

8 x 8 above (64 - 29 = 35) are just arise from 4 quadrant separation to 1 and 1600. More over, arranging vertical down for half above and continue to vertical down below shall give the 'Q' wanted. The Big and Small should meet at minimized arrangement. With these artificial arrangements, there shall not be any difference which can be smaller than 819 (or 1600 - 781) for the 40 x 40.

Lu Chee Ket - 6 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...