TITLE: On "good" numbers and $m \times n$ real matrices
QUESTION [5 upvotes]: Let $m,n > 1$ be odd integers. Different real numbers are written in the cells of the $m \times n$ table ($m$ rows and $n$ columns). The number is called "good" if
1) It is the largest in its row (column).
2) It is the median value in his column (row).
What is the largest possible number of "good numbers"?

My work so far:
I solved the problem for table $3\times3$:
\begin{bmatrix}
1 & 7 & 9 \\
2 & 6 & 4 \\
5 & 3 & 8 
\end{bmatrix}
$5,6,7,8 -$ "good numbers".
If $m>3$ or $n>3 -$ I need help here.

REPLY [2 votes]: I don't have a definitive answer, but it is possible to set an upper bound on what is possible.
Without loss of generality, we can say $m\ge n$. So we can impose some limits:

Since there are only $n$ median and $n$ maximum values in the columns, we can have no more than $2n$ good numbers.
One of those maximum numbers is also the maximum for the whole table. This cannot be a  good number so the limit reduces to $2n-1$

For larger values of $m,n$ there will be some impact of requirement for any median to have a certain count of larger numbers, which themselves therefore cannot be medians. How those large values are arranged in the table will vary the exact effect but my guess is that we are limited to $2n-\frac{n-1}{2}$ good numbers (noting that $n$ is odd).
The other thing to note of course is that this predicts an upper bound of $5$ for $m=n=3$, which is correct but not tight to the actual limit of $4$, so there may be some possibility of improvement.