# Interquartile-Range Outliers: Solution

*English translation by SOTA – AI Community of the Russian original. Organisers who would like this translation removed can email sota.ai.community@gmail.com.*

*Task 4 of the school stage of the All-Russian School Olympiad (VsOSh) 2025/26 in artificial intelligence (region group II), grades 9–11. Answer and official solution.*

**Answer:** $k = 0.25$, $\quad k = 3.5$

**Solution.**

Let us sort:

$$-5,\ 8,\ 9,\ 9,\ 11,\ 12,\ 12,\ 12,\ 13,\ 13,\ 14,\ 30.$$

For $n = 12$ the lower half is $-5, 8, 9, 9, 11, 12$, and the upper half is $12, 12, 13, 13, 14, 30$.

$$Q_1 = \frac{9 + 9}{2} = 9, \quad Q_3 = \frac{13 + 13}{2} = 13, \quad R = Q_3 - Q_1 = 4.$$

Bounds:

$$L = Q_1 - kR = 9 - 4k, \qquad U = Q_3 + kR = 13 + 4k.$$

To find out for which $k$ there will be exactly two outliers, we look only at the numbers outside the interval $[Q_1, Q_3] = [9, 13]$, that is, at $8, 14, -5, 30$. The others never become outliers for $k > 0$.

For each of the four numbers, we find the threshold $k$ at which it becomes an outlier:

$$
\begin{aligned}
8 \text{ is an outlier} &\iff 8 \le 9 - 4k \iff k \le 0.25,\\
14 \text{ is an outlier} &\iff 14 \ge 13 + 4k \iff k \le 0.25,\\
-5 \text{ is an outlier} &\iff -5 \le 9 - 4k \iff k \le 3.5,\\
30 \text{ is an outlier} &\iff 30 \ge 13 + 4k \iff k \le 4.25.
\end{aligned}
$$

If $k \le 0.25$, then all four extreme values $8, 14, -5, 30$ become outliers at once. Hence we take $k > 0.25$: then 8 and 14 are no longer outliers, and we need only $-5$ and 30 to remain outliers. This requires both $k \le 3.5$ and $k \le 4.25$, so in the end $0.25 < k \le 3.5$.

Thus,

$$k \in (0.25,\ 3.5].$$
