4. Two odd natural numbers $k$ and $n$ are given. Martin wrote the fraction $i / j$ on the board for each pair of natural numbers $i, j$ satisfying $1 \leqq i \leqq k$ and $1 \leqq j \leqq n$. Determine the median of all these fractions, that is, such a real number $q$ that if all the fractions on the board are arranged in ascending order by value (fractions with the same value in any order), the fraction in the middle of this list will have the value $q$. (Martin Melicher)
SOLUTION. We will show that the sought median has the value $q=\frac{k+1}{n+1}$. Throughout the solution, $q$ will denote precisely this number.

Since the given numbers $n$ and $k$ are odd, the fraction with the value $q$ is indeed written on the board

- for example, it is the fraction $\frac{\frac{1}{2}(k+1)}{\frac{1}{2}(n+1)}$.

According to the comparison with the number $q$, we will say that some fraction is

$\triangleright$ small, if its value is less than $q$,

$\triangleright$ medium, if its value is equal to $q$,

$\triangleright$ large, if its value is greater than $q$.

The number $k \cdot n$ of all the fractions written is odd; to show that the middle fraction will have the value $q$ when they are ordered by size, it suffices to prove that there are as many small fractions on the board as there are large ones. (This will also mean that the number of medium fractions is odd, which will again confirm their existence.)

We will pair the fractions written on the board - each fraction $i / j$ will be paired with the fraction $i^{\prime} / j^{\prime}$ (and vice versa), precisely when $i^{\prime}=k+1-i$ and $j^{\prime}=n+1-j$, which can be rewritten symmetrically as $i+i^{\prime}=k+1$ and $j+j^{\prime}=n+1$. Note that the inequalities $1 \leqq i \leqq k$ and $1 \leqq j \leqq n$ clearly hold if and only if $1 \leqq i^{\prime} \leqq k$ and $1 \leqq j^{\prime} \leqq n$. (These integer inequalities precisely define the set of fractions written as $i / j$, resp. $i^{\prime} / j^{\prime}$.)

It is clear that only the fraction from the end of the second paragraph of our solution is "paired" with itself, and that all other written fractions are indeed divided into pairs. If we further show that in each such pair there is either one small and one large fraction, or there are two medium fractions, it will follow that the number of small fractions is the same as the number of large fractions.

Thanks to the mentioned symmetry, it suffices to verify that, under the introduced notation, the fraction $i^{\prime} / j^{\prime}$ is small if and only if the fraction $i / j$ is large. Verification by equivalent transformations is routine:

$$
\begin{aligned}
\frac{i^{\prime}}{j^{\prime}}(k+1) j \Leftrightarrow \frac{i}{j}>\frac{k+1}{n+1} .
\end{aligned}
$$

This completes the entire solution.

NOTES.