# Analysis of the School-Stage Tasks of the All-Russian School Olympiad 2025/26 in Artificial Intelligence (Region Group II), Grades 9–11

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

*Translator's note: the original is a single PDF in which each task's statement is followed by its answer, scoring criterion and solution. Tasks 7 and 8 are programming tasks: the file gives only their scoring criteria and solutions, not their statements. The data file for Task 6 is not part of the file. Spreadsheet formulas are given with English function names (see Task 6).*

**Maximum score for the olympiad — 112**

## Task 1

When analysing a photo, a model outputs a real number $x$. Based on it, the model decides whether the photo shows a cat or a dog, using the following algorithm.

1. First, a score is computed:
   $$L(x) = 2x^5 + 3x^4 - 5x^3 - 5x^2 + 3x + 2 = (x - 1)^2 (x + 1)(x + 2)(2x + 1).$$
2. This score is then converted into the probability of finding a cat in the photo:
   $$\mathbb{P}(\text{cat} \mid x) = \frac{1}{1 + 2^{-L(x)}}.$$
3. Next, the probability of finding a dog in the photo is obtained from it:
   $$\mathbb{P}(\text{dog} \mid x) = 1 - \mathbb{P}(\text{cat} \mid x).$$

Find the largest integer $x$ for which $\mathbb{P}(\text{dog} \mid x) > 0.5$.

**Answer:** $-3$

**Scoring criterion:** exact match of the answer — 12 points

**Maximum score for the task — 12**

**Solution.**

Since

$$\mathbb{P}(\text{dog} \mid x) = \frac{2^{-L(x)}}{1 + 2^{-L(x)}},$$

we have

$$\mathbb{P}(\text{dog} \mid x) > 0.5 \iff 2^{-L(x)} > 1 \iff L(x) < 0.$$

We have the factorisation:

$$L(x) = (x - 1)^2 (x + 1)(x + 2)(2x + 1),$$

with roots $x = -2, -1, -\frac{1}{2}, 1$ (the root $x = 1$ has multiplicity 2). The sign of $L(x)$ changes at the simple roots and does not change at the multiple root, therefore

$$L(x) < 0 \text{ on the intervals } (-\infty, -2) \ \cup\ (-1, -\tfrac{1}{2}).$$

Of the integer values, only $x \le -3$ fit (at the points $x = -2, -1$ we have $L(x) = 0 \Rightarrow \mathbb{P} = 0.5$, which does not satisfy the strict inequality).

Hence, the largest integer $x$ for which $\mathbb{P}(\text{dog} \mid x) > 0.5$ equals $\boxed{-3}$.

## Task 2

An artificial intelligence club is holding a forecasting contest. There is a machine: every minute it produces a ball — either red with probability $\frac{2}{3}$ or blue with probability $\frac{1}{3}$. This happens independently: the colour of one ball does not affect the colour of the others. Before the contest began, the participants were told in what order the balls had come out over the last six minutes:

$$\text{blue, red, blue, blue, red, blue.}$$

According to the rules, three fields — the predictions for the next three minutes — must be filled in in advance and the sheet handed in. Vasya noticed that blue had occurred more often and wrote “blue” in all 3 fields. Find the mathematical expectation of the number of Vasya's correct predictions over the next three minutes, that is, how many of these three predictions will turn out to be correct on average?

**Answer:** 1

**Scoring criterion:** exact match of the answer — 12 points

**Maximum score for the task — 12**

**Solution.**

The next three one-minute trials are independent, and in each minute a blue ball comes out with probability $p = \frac{1}{3}$, regardless of the past six minutes. Vasya wrote “blue” in all three fields, so the number of his correct predictions is

$$X = X_1 + X_2 + X_3,$$

where $X_i$ is the indicator of the event “a blue ball came out in minute $i$”, that is, $\mathbb{P}(X_i = 1) = \frac{1}{3}$, $\mathbb{P}(X_i = 0) = \frac{2}{3}$.

By linearity of expectation,

$$\mathbb{E}X = \mathbb{E}X_1 + \mathbb{E}X_2 + \mathbb{E}X_3 = 3 \cdot \mathbb{P}(X_i = 1) = 3 \cdot \tfrac{1}{3} = 1.$$

