# Cat or Dog Threshold: 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 1 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:** $-3$

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