# Spam Filter Metrics

*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 5 of the school stage of the All-Russian School Olympiad (VsOSh) 2025/26 in artificial intelligence (region group I), grades 9–11. The official answer and solution are in a separate file.*

A mail filter marks emails as “spam” (the positive class) or “not spam” (the negative class). A total of $N = 1000$ emails were checked; $P$ is the total number of spam emails in the sample. Let:<br>
$TP$ — spam emails that the filter correctly marked as spam (True Positives),<br>
$FP$ — ordinary emails mistakenly marked as spam (False Positives),<br>
$FN$ — spam emails mistakenly marked as not spam (False Negatives),<br>
$TN$ — ordinary emails correctly marked as not spam (True Negatives).

Metrics:<br>
Precision — the proportion of spam correctly marked as spam.

$$\text{Precision} = \frac{TP}{TP + FP}$$

Accuracy — the proportion of correct answers among all emails.

$$\text{Accuracy} = \frac{TP + TN}{N}$$

It is known that Accuracy $= 0.8$ and Precision $= 0.5$. Find the possible values of $P$. Find the range of $TP$.

**Scoring criterion:** each of the three numbers is worth 4 points; maximum 12 points.

**Maximum score for the task — 12**
