I live on the ground floor of a ten-story building. On each floor, a friend of mine lives. One day, I put the numbers $1,2, \ldots$, 9 into a hat and drew them out in a random order. I visited them in the order in which I drew their floor numbers. On average, how many meters did I travel by elevator, if the distance between two floors is 4 meters, and I took the elevator from every floor to the next drawn floor number?
Let's choose the distance between two adjacent floors (4 m) as the unit. If I visit the floors in the order $x_{1}, \ldots, x_{9}$, then

$$
\left|x_{1}-0\right|+\left|x_{2}-x_{1}\right|+\left|x_{3}-x_{2}\right|+\ldots+\left|x_{9}-x_{8}\right|+\left|0-x_{9}\right|
$$

is the distance I will cover in units. Given the conditions of the problem, every possible order (permutation) of the numbers $1, 2, \ldots, 9$ is equally likely. The total number of possible orders is 9!, so the probability of any one order is $1 / 9!$. The expected value is obtained by summing the expressions

$$
\frac{1}{9!}\left(\left|x_{1}-0\right|+\left|x_{2}-x_{1}\right|+\left|x_{3}-x_{2}\right|+\ldots+\left|x_{9}-x_{8}\right|+\left|0-x_{9}\right|\right)
$$

for every possible permutation of $x_{1}, \ldots, x_{9}$ of the numbers $1, 2, \ldots, 9$.

Let's see how many times the term $|1-0|$ appears among the terms. Clearly, it appears as many times as there are permutations that start with 1, which is $8!$. The same is true for the terms $|2-0|, |3-0|, \ldots, |0-9|$.

The term $|2-1|$ appears as many times as there are permutations where 2 is followed by 1. There are 8! such permutations. The same is true for any pair $j$ and $k$: there are 8! permutations where $k$ is immediately followed by $j$, and the term $|k-j|$ appears 8! times.

Finally, there are 8! permutations that end with 1, so the term $|0-1|$ appears $8!$ times, and the same is true for the terms $|0-2|, |0-3|, \ldots, |0-9|$. The expected value can thus be obtained by taking the expression $|k-j|$ for every pair $k \neq j$ between 0 and 9, summing these 90 numbers, multiplying by 8!, and dividing by 9!, or the expected value is:

$$
\frac{8!}{9!} \sum_{0 \leq j \neq k \leq 9}|k-j|=\frac{1}{9} \cdot 330=\frac{110}{3} \text{ units, or } 440 / 3 \text{ m}
$$

Peter Tigelmann (Dombóvár, Gőgös I. Gymnasium, 4th grade)

Note. If I want to visit all my friends, including the one on the 9th floor, I need to take the elevator for at least 18 floors in the best case. If I choose the order randomly, I am expected to cover $110 / 3 > 36$ floors, which is significantly more.

Jenő Töröcsik (Budapest, Fazekas M. Gymnasium, 4th grade)

If I lived in a house with $n$ floors instead of 10, in the best case I would visit the floors $1, 2, \ldots, (n-1)$ one by one and then return to the ground floor. This would be a distance of $2(n-1)$ floors. If, however, I choose the order randomly, the expected distance is $n(n+1) / 3$ floors. This means that if I choose the order randomly, I am expected to change direction many times.