Square Matrix

A = ( 1 23 5700 3 273 7801 578 2061 100 0 2 ) A=\begin{pmatrix} 1 & 23 & \cdots & 5700 \\ 3 & 273 & \cdots & 7801 \\ \vdots & \vdots & \ddots & \vdots \\ 578 & 2061 & \cdots & 1000^2 \end{pmatrix}

Imagine a large 1000 × 1000 1000 \times 1000 matrix A A filled with the integers 1 1 through 100 0 2 1000^2 , each appearing exactly once. The matrix above is one such example, with no particular ordering of the numbers.

Entries are said to be adjacent if one is directly above, below, left, or right of the other. (In other words, next to each other horizontally or vertically) Let the maximum difference between adjacent entries be D D . What is the minimum possible value of D D over all matrices of this type?


The answer is 1000.

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.

1 solution

Dylan Pentland
Jun 14, 2016

We will show that the minimum possible value of D D is 1000.

First, let's find an example of D = 1000 D=1000 . Fortunately, this can be easily constructed by setting A i j = i + 1000 ( j 1 ) A_{ij}=i+1000(j-1) . It looks like this:

A = ( 1 2 1000 1001 1002 2000 100 0 2 999 100 0 2 998 100 0 2 ) A=\begin{pmatrix} 1 & 2 & \cdots & 1000 \\ 1001 & 1002 & \cdots & 2000 \\ \vdots & \vdots & \ddots & \vdots \\ 1000^2-999 & 1000^2-998 & \cdots & 1000^2 \end{pmatrix}

Consider the numbers being entered in sequential order. WLOG, we may assume that a row gets entirely filled before (or at the same time) a column gets entirely filled, and this happens when we add in the number n n . Then, consider the state of the matrix immediately after adding n n , which has several unfilled entries. For each column, it has at least one entry (as a row is filled), and for all but possibly the one column n n is in, we can ensure there is an unfilled entry present. Hence, at the moment we add n n we can find adjacent pairs within columns outside of n n 's column where one entry is filled and another entry is not filled. Let's denote these 999 pairs of entries in columns A A outside n n 's column by { ( a i , filled , a i , unfilled ) } \{(a_{i,\text{filled}}, a_{i,\text{unfilled}})\} for 1 i 999 1\leq i \leq 999 .

Since we just filled in n n and we have chosen 999 distinct filled numbers outside of the column n n is in, the numbers in the filled entries a i , filled a_{i,\text{filled}} are all at most n 1 n-1 . The minimum of the filled entries is then min i a i , filled n 1 998 = n 999 \min_i a_{i,\text{filled}} \leq n - 1 - 998 = n-999 . Then, if we continue entering numbers in sequential order, the number assigned to the unfilled entry a i , unfilled a_{i,\text{unfilled}} in each of the 999 999 columns is n + 1 \geq n + 1 . Hence, the difference of these two terms in ( n + 1 ) ( n 999 ) = 1000 \geq (n+1) - (n-999) = 1000 at the minimum filled entry.

This means that in all matrices of this type, we have D 1000 D\ge 1000 . Since we have an easy example of D = 1000 D=1000 , the answer must be 1000 1000 .

Of course, all of this generalizes to any size matrix, and you can even generalize to higher dimensions. (In d d dimensions, it should be n d 1 n^{d-1} if we have a n × n × n d times \underbrace{n\times n \times \cdots n}_{\text{d times}} grid).

[Credit to Calvin Lin for rephrasing the middle section for clarity]

Sorry, I don't quite get your argument about m m . Could you help me understand it?

Shaun Leong - 5 years ago

Log in to reply

Suppose that the last entry that you filled at the moment you have 1000 pairs was i i . Then m m has to be at least 1000 less than i + 1 i+1 , because if it was any larger we would not have enough distinct values to make pairs from (as all the other pairs have to be made with entries larger than m m ). When m m 's pair is completed, the value that completes it is at least i + 1 i+1 so we have shown that a difference of at least 1000 exists somewhere.

Hope this cleared it up!

Dylan Pentland - 5 years ago

Log in to reply

It's clear now. Thanks!

Shaun Leong - 5 years ago

For clarity, can you define what a "disjoint pairs of filled and unfilled entries" refers to? Note that you likely want the orientation to be consistent (IE 1000 column pairs or 1000 row pairs) and that each column/row contributes only 1 pair, in order to avoid one filled element removing 2 pairs.

The phrasing in the solution could be greatly improved to explain what you are thinking.

Calvin Lin Staff - 5 years ago

Log in to reply

I changed some of the language in that section, hopefully it made the solution clearer. I think the poor phrasing is mostly coming from bad notation for the ideas that I'm talking about, so I tried to fix some of that.

Dylan Pentland - 4 years, 12 months ago

Log in to reply

Here is how I suggest rephrasing that part of the solution.

Consider the numbers being entered in sequential order. WLOG, we may assume that a row gets entirely filled before a column gets entirely filled, and this happens when we add in the number n n . Then, consider the state of the matrix, which has several unfilled entries. For each column, it has at least one entry (row is filled), and it doesn't have all entries (column is not filled). Hence, we can find a column-pair of terms, where one entry is filled and another entry is not filled. Let's consider these 1000 pairs. Since we just filled in n n , and we have 1000 distinct numbers, thus the minimum of the filled entries is n 1000 + 1 \leq n - 1000 + 1 . Then, the unfilled entry of this column pair is n + 1 \geq n + 1 . Hence, the difference of these two terms is ( n + 1 ) ( n 1000 + 1 ) = 1000 \geq (n+1) - (n-1000+1) = 1000 .

Calvin Lin Staff - 4 years, 11 months ago

Log in to reply

@Calvin Lin Much more concise! Thank you, I've updated the solution again.

Dylan Pentland - 4 years, 11 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...