Checklist ROAI 2025 Selection Camp – Theory Test · T task
Theory Test (17 problems)
Romanian title: Proba teoretică
Written theoretical paper of 17 problems on data preprocessing, classical machine learning, search, logic, constraint satisfaction, reinforcement learning, kernels and recommender systems.
The task
The paper ('Tabăra de pregătire a lotului național de Inteligență Artificială – Iunie 2025, Proba teoretică') contains 17 problems: (1) feature normalisation, IQR outlier detection and standard versus robust scaling; (2) encoding of categorical columns and min–max scaling; (3) choosing L1 or L2 regularisation; (4) Naive Bayes with maximum-likelihood and Laplace-smoothed estimates; (5) entropy and a decision tree; (6) one K-Means step with Manhattan distance; (7) minimax and alpha–beta pruning; (8) admissible and consistent heuristics for A*; (9) propositional resolution; (10) first-order resolution; (11) arc consistency (AC-3); (12) exam scheduling as a CSP solved by backtracking; (13) approximate Q-learning with features in a Pacman grid; (14) per-class precision, macro-F1 and micro-recall from a confusion matrix; (15) proving that a patch-counting similarity is a kernel and that its thresholded version is not; (16) user-based collaborative filtering with Pearson correlation and the cold-start problem; (17) the PQ kernel between rankings.
Each problem contains several sub-questions requiring calculations, derivations or short justifications. No point values are printed in the paper.
Abridged and translated by SOTA from the official Romanian materials. The official statement has the exact rules, and it wins wherever this summary differs.
In English
This task was published in Romanian. SOTA translated it into English on 16 September 2026.
Read the theory paper in English
Theory Test
English translation by SOTA – AI Community of the Romanian original, published with the permission of Asociația Nitro. Organisers who would like this translation removed can email [email protected].
National Artificial Intelligence Team Training Camp – June 2025
THEORY TEST
Problem 1
- Consider the following dataset about users:
| ID | MonthlyIncome (euro) | SatisfactionScore (0–10) |
|---|---|---|
| 1 | 2300 | 7 |
| 2 | 4500 | 8 |
| 3 | 1000 | 4 |
| 4 | 12000 | 6 |
| 5 | 3100 | 9 |
| 6 | 5000 | 8 |
a) If we train a distance-based machine learning model (e.g. KNN), why is it important to normalise these columns? Specify a method by which they can be normalised.
b) The IQR method is a robust technique for detecting atypical values (outliers) in a numerical dataset. It is based on setting limits, as follows:
- Q1 (the first quartile) – the value at 25% of the sorted data;
- Q3 (the third quartile) – the value at 75% of the sorted data;
- Lower limit and Upper limit
- Any value that lies outside these limits is considered an outlier.
Apply the IQR method (described above) to identify any atypical values (outliers) in the MonthlyIncome column.
c) Specify which of Standard Scaling and Robust Scaling would be more suitable to apply to the MonthlyIncome column. Justify your choice!
Problem 2
- Consider the following dataset about food products:
| ID | FoodCategory | FatContent | Price |
|---|---|---|---|
| 1 | dairy | high | 5.4 |
| 2 | meat | low | 13.5 |
| 3 | vegetables | medium | 3.8 |
| 4 | meat | high | 11.0 |
| 5 | vegetables | low | 3.5 |
a) Propose a complete encoding strategy for the categorical columns, justifying the choice for each one.
b) Normalise the Price column using the Min-Max Scaling method.
Problem 3
- Consider the following situations in the process of training a predictive model, in which we want to apply regularisation:
a) Suppose we have a large number of strongly correlated features and we want to reduce their contribution gradually, without eliminating them completely.
b) We want to eliminate irrelevant features and to perform the selection of the relevant ones automatically.
c) Suppose that only a small subset of the features is truly relevant for the prediction task.
d) We want to reduce overfitting through a penalty distributed uniformly over all the coefficients of the model.
Match each situation with the most suitable form of regularisation, choosing between L1 (Lasso) and L2 (Ridge).
Problem 4
- Suppose we want to determine whether Josh is in the office () or not () by analysing the data provided by three sensors installed in that space:
Xc: a chair pressure sensor, which indicates whether a person is sitting on the chair (Xc = 1) or not (Xc = 0);Xm: a motion sensor, which detects whether there is movement in the room (Xm = 1) or not (Xm = 0);Xp: an electricity meter, which shows whether there is energy consumption in the room (Xp = 1) or not (Xp = 0).
Each sensor offers only a partial view of Josh's presence. For example, if Josh is in the office but is not sitting on the chair, the pressure sensor will not detect him.
We have a historical dataset that includes the values measured by the sensors and the information on whether or not Josh was present at those moments.
| Day | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
Xc |
0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 |
Xm |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |
Xp |
1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 |
Y |
0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 |
a) Using the Naive Bayes classifier, model the relationship between the sensor measurements and Josh's presence. Fill in the probability tables using maximum likelihood estimation (Maximum Likelihood Estimation – MLE).
Y |
P(Y) |
|---|---|
| ⋮ | ⋮ |
Xc |
Y |
P(Xc | Y) |
|---|---|---|
| ⋮ | ⋮ | ⋮ |
Xm |
Y |
P(Xm | Y) |
|---|---|---|
| ⋮ | ⋮ | ⋮ |
Xp |
Y |
P(Xp | Y) |
|---|---|---|
| ⋮ | ⋮ | ⋮ |
b) Assuming that we receive a new set of observations from the sensors: Xc = 0, Xm = 0, Xp = 1 – according to the probability tables estimated by MLE, is it more likely that Josh is present or absent?
c) If, instead of MLE, we use Laplace smoothing (Laplace Smoothing) to estimate the probability tables, assuming a correction factor (k) equal to 1, how do the estimates change?
Laplace Smoothing:
where
- is the number of occurrences of the value together with the class ;
- is the total number of examples that belong to the class ;
- is the total number of possible values for the features;
- is the correction factor.
Problem 5
- We want to build a decision tree that predicts whether or not a student passes an exam. For this, we start from the following dataset, which contains 2 attributes: the type of coursework score (high, medium, low) and whether or not the student studied for the exam.
| Coursework | Studied | Exam |
|---|---|---|
| low | no | failed |
| low | yes | passed |
| medium | no | failed |
| medium | yes | passed |
| high | no | passed |
| high | yes | passed |
a) Compute the entropy ().
b) Compute the entropy .
c) Build a decision tree for the given dataset.
Problem 6
- The Manhattan distance between two points and is defined by the formula:
Consider the following set of points in the 2D plane:
The initial centroids are:
a) Apply a first step of the K-Means algorithm, using the Manhattan distance. Specify, for each point, which cluster it will belong to.
b) After the two clusters have been formed, recompute their centroids as the arithmetic mean of the points in the cluster (on each coordinate).
Problem 7
- We start from the following game tree, in which the nodes correspond to the MAX player and the nodes correspond to MIN.
[Figure: see the original statement (PDF, page 4). The tree is transcribed below: the root is a MAX node with three MIN children, each MIN node has three MAX children, and each MAX node has three leaves; leaf values are listed from left to right.]
△ (MAX, root)
├── ∇ (MIN)
│ ├── △ (MAX): 5, 1, 4
│ ├── △ (MAX): 2, 7, 9
│ └── △ (MAX): 3, 5, 7
├── ∇ (MIN)
│ ├── △ (MAX): 10, 2, 5
│ ├── △ (MAX): 5, 6, 4
│ └── △ (MAX): 8, 9, 2
└── ∇ (MIN)
├── △ (MAX): 3, 7, 2
├── △ (MAX): 7, 6, 5
└── △ (MAX): 9, 8, 9
a) Propagate the values in this game tree and show the path that will be chosen by a MINIMAX algorithm.
b) Check whether α / β pruning can be applied to this game tree. Highlight the possible prunings (specifying the α / β values for the nodes of interest) and specify the type of each pruning.
c) Suppose we have a game in which the MAX player has the ability to control the actions of the MIN player. More precisely, the MAX player will be able to force the MIN player to choose a particular action, but to do so will have to pay a cost (with the same weight as the values given in the leaves of the game tree). Argue whether or not it is optimal for the MAX player to use this ability, paying the cost , based on the game tree.
Problem 8
- Consider the following weighted graph as a representation of the state space of a search problem. We take to be the initial state of the problem and the final state of the problem. If the graph has the edge , this means that for state we have state as one of the next states, and vice versa (the graph can be traversed in both directions). We also know a heuristic function for which one value is missing.
[Figure: see the original statement (PDF, page 4). The graph is transcribed below: is the initial state and the final state; every edge is undirected.]
| Edge | A–B | A–C | B–C | B–D | C–D | D–E | D–F | D–G | E–G | F–G |
|---|---|---|---|---|---|---|---|---|---|---|
| Weight | 1 | 4 | 1 | 5 | 3 | 8 | 3 | 9 | 2 | 5 |
| State | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 10 | ? | 9 | 7 | 1.5 | 4.5 | 0 |
a) Specify what value must have for the heuristic to be admissible, and what value should have for the heuristic to be consistent. Justify your answers!
b) Propose a heuristic function for which the result of the A* algorithm applied to this search space is .
c) Consider two heuristic functions and that can be used with the A* algorithm, knowing that they are admissible. We want to combine these two functions so as to obtain a function . Can we construct a function that guarantees that fewer nodes are explored (compared with applying A* with the function or A* with the function ) and that guarantees the admissibility condition? Explain, and give an example of a definition for the function . You may illustrate this using the given graph.
Problem 9
- The following sentences in natural language are given:
- "If a program is correct, then it produces conforming results.
PROG1is a correct program. Therefore,PROG1produces conforming results."
a) Translate the above into propositional logic.
b) Prove the statement by contradiction (reductio ad absurdum) using resolution.
Note: resolution works only on sentences converted to CNF.
Problem 10
- Knowing that the following statements are true: "The bowed head is not cut off by the sword" (a Romanian proverb: "Capul plecat nu este tăiat de sabie"), and that "Marcel's head was cut off.", we want to prove that "Marcel did not have his head bowed.".
a) Rephrase the proverb as a logical sentence (in first-order logic).
b) Prove, using the resolution method, the claim that Marcel did not have his head bowed.
Attention: proofs that do not use the resolution method receive no points.
Problem 11
- Consider the following constraint satisfaction problem (CSP): the variables , and have the domains:
and we have the following constraints:
a) Is there any arc that is arc-consistent for the given problem?
b) Consider the arc consistency algorithm (AC-3). How is the queue of arcs initialised, and what is the maximum number of times an arc can be added to the queue?
c) Apply the arc consistency algorithm (AC-3) to update the domains of the variables.
Problem 12
- Three exams (Math, CS, Physics) must be scheduled in two rooms (S1, S2), in three time slots (T1, T2, T3). For this schedule we have the following constraints:
- Math and CS cannot be at the same time (they have students in common)
- Physics and CS cannot be in the same room
- A room cannot host two exams in the same time slot
a) Represent the problem as a CSP and explain how the variables can be represented and what the domains of the variables are.
b) State all the constraints in a formal way, using the variables proposed in the previous part.
c) Use backtracking to find a valid solution.
Problem 13
- In a grid world, Pacman navigates a dangerous environment full of ghosts and food pellets. However, the very large size of this state space makes it impossible to use the Q-learning method directly in its classical form — which requires storing the -values for every state-action pair.
To overcome this problem, we choose a strategy based on features: instead of storing every -value explicitly, Pacman uses a linear approximation function, in which the -value is computed from a set of features extracted from the current state and action.
The chosen features, and , for this representation are:
- : measures how close to, or exposed to, the ghosts Pacman is.
- : reflects the accessibility of the food pellets.
- : the number of ghosts located one step away from the current state.
- : the number of ghosts touched immediately after action .
- : the number of ghosts one step away from the position Pacman reaches after action .
- : the number of food pellets located one step away from the current state.
- : the number of food pellets consumed by performing action .
For this Pacman grid, the ghosts will always be stationary, and the action space is {left, right, up, down, stay}.
[Figure 1: Current state – see the original statement (PDF, page 6). The figure shows Pacman in the middle of a small walled area, with a red ghost in the cell directly to its left, a cyan ghost in the cell directly to its right, and a food pellet in the cell directly above it.]
a) You must compute the values of the features Fg and Fp for each available action: left, right, up, stay; in the state shown in Figure 1 (previous page).
b) After several episodes of Q-learning, Pacman has learned to evaluate actions using weights associated with each feature:
- : the weight associated with exposure to ghosts.
- : the weight associated with opportunities to consume food pellets.
Thus, the -value for an action in the current state is computed as:
The -values must be computed for each of the actions: left, right, up, stay from the current state shown in the figure.
c) A specific transition is now observed:
- Pacman starts from state and chooses the action up,
- It reaches the new state , where a food pellet has been consumed,
- It receives a reward .
From the new state , the possible actions are down and stay. A discount factor is assumed.
The new estimate of the -value for the initial state and action — that is, for — must be computed using the update rule:
d) Given the new estimated value for , and knowing the current -value estimated by the feature function, we use the weight update rule in Q-learning:
where:
- is the learning rate,
- is the prediction error,
- are the values of the features and for the action "up".
The final result is an updated set of weights that will guide Pacman's future decisions in a more intelligent way, adapted to the experience accumulated.
Starting from these relations, compute the values of the weights and .
Problem 14
- A classification model was evaluated on a test set and produced the following confusion matrix:
| Predicted A | Predicted B | Predicted C | |
|---|---|---|---|
| Actual A | 40 | 5 | 5 |
| Actual B | 4 | 35 | 11 |
| Actual C | 2 | 8 | 40 |
a) Compute the precision for each class (A, B, C).
b) Compute the macro-average F1 for this model, that is, the arithmetic mean of the F1-scores obtained for each class.
c) Compute the micro-average Recall for this model.
d) If the application that uses this classification model aims at the correct detection of cases of class C (for example, a rare and very serious disease), which metric should be maximised? What method can you propose to improve the performance for this class?
Problem 15
- In machine learning, similarity functions play a very important role both in automatic classification and in clustering.
Let be a set consisting of rectangular images of arbitrary dimensions, in which each pixel is represented as an integer from the set . Let be an image similarity function, defined as follows: = the number of square regions (in English, pixel patches) of size pixels that appear both in image and in image .
Clarification
The position at which such a square region appears will not be taken into account, only the image / colouring of the region itself. Such a region may appear in several positions within the same image, but the function will "count" a given square region only once if it appears [it does not matter exactly how many times] both in and in .
a) Prove that the function has the following property: there exist and a function ("mapping") such that for all and . In other words, the function is a kernel function. Here denotes the dot product of vectors.
b) Now let another similarity function be:
Prove that the function has the following property: there exist a set of images and a column vector such that , where denotes the transpose operation and is the matrix with the entries , for . In other words, the function is not positive semidefinite, and therefore it is not a kernel function (according to Mercer's theorem).
Hint
You may carry out the proof constructively, that is, by choosing the number conveniently and "constructing" / defining the images so that there exists with the property .
Problem 16
- In recommender systems, the similarity between users or between items plays an essential role in predicting preferences.
Consider a recommender system where:
- is the set of users;
- is the set of items (for example, films);
- is the rating matrix, where is the rating given by the user to the item , or is unknown if there is no rating.
We now define a similarity function between two users and as follows:
where is the set of items rated by both users, and is the mean of the ratings given by user .
Clarification
This similarity function is known as the Pearson correlation and is frequently used in user-based collaborative filtering.
a) Suppose we have the following rating matrix (with "-" indicating a missing rating):
Compute:
State which of the two users is more similar to user , taking .
b) Using user-based collaborative filtering, predict the rating that user might give to item , using only the values given by the other two users ( and ), based on the formula:
c) We discuss a limitation of the method above. What happens in the case of a new user who has not rated any item (the so-called cold-start problem)?
Propose a solution based on content-based filtering that could mitigate this problem.
Hint
You may assume that each item is described by a feature vector (for example, genres for films). Think about how this vector could be used to recommend items to a user with no previous ratings.
Problem 17
- Sometimes we need to compare rankings. How can we quantify the similarity between two rankings? For a music chart, such a measure will tell us: "How much do these two lists of top albums/tracks agree?"
We can view a ranking as a permutation , where represents the position (rank) of element .
A whole family of correlation statistics for ordinal data is based on the number of concordant and discordant pairs between two variables. We compare all possible pairs of elements and count how many are ordered in the same way and how many in the opposite order.
Concordant pair: if both rankings agree on the order of two elements (that is, element is ranked higher, or lower, than element in both lists).
Discordant pair: if the two rankings disagree (that is, element is higher than in one list but lower in the other).
Mathematically, the number of concordant pairs is:
Similarly, the number of discordant pairs is:
The PQ kernel between two rankings and is defined as:
We want to prove that is indeed a kernel, by showing how we can explicitly construct the feature map such that:
where denotes the dot product.
Translated by SOTA. The Romanian original is the official version and wins wherever the two differ. The original paper (17 problems) gives no point values. Its three figures (the game tree in Problem 7, the search graph in Problem 8 and the Pacman state in Problem 13) are transcribed as text; the drawings are in the original PDF. Published with the permission of Asociația Nitro, which runs ROAI (17 September 2026). If you organise this olympiad and would like the translation removed, email [email protected] and we will take it down.
At a glance
- You get
- Question paper (PDF, 10 pages).
- You submit
- Hand-written answers on paper.
- Scoring
- Not stated in the paper.
- Rules
- Paper-based test; the camp page describes the theory test as a 5-hour written test
- Format
- ROAI/ONIA 2025 national selection camp, one of three tests (theory plus two 5-hour coding tests).