So, on average, Vasya will guess $\boxed{1}$ of the 3 predictions correctly.

## Task 3

Two sets of points are given (we will call the first one the training set and the second one the validation set).

$$\text{Training: } (-0.5, -0.75), (0, -0.5), (0.5, 1.25), (1, 1.5).$$

$$\text{Validation: } (2, 5.0), (3, 11.5), (4, 14.0).$$

*[Figure: see the [original statement](https://siriusolymp.ru/2025/ai).]*

*Translator's transcription of the figure: the seven points above plotted on a grid ($x$ from −6 to 9, $y$ from −1 to 14), with the legend “Training points” (orange circles) and “Validation points” (blue squares). In the PDF the figure is printed at the top of the next page, inside the solution.*

Four models are considered (that is, rules that specify how $y$ depends on $x$):

- $y = 2x$,
- $y = x + 0.5$,
- $y = \frac{1}{2}(x + 2)^2 - 2$,
- $y = (x + 1)^2 - 1$.

The quality of each model on a set of points is assessed by the formula:

$$\frac{\left(y_1 - \hat{y}_1\right)^2 + \left(y_2 - \hat{y}_2\right)^2 + \ldots + \left(y_n - \hat{y}_n\right)^2}{n},$$

where $y_i$ is the actual value and $\hat{y}_i$ is the value given by the model's formula at the same point $x_i$. The smaller the error, the better the model describes the data of this set.

Choose the model with the smallest mean squared error on the training set.<br>
Choose the model with the smallest mean squared error on the combined set of all seven points (training and validation together).

**Answer:** 1) $y = 2x$; 2) $y = \frac{1}{2}(x + 2)^2 - 2$

**Scoring criterion:** 6 points for each correct answer

**Maximum score for the task — 12**

**Solution.**

The mean squared error is $\frac{1}{n}\sum (y - \hat{y})^2$. Within one and the same set of points, the number $n$ is the same for all models, so it is not necessary to divide by it: it is enough to compare the sums of squares $\sum (y - \hat{y})^2$.

*(Translator's note: A, B, C and D denote the four models in the order in which they are listed in the statement.)*

Training set $(-0.5, -0.75), (0, -0.5), (0.5, 1.25), (1, 1.5)$. Sums of squared deviations:

$$
\begin{aligned}
\text{Sum for A} &= 0.0625 + 0.25 + 0.0625 + 0.25 = 0.625,\\
\text{Sum for B} &= 0.5625 + 1 + 0.0625 + 0 = 1.625,\\
\text{Sum for C} &= 0.015625 + 0.25 + 0.015625 + 1 = 1.28125,\\
\text{Sum for D} &= 0 + 0.25 + 0 + 2.25 = 2.5.
\end{aligned}
$$

The minimum is for A, so on the training set the best model is $y = 2x$.

Combined set: we add $(2, 5), (3, 11.5), (4, 14)$. The three new points give:

$$
\begin{aligned}
&\text{For A: } 1^2 + 5.5^2 + 6^2 = 67.25,\\
&\text{For B: } 2.5^2 + 8^2 + 9.5^2 = 160.5,\\
&\text{For C: } 1^2 + (-1)^2 + 2^2 = 6,\\
&\text{For D: } 3^2 + 3.5^2 + 10^2 = 121.25.
\end{aligned}
$$

Total over all seven points (we add these to the sums for the training set):

$$
\begin{aligned}
&\text{A: } 0.625 + 67.25 = 67.875,\\
&\text{B: } 1.625 + 160.5 = 162.125,\\
&\text{C: } 1.28125 + 6 = 7.28125,\\
&\text{D: } 2.5 + 121.25 = 123.75.
\end{aligned}
$$

The minimum is for C, so for the combined set the best model is $y = \frac{1}{2}(x + 2)^2 - 2$.

## Task 4

An array of $n$ numbers is given. Let us arrange them in ascending order:

$$x_1 \le x_2 \le x_3 \ldots \le x_n$$

The median is the middle of the ordered set: for odd $n$ it is the middle element; for even $n$ it is the mean of the two middle elements.<br>
The first quartile $Q_1$ is the median of the lower half.<br>
The third quartile $Q_3$ is the median of the upper half.<br>
An array of $n$ numbers is given. Let us arrange them in ascending order:

$$x_1 \le x_2 \le \cdots \le x_n.$$

If $n$ is even, the lower half is $x_1, \ldots, x_{(n/2)}$ and the upper half is $x_{(n/2+1)}, \ldots, x_{(n)}$. If $n$ is odd, the element $x_{((n+1)/2)}$ does not belong to either half: the lower half is $x_1, \ldots, x_{((n-1)/2))}$ and the upper half is $x_{((n+3)/2)}, \ldots, x_{(n)}$. In all cases, if the median falls between numbers, the mean of the neighbouring ones is taken. The interquartile range is the length of the segment between the quartiles:

