## 3 Task Detection Problem  
A supervised learning problem is represented by a set of objects \(\mathbb{X}\), a set of possible answers \(Y\), and an unknown mapping \(f:\mathbb{X}\to Y\). The values of the mapping \(f\) are known only for objects from a finite set \(X\subset\mathbb{X}\), assuming \(X=\{x_{1},x_{2},\ldots,x_{s}\}\), where \(s\) denotes object counts in \(X\). In the supervised setting, we are given a training dataset \(U\) containing \(s\) examples, \(U=\{(x_{i},y_{i}):x_{i}\in X,\ y_{i}\in Y,y_{i}=f(x_{i})\}\)[37]. The task of a supervised learning algorithm is the construction of a mapping \(a:\mathbb{X}\to Y\) based on the \(U\) set, the \(a\) mapping should approximate \(f\) not only for objects from \(X\), for which the values of \(f(x_{i})\) are already known, but for all possible objects from \(\mathbb{X}\).  
If the set of all possible answers \(Y\) is given by \(\{1,2,\ldots,c\}\), assuming \(c\in\mathbb{N}\), then the supervised learning problem is a classification into \(c\) non-overlapping classes problem. In this case, the learned mapping \(a:\mathbb{X}\to Y\) that approximates \(f\) is called a _classifier_. In the classification problem, the \(\mathbb{X}\) set is considered to be divided into \(c\) subsets \(\mathbb{X}_{1},\mathbb{X}_{2},\ldots,\mathbb{X}_{c}\), and every subset \(\mathbb{X}_{j}\) contains objects belonging to the \(j\)-th class, \(j=(1,\ldots,c)\); in other words, \(\mathbb{X}_{j}=\{x\in X:f(x)=j\}\). More formally, \(\mathbb{X}=\bigcup_{j=1}^{c}\mathbb{X}_{j}\), \(c\) is the class count. If \(c=2\), the classification problem is called _binary_, and if \(c>2\), the problem is multiclass.  
In the current study, the finite set of objects \(X\) is given by source codes of programs solving unique programming exercises of different types, and the finite set of answers \(Y\) contains all known task types. The considered dataset [19] contains solutions to tasks of 11 different types. Hence, the task detection problem is a multiclass classification problem, and the solution to such a problem is the construction of a classifier \(a:\mathbb{X}\to Y\) that can determine the type of task from the \(Y\) set that a program solves. The training dataset is given by \(\{(x_{i},y_{i}):x_{i}\in X,\ y_{i}\in Y\}\), where \(x_{i}\in X\) denotes the \(i\)-th program source code, and \(y_{i}\in Y\) denotes the type of task the \(i\)-th program solves. The classification algorithms considered in this study take vectors as their input, so in Section 4 we describe the approaches to the conversion of source codes into vector-based representations.  
The dataset [19] contains 13,881 programs solving tasks of 11 types. The count of programs grouped by task type is shown in Figure 1, which illustrates the balance of classes in the considered dataset. Every unique exercise of a given type generated by DTA can be solved by a student using any algorithm they prefer. Table 1 lists the brief descriptions of task types.  
Figure 1: The count of programs grouped by task type.  
Examples of programs from the dataset in [19] that solve tasks of different types (see Table 1) using different algorithms are listed in Table 2. The table highlights the main difference between the task classification problem and the algorithm classification problem considered in [18; 28]. According to Table 2, completely different algorithms can implement the solution to the same task.  
As shown in Table 2, the first approach to implementing a recurrent function (type 4 in Table 1) uses a loop, and the second approach uses a Python function that calls itself, implementing the recursion manually. The first approach to implementing a binary format parser (type 11 in Table 1) uses a class with a hidden state, and the second approach uses a Python function that returns a parsed value and an offset [19].