Let $m\geq 4$ and $n\geq 4$. An integer is written on each cell of a $m \times n$ board. If each cell has a number equal to the arithmetic mean of some pair of numbers written on its neighbouring cells, determine the maximum amount of distinct numbers that the board may have. Note: two neighbouring cells share a common side.
Problem
Source:
Tags:
04.01.2015 02:11
04.01.2015 02:19
Excuse me, but aren't there four neighbouring cells to any given cell, not just 2?
04.01.2015 02:28
I think they mean any 2 of the 4 neighboring cells because when you reach the corners, there are only 2 neighboring cells. Assuming that, I would think HYP135peppers's solution would still be right.
04.01.2015 05:13
Actually, no. I'll rephrase the condition: "If each cell has a number that is equal to the arithmetic mean of some pair of numbers written on its neighbouring cells, then......." For example: $\begin{array}{cccc} 2 & 2 & 3 & 3 \\ 2 & 2 & 3 & 3 \\ 3 & 3 & 3 & 3 \\ 3 & 3 & 3 & 3 \end{array}$ is a valid configuration, as each $2$ has a pair of $2$s as neighbours, and each $3$ has a pair of $3$s as neighbours, therefore satisfying the condition. I hope it's clear now.
11.01.2015 19:29
Well, following Leicich's interpretation, the maximum is $mn-6$. First, note that if $x$ is the least number written in the $m \times n$ board, then any house with $x$ on it have two of its neighbors with $x$ wirtten on it, because there's two neighboring houses with $y$ and $z$ satisfying $y+z=2x$. However, $y \ge x$ and $z \ge x$, so equality must occur. Also, te houses with $y$ and $z$ aren't neighbors, so there's another house with $x$ written on it. Thus, the least number appears at least 4 times. In a similar way, the greatest number appears at least 4 times. Thus, the maximum amount of distinct numbers on the board is at most $mn-6$. Now we give a example showing that $mn-6$ works. Number the rows rom 1 to $m$ and the columns from 1 to $n$. The main idea is to "Play Snake" on the board and at the end put numbers in the houses, in the game's order. More preciselly, let's first consider $m,n$ even. Consider the sequence of neighboring houses: $(1,1);(1,2);(2,2);(2,1);(3,1);(4,1); \dots ;(m,1);$ $(m,2); (m-1,2); \dots; (3,2); (3,3); (4,3); \dots; (m,3); (m,4); (m-1,4); \dots ; (3,n);$ $(2,n);(1,n);(1,n-1);(2,n-1);(2,n-2);(1,n-2);(1,n-3);(2,n-3);$ $(2,n-4); \dots ;(2,4); (1,4); (1,3); (2,3)$ If $m$ is odd and $n$ is even, consider the sequence of neighboring houses: $(1,1);(1,2);(2,2);(2,1);(3,1);(4,1); \dots ;(m,1);$ $(m,2); (m-1,2); \dots; (3,2); (3,3); (4,3); \dots; (m,3); (m,4); (m-1,4); \dots ; (3,n);$ $(2,n);(1,n);(1,n-1);(2,n-1);(2,n-2);(1,n-2);(1,n-3);(2,n-3);$ $(2,n-4); \dots ;(1,4); (2,4); (2,3); (1,3)$ If $m$ is odd and $n$ is even, consider the sequence of neighboring houses: $(1,1);(2,1);(2,2);(1,2);(1,3);(1,4); \dots ;(1,n);$ $(2,n); (2,n-1); \dots; (2,3); (3,3); (3,4); \dots; (3,n); (4,n); (4,n-1); \dots ; (m,3);$ $(m,2);(m,1);(m-1,1);(m-1,2);(m-2,2);(m-2,1);(m-3,1);(m-3,2);$ $(m-4,2); \dots ;(4,1); (4,2); (3,2); (3,1)$ If $m$, $n$ are odd, consider the sequence of neighbooring houses: $(1,1);(1,2);(2,2);(2,1);(3,1);(4,1); \dots ;(m,1);$ $(m,2); (m,3); \dots; (m,n); (m-1,n); (m-2,n); \dots; (1,n);$ $(1,n-1); (1,n-2); \dots ; (1,3); (2,3);(2,4); \dots (2,n-1);(3,n-1);$ $(4,n-1); \dots (m-1,n-1); (m-1,n-2); (m-2,n-2); \dots (3,n-2);$ $(3,n-3); (4,n-3); \dots (m-1;n-3); (m-1,n-4); (m-2,n-4); \dots (m-1,4);$ $(m-1,3);(m-1,2);(m-2,2);(m-2,3); (m-3,3); (m-3,2); (m-4,2);$ $(m-4,3), (m-5,3); \dots (4,3); (4,2); (3,2); (3,3)$ In any of the four cases, we notice that the first four houses are pairwise neighbor, and the last four houses are pairwise neighbor. Thus, putting 1 on the first 4 houses, 2 on the 5th, 3 on the 6th, $\dots$ $mn-8$ on the $(mn-5)$th, $mn-7$ on the $(mn-4)$th and $mn-6$ on the last four houses. Thus, the problem is solved, because ever number is the aritmetic mean of two neighbors (the neighbors of the sequence).