Consider a 1 0 0 × 1 0 0 table, filled with integer entries from 1 to N inclusive. The entry in the i th row and j th column is denoted by a i , j . For all integers i and j such that i + j ≤ 1 0 0 , the integer a i , j does not appear in the ( i + j ) th row. What is the minimum value of N ?
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.
First note that the subsets of { 1 , . . . , N } can be labeled S 1 , . . . , S 2 N such that S i ⊂ S j for any i < j .
(One way to do this is to define, on the power set of { 1 , . . . , N } , the one-to-one function f ( S ) = ∑ i ∈ S 2 i and then label the subsets such that f ( S i ) is decreasing as a function of i .)
P.S. I just realized that that parenthetical remark is proving a trivial result: you could just label the subsets in any way such that ∣ S i ∣ is non-increasing.
Nice, this was the same construction that I used.
Any thoughts on how to approach this problem such that a i , j doesn't appear in either the i + j row or column?
Log in to reply
This is trivial, just set a(i,j) to max (i,j) and the answer is 100. You can't do better than that, just think about the first column.
Log in to reply
I actually read the problem like that the first time and gave the wrong answer 100 , then I got the right answer.
@Avi E,
Are you sure? And, if so, can you prove that you can't do better than that?
Log in to reply
@Peter Byers – I'm not fully sure, but I worked it out in my head in a manner like this:
Build this from size 1 and on. Start the (1,1) with a 1, now the 2nd row and 2nd column cannot have any 1s in them. Assume they are all 2s. Now the third row and column must have a 3 (specifically the (2,3) and (3,2) boxes cannot be 1 or 2). Assume all 3's. Now the fourth row and column must have a 4 ( specifically the (2,4) and (4,2) boxes cannot be 1,2, or 3). I think this will scale, but you might be able to put some higher numbers in earlier and then have less numbers total. If you can do so then put up a chart and show us. Even a smaller number like 5 or 10 would be enough to disprove my claim.
Log in to reply
@Avi Eisenberg – It took me a little while, but I've come up with an example to show that we can be more efficient than that:
1231
2332
3311
1212
Log in to reply
@Peter Byers – Well then I was wrong. Can you find any formula then?
@Avi Eisenberg – The problem with your construction, is that you are assuming "The best case for n must be built from the best case for n − 1 ". This is avery common misconception when approaching such a problem through inductive methods. If you look at Peter's example, in the top left 2 × 2 square, it uses 3 different numbers.
All you have shown is that we need at most n numbers, and I agree that your construction would provide a simple reason. However, it is not clear (and I'm guessing, not true) that n numbers are required.
Log in to reply
@Calvin Lin – Theorem : if min(n)=x,and min(n+1)=y, then there is a minimal solution for n+1 built from a minimal solution for n.
Proof : Either x=y, or x+1=y. If the first, then the statement follows. If the second, then take any solution for n, and add a row and column containing only x+1, thus getting a minimal solution for n+1. The "catch" is that you can also find solutions that don't build on an earlier one.
Log in to reply
Proof : Either x=y, or x+1=y. If the first, then the statement follows. If the second, then take any solution for n, and add a row and column containing only x+1, thus getting a minimal solution for n+1. The "catch" is that you can also find solutions that don't build on an earlier one.
(emphasis added)
We can't consider this a Proof unless you demonstrate that the statement follows.
Edit: Now I see what you're saying ... the theorem is pretty obvious, really. But I don't think it helps with the fallacy that Calvin mentioned, namely that "The best case for n must be built from the best case for n-1".
Log in to reply
@Peter Byers – if x=y, then any solution for n+1 with x numbers also has y numbers in its upper corner.
Any thoughts on how to approach this problem such that a i , j doesn't appear in either the i + j row or column?
At the time I didn't, but now I do: first define, on the power set of { 1 , . . . , N } , the one-to-one function g ( S ) = ∑ i ∈ S 2 i − 1 and let S i = g − 1 ( 2 N − i ) for i = 1 , . . . , 2 N − 1
Then, for each pair i , j we have S i ∩ S j = S k for some positive integer k ≤ min ( i + j − 1 , 2 N − 1 ) , and we choose any a i , j ∈ S i ∩ S j − S i + j if i + j ≤ 2 N − 1 , or a i , j ∈ S i ∩ S j if i + j > 2 N − 1 .
With this construction, a i , j does not appear in the ( i + j ) -th row or the ( i + j ) -th column. In particular, for our square table with side 1 0 0 (or any size up to 1 2 8 ) N = 8 will work.
Log in to reply
Then, for each pair i , j , we have S i ∩ S j = S k for some positive integer k ≤ min ( i + j − 1 , 2 N − 1 )
Proof: Since N ∈ S i ∩ S j it follows that S i ∩ S j = S k for some positive integer k ≤ 2 N − 1 .
To show that k ≤ i + j − 1 we compute
2 N − k = g ( S k )
= g ( S i ∩ S j )
= g ( S i ) + g ( S j ) − g ( S i ∪ S j )
= 2 N − i + 2 N − j − g ( S i ∪ S j )
≥ 2 N − i − j + 1
which is to say, k ≤ i + j − 1 .
My solution has a i , j = a j , i so I think it qualifies. It is like the Sierpinski Gasket where you zoom out in order to add a new number.
Log in to reply
My solution has a i , j = a j , i so I think it qualifies.
Good point, Matt. Of course, that also relates to the question of whether the modified problem can be done with 7 rather than 8. (I don't claim to have proven that 8 is optimal.)
Looking closely at your construction, I believe it would use 8. For example, any time a + b = 1 2 7 we have p = 8 . (Of course, this also creates an issue with your solution to the original problem, but it is easily fixed.)
Incidentally, I think your picture isn't quite consistent with the construction: three of those 3's, and three of those 4's, ought to be 1's. Unless I'm misunderstanding the construction.
Log in to reply
@Peter Byers – We're still assuming a + b ≤ 1 0 0 for the modified version aren't we? If I understand Calvin correctly then the fact that my solution has diagonal symmetry, i.e. row i is identical to column i means it satisfies the modified version also.
I'll double-check my construction against my diagram. Initially I had all 4's instead of the yellow triangle at E5, which also works, but that was even more complicated to express. There must be a simpler formula :)
Log in to reply
We're still assuming a + b ≤ 1 0 0 for the modified version aren't we?
I think I understand what your saying: your construction/formula didn't apply to every spot in the grid, just the ones with a + b ≤ 1 0 0 . That works fine (although I think it should have been stated in the solution).
So for example, for a three-by-three grid it yields the symmetrical:
1 2 1
2 2
1
But here's the thing: whereas for the original problem, the other three spots can be filled in without another number, thus:
1 2 1
2 2 2
1 1 1
but for the modified problem you would need another number:
1 2 1
2 2 3
1 3 1
Likewise, your solution gives N = 8 (as opposed to N = 7 ) for the modified problem.
Log in to reply
@Peter Byers – OK, I think I see what you are saying. I'd been completely disregarding the cells on the wrong side of the main diagonal but actually they have to be taken into account for the modified version.
The solution is that for a table with dimension d such that 2 k − 1 ≤ d < 2 k , it can be filled with symbols 1 through k , and no fewer.
This is one of those ones where you can understand the pattern easily but it takes a long time to put into proof form :) Here is a diagram to help ; the essence of it is that it is a fractal pattern, with triangles of side length 2 k − 1 repeating, for each k . I have highlighted the main diagonals which are crucial to my argument below. Note that this is not the only possible solution.
I will prove by induction that no fewer symbols are possible for each k and then give an explicit solution for each d . When I refer to the cell a , b below I mean the position in row a , column b , where the first row is row 1 etc, and the cell 1 , 1 is the top-left cell.
This is a slightly trickier induction than usual because my induction includes a supposition and thus establishes a necessary but not sufficient condition, but I think it is valid.
Induction Hypothesis: For a triangle of side length 2 n − 1 starting at a , b , by which I mean its vertices are ( a , b ) , ( a + 2 n − 2 , b ) , ( a , b + 2 n − 2 ) , then if it is filled with symbols 1 through n , then the main diagonal (i.e. the cells such that i + j = a + b + 2 n − 2 ) must contain all symbols 1 through n .
Initial Step: For n = 1 , the "triangle" is a single cell and it can be filled with the symbol 1 , and the main diagonal contains all symbols 1 through 1 .
Induction Step: Assume the hypothesis is true for n = k . yellow triangle in my diagram . Consider row a + 2 k − 1 , i.e. the first row that lies completely below the triangle. Because all values 1 through k are represented on cells such that i + j = a + 2 k − 1 (that is part of the hypothesis), this row cannot contain any of those symbols.
Suppose that we now wish to fill the remainder of the triangle of side length 2 k + 1 − 1 starting at a , b with symbols 1 through k + 1 , leaving unchanged the cells belonging to the contained triangle of side length 2 k − 1 that we assumed is already filled in.
Since the row we are considering cannot contain 1 through k , all of its cells that lie within the triangle must contain k + 1 .
Now consider the triangle of side length 2 k − 1 starting at a + 2 k . yellow triangle below another yellow triangle in my diagram It cannot contain the symbol k + 1 because the presence of k + 1 in every cell on the row above this triangle prevents this. However, by the induction hypothesis it is possible to fill this triangle with at most k symbols. Therefore , by the induction hypothesis again, its main diagonal must contain all symbols 1 through k .
But the main diagonal of this triangle coincides with the main diagonal of the larger triangle of side length 2 k + 1 − 1 . So the main diagonal of this larger triangle must contain 1 through k , and also k + 1 due to the row that contains only k + 1 .
Since the row a + 2 k + 1 − 1 cannot contain any member of that main diagonal, a new symbol is required for this row. This completes the proof that if there are at least 2 k rows then we require at least k + 1 symbols.
Explicit Solution: Now we show that there is actually a solution with this number of symbols. For this solution, to simplify the language I will count cells from 0 , so that the top-left cell is 0 , 0 , and the value in cell a , b must not occur in row a + b + 1 .
This is the solution that appears in my diagram:
For the cell a , b , write out a and b in binary, with extra zeroes at the left if required. Let p be the first bit-position such that a and b both have a 0 in that position, where bit number 1 is the least significant bit. Then the symbol p goes in the cell a , b .
To show that this solution meets the problem conditions: note that this solution implies that row a cannot contain any symbols corresponding to a bit-position where a has a 1 -bit.
Now consider any cell i , j such that i + j + 1 = a . Suppose the symbol in that cell is p . Then i and j must both contain a 0 in bit-position p , and there is no lesser bit-position where both i , j contain a 0 . Therefore the minimum possible value for i + j has 0 in position p and 1 in all other bit-positions to the right. Therefore i + j + 1 must contain a 1 in bit-position p , so row a meets the problem conditions.
Finally, the actual answer to the problem with d = 1 0 0 < 2 7 is 7 .
Slight edit, the paragraph "Since the row a + 2 k + 1 − 1 " is unnecessary, I could just say that we have shown that the induction hypothesis now holds for k + 1 since we have shown that the main diagonal contains all symbols 1 through k + 1 .
First, we have to ignore all the values of i and j that are more than 100, except i = 1 0 0 , j = 1 . For all of these ignored entries, just fill in their value with any number earlier in the row(think about this, you'll see). Now we need to think about stacking from the bottom up. First the bottom row, then adding one row at time until we have 100. If you do it this way, you'll see that for every new line we add, each number corresponds to one of the other rows, and it must not match anything in that row. Now let's look at the first few lines:
First comes 1 Second comes 2 Third is 2 numbers, and can be 2,1 (the 2 corresponds to the 1 on line 1, and vice versa for line 2) Fourth is 3 numbers, and must introduce 3, so we might as well use 3,3,3
Now, the way that we are "forced" to add another number is when there is a line with all the numbers that we have so far. So in our example, line 3 had 1 , 2 and therefore line 4(and any subsequent lines) had to include at least 1 number that wasn't 1 or 2. So the way that a 4 would need to be added is the line after 1 , 2 , 3 . Now consider how many lines that will take after this 3 is added. Every line after must have a 3, and every line must have a different combination of numbers( because if 2 lines had the same combination, then the box in the higher one that corresponds to the other line cannot be filled.) There are 2 2 combinations of 1 and 2, and one (1,2) is already on line 3 (that's what forced the 3 on line 4 to come out). So the first "forced" appearance of 4 is on line 8.
If you think about it, this argument will scale, and the answer for any size is the number of powers of 2 up to and including itself. So for any size from 64 through 127, the answer is 7.
I think mine is the simplest answer so far.
Log in to reply
This was a pretty cool problem and it's simple to understand in your head once you understand it, but hard to write down a rigorous solution.
I think your solution is the same process as mine but yours has a lot of hand-waving. :)
Also I don't think you showed that a solution actually exists (you did show that if a solution exists then it must have N ≥ 7 ). For example, although it's true that lines 4-7 must each have a different "combination" of 1,2,3 , not every possible combination and ordering works, so you have to show that there is one that does work.
I found it hard to understand what you are trying to say. You likely had a clear understanding in your head, but had difficulty in expressing that down on paper. It could be helpful to list out what a 5 × 5 square would look like, and explain how your steps would lead to filling out such a table.
As Matt pointed out, your argument just shows that 7 is possible, hence the minimum value of N is at most 7. You need to further show that 6 is not possible, in order to conclude that the answer is 7.
Once again, be careful of arguing inductively that "The best case for n must be build from the best case for n + 1 ". That is a constructive argument, which differs from an existence argument.
Log in to reply
I am basically filling it out "upwards". For a 5*5 square I'd start with a 1. Then each added row looks like this:
\[
\begin{bmatrix} 2 & \\ 1 \end{bmatrix}
\begin{bmatrix} 1 & 2 \\ 2\\ 1 \end{bmatrix}
\begin{bmatrix} 3 & 3 & 3 \\ 1 & 2 \\ 2\\ 1 \end{bmatrix}
\begin{bmatrix} 1 & 3 & 3 & 3 \\ 3 & 3 & 3 \\ 1 & 2 \\ 2\\ 1 \end{bmatrix}
\]
You're actually saying the exact opposite of Matt.
Also I don't think you showed that a solution actually exists (you did show that if a solution exists then it must have N > = 7 ).
If you want a constructive means of generating a solution, just choose the smallest group of numbers that isn't included in any earlier (lower) line. (This cannot fail, because if for example, I have the group 1 , 2 , 4 , 5 which is not a subset of any earlier line, for each earlier line that corresponds to a number in the line I am now trying to fill, there will be either 1,2,4, or 5 that is not in that line, and I would put that number in the box corresponding to that line.)
The other direction can be proven by the fact that there are only 2 N − 1 nonempty subsets like Peter said. On that our arguments were basically alike.
Problem Loading...
Note Loading...
Set Loading...
First note that the subsets of { 1 , . . . , N } can be labeled S 1 , . . . , S 2 N such that S i ⊂ S j for any i < j .
(One way to do this is to define, on the power set of { 1 , . . . , N } , the one-to-one function f ( S ) = ∑ i ∈ S 2 i and then label the subsets such that f ( S i ) is decreasing as a function of i .)
For N = 7 we can use the sets S 1 , . . . , S 1 0 0 . In particular, if for each pair i , j we choose any
a i , j ∈ S i − S i + j
if i + j ≤ 1 0 0 , or a i , j ∈ S i if i + j > 1 0 0 then it follows that a i , j does not appear in the ( i + j ) -th row, as desired.
Next we will assume that the condition holds and show that N ≥ 7 . So we know that for any two rows, let's say i and k with i < k , row i contains at least one number that is not in row k (namely a i j where j = k − i ). Therefore, the total number of rows cannot be more than the number of nonempty subsets of { 1 , . . . , N } . That is to say, 1 0 0 ≤ 2 N − 1 , which means that N ≥ 7 .