$$R = Q_3 - Q_1.$$

For a parameter $k > 0$, we define the bounds:

$$L = Q_1 - kR, \qquad U = Q_3 + kR.$$

A number is considered an outlier if it is less than or equal to $L$ or greater than or equal to $U$. This is what an example looks like for a **different** dataset.

*[Figure: see the [original statement](https://siriusolymp.ru/2025/ai).]*

*Translator's transcription of the figure: a number line from −1 to 22 with data points (crosses) at 0, 1, 2, …, 12 and (blue squares) at 16, 20 and 21. $Q_1 = 3.5$ and $Q_3 = 11.5$ are marked with diamonds, and the shaded band between them is labelled “Interquartile range”. Dotted lines mark $L$ (at −0.5) and $U$ (at 15.5). The points 16, 20 and 21 to the right of $U$ are braced together and labelled “outliers”.*

Consider the array of 12 numbers:

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

It is known that the values of the parameter $k > 0$ for which exactly two elements of the array are outliers under the rule above form a half-open interval.

Write down the value of the left end of this half-open interval. Write down the value of the right end of the half-open interval.

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

**Scoring criterion:** 6 points for each correct answer. Total — 12 points

**Maximum score for the task — 12**

**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].$$

## Task 5

A system that accepts entries for a photo contest marks pictures as suitable (the positive class) or unsuitable (the negative class). A total of $N$=1000 pictures were considered, of which $P$=850 are actually suitable and $N - P = 150$ are unsuitable. Let:

- $TP$ — suitable pictures that the system correctly marked as suitable (True Positives),
- $FP$ — unsuitable pictures mistakenly marked as suitable (false positive detections, False Positives),
- $FN$ — suitable pictures mistakenly marked as unsuitable (False Negatives),
- $TN$ — unsuitable pictures correctly marked as unsuitable (True Negatives).

Metrics:

$$\text{Recall} = \frac{TP}{P},$$

$$\text{Precision (the share of True Positives among all pictures marked as suitable)} = \frac{TP}{TP + FP},$$

It is known that Precision $= 0.8$. Find the range of possible values of Recall. Write the answers as irreducible fractions.

**Answer:** $\text{Recall} \in \left[\dfrac{2}{425}, \dfrac{12}{17}\right]$.

**Scoring criterion:** 6 points for each correct answer.

**Maximum score for the task — 12**

**Solution.**

From $\dfrac{TP}{TP + FP} = 0.8$ we obtain $FP = \frac{1}{4} TP$, that is,

$$TP = 4k, \quad FP = k, \quad k \in \mathbb{Z},\ k \ge 1.$$

Class constraints: $TP \le 850 \Rightarrow k \le 212$ and $FP \le 150 \Rightarrow k \le 150$, so all $k = 1, 2, \ldots, 150$ are admissible. For each such $k$ we can take

$$FN = 850 - 4k \ge 0, \qquad TN = 150 - k \ge 0,$$

that is, such a configuration is achievable.

Then

$$\text{Recall} = \frac{TP}{P} = \frac{4k}{850}.$$

The minimum is at $k = 1$: $TP = 4, FP = 1, FN = 846, TN = 149$, which gives $\dfrac{4}{850} = \dfrac{2}{425}$. The maximum is at $k = 150$: $TP = 600, FP = 150, FN = 250, TN = 0$, which gives $\dfrac{600}{850} = \dfrac{12}{17}$.

Result: $\text{Recall} \in \left[\dfrac{2}{425}, \dfrac{12}{17}\right]$.

## Task 6

The Heir Tutti is capricious: when the royal cook brings him a dish, he either agrees to try it (let us denote this answer by 1) or refuses (0). Before each attempt, the three Fat Men look at the dish and give their opinion on whether the heir will like it.

The tech-savvy royal cook keeps a table (the file can be downloaded in one of the formats XLSX, ODS, CSV). Each row contains four integers, each equal to 0 or 1:

$$n_1,\ n_2,\ n_3 \text{ — the opinions of the three Fat Men}, \qquad y \text{ — Tutti's actual decision}.$$

Based on the Fat Men's opinions, the cook uses the majority rule to make a guess $\hat{y}$ about whether the dish will be tried:

$$\hat{y} = \begin{cases} 1, & \text{if } n_1 + n_2 + n_3 \ge 2, \\ 0, & \text{otherwise.} \end{cases}$$

The cook wrote the values of $\hat{y}$ in a separate column, but accidentally erased the data and is now trying to restore them.

**Problem.** In how many rows did the cook's guess $\hat{y}$ coincide with the heir's decision $y$?

**Answer:** 86

**Scoring criterion:** exact match of the numerical answer — 12 points

**Maximum score for the task — 12**

**Solution.**

*Translator's note: the original writes the formulas below for a Russian-language spreadsheet (Russian function names and semicolons between arguments); here they are given with the English function names IF and SUM.*

Suppose the columns are: A: $n_1$, B: $n_2$, C: $n_3$, D: $y$; the data are in rows 2–101.

**Step 1. Restore the cook's prediction (majority rule).** In cell E2:

`=IF(A2+B2+C2>=2, 1, 0)`

Drag down to E101. Here E is the $\hat{y}$ column.

**Step 2. Indicator of agreement with the actual outcome.** In cell F2:

`=IF(E2=D2, 1, 0)`

Drag down to F101.

**Step 3. The answer is the number of matches.** In any free cell, for example H2:

`=SUM(F2:F101)`

This is exactly the number of rows where $\hat{y} = y$.

## Task 7

*[The statement of this programming task is not included in the original file.]*

**Scoring criterion:** 1 point for each test not taken from the statement. Total — 20 points

**Maximum score for the task — 20**

**Solution.**

We want to obtain a frame described entirely by identical symbols — either all zeros or all ones. Let us consider both options in turn: first the target $t = 0$, then $t = 1$.

How to recover the required inversions:

- From the first column we immediately see which rows have to be flipped: row $i$ is flipped if its first symbol differs from $t$. This gives the row mask $R$.
- Then, from the first row, we find which columns have to be flipped: column $j$ is flipped if its symbol in the first row (taking into account the already chosen $R_0$) differs from $t$. This gives the column mask $C$.
- We verify that after these flips every cell has become equal to $t$. If so, we output the answer. If not, we try the other $t$.

If it has worked neither for $t = 0$ nor for $t = 1$, we output `NO`.

```python
def bit(ch):
    return 1 if ch == '1' else 0

Q, N = map(int, input().split())
a = [input().strip() for _ in range(Q)]

done = False
for t in (0, 1):
    R = [bit(a[i][0]) ^ t for i in range(Q)]
    C = [bit(a[0][j]) ^ t ^ R[0] for j in range(N)]
    ok = True
    for i in range(Q):
        ri = R[i]
        row = a[i]
        for j in range(N):
            if (bit(row[j]) ^ ri ^ C[j]) != t:
                ok = False
                break
        if not ok:
            break
    if ok:
        print("YES")
        print("".join(str(x) for x in R))
        print("".join(str(x) for x in C))
        done = True
        break

if not done:
    print("NO")
```

## Task 8

*[The statement of this programming task is not included in the original file.]*

**Scoring criterion:** 1 point for each test not taken from the statement. Total — 20 points

**Maximum score for the task — 20**

**Solution.**

For each pair $(x, y)$ we list all 8 of its symmetries and take the lexicographically smallest one — this is the canonical representation of the object. The number of distinct objects is the size of the set of such canonical pairs.

```python
N = int(input())
S = set()
for _ in range(N):
    x, y = map(int, input().split())
    v = [
        ( x,  y), (-x,  y), ( x, -y), (-x, -y),
        ( y,  x), (-y,  x), ( y, -x), (-y, -x)
    ]
    S.add(min(v))
print(len(S))
```
