10. Sequence of medians. Vanya wrote the number 1 on the board, and then several more numbers. As soon as Vanya writes the next number, Mitya calculates the median of the existing set of numbers and writes it down in his notebook. At some point, the numbers in Mitya's notebook are: $1 ; 2 ; 3 ; 2.5 ; 3 ; 2.5 ; 2 ; 2 ; 2 ; 2.5$.

a) (6-11 grades, 1 point) What number is written on the board fourth?

b) (6-11 grades, 2 points) What number is written on the board eighth?
Solution. a) The first number is obviously one. Then, for the median of the first two numbers to be 2, the second number must be 3.

For clarity, we will write down Vanya's numbers. Vanya wrote the third number $a_{3}$:

$$
\begin{array}{lll}
1 & 3 & a_{3} .
\end{array}
$$

The median is now 3, which can only be if $a_{3} \geq 3$. Add the next number:

$$
\begin{array}{llll}
1 & 3 & a_{3} \geq 3 & a_{4} .
\end{array}
$$

If $a_{4} \geq 3$, then the median of the resulting set is also not less than 3. But it is supposed to be 2.5 according to the condition. Therefore, $a_{4} < 3$. The median of the first four numbers is $\frac{3 + a_{4}}{2} = 2.5$, which means $a_{4} = 2$.

Now we have:

$$
\begin{array}{lllll}
1 & 3 & a_{3} \geq 3 & 2 & a_{5} .
\end{array}
$$

The median of the first five numbers is $\frac{a_{3} + 2}{2} = 2.5$, which means $a_{3} = 3$. Now we have:

$$
\begin{array}{llllll}
1 & 3 & 3 & 2 & a_{5} & a_{6} .
\end{array}
$$

The median of the first six numbers is $\frac{3 + a_{5}}{2} = 2.5$, which means $a_{5} = 2$. Now we have:

$$
\begin{array}{lllllll}
1 & 3 & 3 & 2 & 2 & a_{6} & a_{7} .
\end{array}
$$

The median of the first seven numbers is $\frac{2 + a_{6}}{2} = 2.5$, which means $a_{6} = 3$. Now we have:

$$
\begin{array}{llllllll}
1 & 3 & 3 & 2 & 2 & 3 & a_{7} & a_{8} .
\end{array}
$$

The median of the first eight numbers is $\frac{2 + a_{7}}{2} = 2.5$, which means $a_{7} = 3$. Now we have:

$$
\begin{array}{llllllll}
1 & 3 & 3 & 2 & 2 & 3 & 3 & a_{8} .
\end{array}
$$

The median of the first eight numbers is $\frac{2 + 3}{2} = 2.5$. If $a_{8} > 2$, then the median will be greater than $\frac{2 + 2}{2} = 2$. Therefore, $a_{8} \leq 2$. If $a_{6} = 2$ or $a_{7} = 2$, then $a_{8}$ can be any number not greater than 2. If both $a_{6} < 2$ and $a_{7} < 2$, then $a_{8} = 2$.

Answer: a) 2; b) if the sixth or seventh number is 2, then the eighth number is not greater than 2; if both the sixth and seventh numbers are less than 2, then the eighth number is 2. There are no other options.