There is a $625 \times 625$ square grid. We have to place chocolates in such a way so that each row and each column contains maximum of $3$ chocolates. What is the maximum number of chocolates we can put in that grid in total?
Maximum chocolate in a square grid
3 Answers
Since each single piece of chocolate increases by one the number of pieces in one row and one column, the maximal number is clearly $625 \cdot 3 \,\,$. As correctly noted, the strategy of putting $3×3$ squares of chocolate down the diagonal does not give the maximal number, as after $208$ squares we are left with the last row and the last column, and this allows only one piece more.
However, from this position ($208$ of these $3×3$ squares along the diagonal), it is sufficient to randomly choose two pieces with different column and row and move them to the last column without changing their rows. This results in three different columns that lack one piece to arrive to three (one of these column is the last one), and a single blank row (the last one) with no pieces. Placing three pieces at the crossing of these three columns with the last row, we achieve the maximal number of pieces.
Why not just place $3 \times 3$ squares of chocolate down the diagonal? This is a tri-diagonal matrix. Doing this ensures that the maximum number of chocolates per row and column are met.
-
0It's not clear this arrangement gives the highest number. 3 does not divide 625. Doing this will leave one square at the end, but using this technique will only have one for the last row or column, so this might not be the highest number. – 2017-01-25
The below $5 \times 5$ block has three ones in each row and column. Put $125$ of these down the diagonal.
-
0are you trying to say that the $625 * 625$ blocks are divided into 125 independent grids of $5*5$, where two consecutive of those grids are connected to each other at one point, which makes a continued diagonal connection. I am trying to mean that the whole structure will appear like a flight of stairs, rather than a large single square box. Isn't that what you mean? – 2017-01-26
-
0You divide the $625 \times 625$ grid into $125 \times 125$ squares, each $5 \times 5$. Select the $125$ squares down the main diagonal and fill them with this pattern. You will now have three ones in each of the $625$ rows and columns. – 2017-01-26
-
0,,how can you prove that your system ensures maximum number of chocolates? – 2017-02-04
-
0@RanganAryan: it puts three in each row and column. That is all that are allowed. – 2017-02-05
