We are looking for an important document in our desk. We know that $p_{j}$ is the probability that the document is in the $j$-th drawer $\left(j=1,2, \ldots, n, \sum_{j=0}^{n} p j=1\right)$, and we also know that it takes $T_{j}$ time to check the $j$-th drawer. Before we start searching, we make a plan, that is, we give a permutation of the first $n$ natural numbers $i_{1}, i_{2}, \ldots i_{n}$, and we will check the drawers in this order until we find the document. According to this plan, the expected search time is:

$$
K\left(i_{1}, i_{2}, \ldots, i_{n}\right)=\sum_{j=1}^{n} p_{i_{j}}\left(T_{i_{1}}+T_{i_{2}}+\ldots+T_{i_{j}}\right)
$$

Determine the permutation $i_{1}, i_{2}, \ldots, i_{n}$ for the numbers $p_{1}, \ldots, p_{n}, T_{1}, \ldots, T_{n}$ that minimizes $K\left(i_{1}, i_{2}, \ldots, i_{n}\right)$.
We denote the permutation $\left(i_{1}, i_{2}, \ldots, i_{n}\right)$ by $\pi$. The expression $K(\pi)$ is equal to the sum of products of the form $p_{k} T_{m}$. For index pairs where $k=m$, each corresponding product is included in $K(\pi)$. For index pairs where $k \neq m$, the corresponding product is included in $K(\pi)$ if and only if $m$ precedes $k$ in $\pi$, meaning we want to check the $m$-th account before the $k$-th account. If we could freely choose for each $k \neq m$ index pair which of the products $p_{k} T_{m}$ and $p_{m} T_{k}$ should be included in $K(\pi)$, we would obviously choose the smaller one. Therefore, we should check the $m$-th account before the $k$-th account if

$$
p_{k} T_{m}<p_{m} T_{k}
$$

which is equivalent to

$$
\frac{p_{k}}{T_{k}}<\frac{p_{m}}{T_{m}}
$$

If these two ratios are equal, the order in which the two accounts are checked is (from this perspective) irrelevant. Thus, $K(\pi)$ will be minimized if for any $k \neq m$ index pair, (3) holds if and only if $m$ precedes $k$ in $\pi$, i.e., if

$$
\frac{p_{i_{1}}}{T_{i_{1}}} \geq \frac{p_{i_{2}}}{T_{i_{2}}} \geq \ldots \geq \frac{p_{i_{n}}}{T_{i_{n}}}
$$

This ensures that for each pair of products $p_{k} T_{m}$ and $p_{m} T_{k}$, the smaller one is always included in $K(\pi)$. (Of course, if there are equal $\frac{p}{T}$ ratios, then $K(\pi)$ is minimized for any permutation $\pi$ that satisfies (4).)

Pap Gyula (Debrecen, Fazekas M. Gymnasium, 4th grade)