A = ⎝ ⎜ ⎜ ⎜ ⎛ 1 3 ⋮ 5 7 8 2 3 2 7 3 ⋮ 2 0 6 1 ⋯ ⋯ ⋱ ⋯ 5 7 0 0 7 8 0 1 ⋮ 1 0 0 0 2 ⎠ ⎟ ⎟ ⎟ ⎞
Imagine a large 1 0 0 0 × 1 0 0 0 matrix A filled with the integers 1 through 1 0 0 0 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 . What is the minimum possible value of D over all matrices of this type?
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.
Sorry, I don't quite get your argument about m . Could you help me understand it?
Log in to reply
Suppose that the last entry that you filled at the moment you have 1000 pairs was i . Then m has to be at least 1000 less than 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 ). When m 's pair is completed, the value that completes it is at least i + 1 so we have shown that a difference of at least 1000 exists somewhere.
Hope this cleared it up!
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.
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.
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 . 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 , and we have 1000 distinct numbers, thus the minimum of the filled entries is ≤ n − 1 0 0 0 + 1 . Then, the unfilled entry of this column pair is ≥ n + 1 . Hence, the difference of these two terms is ≥ ( n + 1 ) − ( n − 1 0 0 0 + 1 ) = 1 0 0 0 .
Log in to reply
@Calvin Lin – Much more concise! Thank you, I've updated the solution again.
Problem Loading...
Note Loading...
Set Loading...
We will show that the minimum possible value of D is 1000.
First, let's find an example of D = 1 0 0 0 . Fortunately, this can be easily constructed by setting A i j = i + 1 0 0 0 ( j − 1 ) . It looks like this:
A = ⎝ ⎜ ⎜ ⎜ ⎛ 1 1 0 0 1 ⋮ 1 0 0 0 2 − 9 9 9 2 1 0 0 2 ⋮ 1 0 0 0 2 − 9 9 8 ⋯ ⋯ ⋱ ⋯ 1 0 0 0 2 0 0 0 ⋮ 1 0 0 0 2 ⎠ ⎟ ⎟ ⎟ ⎞
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 . Then, consider the state of the matrix immediately after adding 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 is in, we can ensure there is an unfilled entry present. Hence, at the moment we add n we can find adjacent pairs within columns outside of 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 outside n 's column by { ( a i , filled , a i , unfilled ) } for 1 ≤ i ≤ 9 9 9 .
Since we just filled in n and we have chosen 999 distinct filled numbers outside of the column n is in, the numbers in the filled entries a i , filled are all at most n − 1 . The minimum of the filled entries is then min i a i , filled ≤ n − 1 − 9 9 8 = n − 9 9 9 . Then, if we continue entering numbers in sequential order, the number assigned to the unfilled entry a i , unfilled in each of the 9 9 9 columns is ≥ n + 1 . Hence, the difference of these two terms in ≥ ( n + 1 ) − ( n − 9 9 9 ) = 1 0 0 0 at the minimum filled entry.
This means that in all matrices of this type, we have D ≥ 1 0 0 0 . Since we have an easy example of D = 1 0 0 0 , the answer must be 1 0 0 0 .
Of course, all of this generalizes to any size matrix, and you can even generalize to higher dimensions. (In d dimensions, it should be n d − 1 if we have a d times n × n × ⋯ n grid).
[Credit to Calvin Lin for rephrasing the middle section for clarity]