Analyzing the Setup
Imagine you are standing before a vast, empty grid of m×n squares. Each square is waiting to be filled with a natural number.
You are bound by a strict, elegant rule: every single number you write must be the arithmetic mean of its immediate neighbors. This constraint demands absolute uniformity across the entire grid.
The Maximum Principle
Let us consider the set of all numbers written in our grid. Because the grid is finite, there must be a maximum value, which we shall call M.
Locate a cell in the grid that contains this maximum value M. Let the neighbors of this cell be a1,a2,…,ak, where k is the number of neighbors (which could be 2, 3, or 4 depending on the cell's position).
Because M is the maximum value in the entire grid, we know for a fact that every neighbor ai must satisfy ai≤M. This is the crucial observation.
The Rigidity of the Average
Now, let us apply the rule. The value of our chosen cell is the arithmetic mean of its neighbors:
If we multiply both sides by k, we obtain:
Think about this carefully. We know that each ai≤M. If even one of these neighbors were strictly less than M, then the sum of the neighbors would be strictly less than kM.
The equation demands that the sum be exactly kM. Therefore, the only way to satisfy this equation is if every single neighbor ai is exactly equal to M. There is no wiggle room; the math forces the neighbors to be just as large as the maximum itself.
The Propagation of Equality
We have just proven that if a cell contains the maximum value M, all its neighbors must also contain M. Since these neighbors are also maximums, we can apply the exact same logic to them.
Their neighbors must also be M. This effect propagates like a wave across the entire connected grid.
Because the grid is connected, this "wave" of equality will eventually reach every single cell. There is nowhere for a different number to hide. Every cell, from the corners to the center, is forced to hold the value M.
The Harmony of the Grid
We have successfully demonstrated that the only way to satisfy this arithmetic mean condition across the entire grid is if all the numbers used are absolutely equal.
This is not just a clever puzzle; it is a discrete version of the Maximum Principle in harmonic functions. This concept governs everything from steady-state heat distribution to the behavior of electric potentials.
You have just walked through a fundamental principle of analysis. The final conclusion is that the grid must be uniform.