Decision Trees: past questions

24 questions · 60.5 marks · 8 papers. Try each one before checking.

Solve them and check answers →Read the notes first

Aug 2023 (day not given)

Question Q12 MCQ · 1.5 marks

Consider a binary classification problem and a decision tree that is being trained to classify the points. In one of the internal nodes in this tree, $75\%$ of the data-points belong to one of the two classes and the rest belong to the other class. You are not given the information about which class is more numerous in this node.
Do you have enough information to find the entropy of this node?
  1. Yes
  2. No

Question Q13 SA · 3 marks

Consider a binary classification problem and a decision tree that is being trained to classify the points. In one of the internal nodes in this tree, $75\%$ of the data-points belong to one of the two classes and the rest belong to the other class. You are not given the information about which class is more numerous in this node.
If the answer to the previous questions is "Yes", find the entropy of the node. Use $\log_2$ and enter your answer correct to three decimal places. If the answer to the previous question is "No", enter $-1$ as your answer.

Type your answer on the interactive page.

Question Q5 MSQ · 4 marks

Which of the following statements are true about the decision tree algorithm?
  1. Decision trees are prone to overfit if the maximum depth is set too low.
  2. Decision trees are prone to underfit if the maximum depth is set too low.
  3. Decision trees are sensitive to small perturbations in the dataset and can result in different tree structures.
  4. Decision trees can handle both numerical and categorical features.

Aug 2025 (03 Aug)

Question Q18 SA · 3 marks

Suppose you want to build a decision tree to help diagnose a certain disease based on patient data. You have a dataset of $1000$ patients labeled as either "positive" or "negative". Here, positive represents patients with the disease and negative represents no disease. One of the feature used to diagnose is headache. Below is the breakdown of the patients reporting headache: Headache present: $300$ positive, $50$ negative. Headache not present: $100$ positive, $550$ negative. Use the following values if required: $\log_2(0.4)=-1.32$, $\log_2(0.6)=-0.74$, $\log_2(0.86)=-0.22$, $\log_2(0.14)=-2.84$, $\log_2(0.15)=-2.74$, $\log_2(0.85)=-0.23$. Note: Use $\log_2$ for the entropy calculations.
What is the entropy of the root node? Enter the answer correct to two decimal places.

Type your answer on the interactive page.

Question Q19 SA · 4 marks

Suppose you want to build a decision tree to help diagnose a certain disease based on patient data. You have a dataset of $1000$ patients labeled as either "positive" or "negative". Here, positive represents patients with the disease and negative represents no disease. One of the feature used to diagnose is headache. Below is the breakdown of the patients reporting headache: Headache present: $300$ positive, $50$ negative. Headache not present: $100$ positive, $550$ negative. Use the following values if required: $\log_2(0.4)=-1.32$, $\log_2(0.6)=-0.74$, $\log_2(0.86)=-0.22$, $\log_2(0.14)=-2.84$, $\log_2(0.15)=-2.74$, $\log_2(0.85)=-0.23$. Note: Use $\log_2$ for the entropy calculations.
What is the information gain for choosing the feature "headache" for splitting at the root node? Enter the answer correct to two decimal places.

Type your answer on the interactive page.

Question Q12 MCQ · 3 marks

Consider the following decision tree for a binary classification problem with two features $f_1$ and $f_2$ [figure in the bank; redrawn here from its description [ADDED]: root "$f_1\le1.5$"; Yes leads to "$f_1<0$" whose Yes leads to "$f_2>1.5$" (Yes: leaf 1, No: leaf 0) and whose No is leaf 0; the root's No leads to "$f_2<0$" (Yes: leaf 1, No: leaf 0)].
YesNoYesNoYesNoYesNo10f2 > 1.5 ?0f1 < 0 ?10f2 < 0 ?f1 ≤ 1.5 ?
The tree as described in the bank.
Which among the following represents the correct decision boundary for the decision tree? Note: Here $+$ represents the label $1$ and $-$ represents the label $0$. (The four options are pictures in the original; each is described here from the bank's image descriptions.)
  1. Picture 1: $+$ (green) at $0<f_1\le1.5,\ f_2>1.5$ and at $f_1>1.5,\ f_2<0$. All else $-$.
  2. Picture 2: $+$ at $f_1<0,\ f_2>1.5$ and at $f_1>1.5,\ f_2<0$. All else $-$.
  3. Picture 3: $+$ at $f_1<0,\ f_2>1.5$ and at $f_1>1.5,\ f_2>0$. All else $-$.
  4. Picture 4: $+$ over the whole region $f_1\le1.5,\ f_2>0$. All else $-$.

Question Q13 SA · 2 marks

Consider the following decision tree for a binary classification problem with two features $f_1$ and $f_2$ [figure in the bank; redrawn here from its description [ADDED]: root "$f_1\le1.5$"; Yes leads to "$f_1<0$" whose Yes leads to "$f_2>1.5$" (Yes: leaf 1, No: leaf 0) and whose No is leaf 0; the root's No leads to "$f_2<0$" (Yes: leaf 1, No: leaf 0)].
YesNoYesNoYesNoYesNo10f2 > 1.5 ?0f1 < 0 ?10f2 < 0 ?f1 ≤ 1.5 ?
The tree as described in the bank.
What will be the prediction for the new datapoint $(2, 2)$?

Type your answer on the interactive page.

Apr 2026 (06 Apr)

Question Q9 SA · 2 marks

Consider a node in a decision tree that has $5$ data-points. The $i^{\text{th}}$ data-point is represented by a feature-label pair $(x_i, y_i)$, where $y_i\in\{-1,1\}$.
$i$$x_i$$y_i$
14-1
2101
3131
4251
538-1
Consider the split $x\le 7$ at the parent node resulting in left and right child nodes. The left child node has all data points for which $x\le7$ is true. Entropy is used to determine the purity of the nodes. Recall that the formula for the entropy of a node is $E(p) = -p\log_2 p-(1-p)\log_2(1-p)$ where $p$ is the fraction of positive data-points in the node. Use at least three digits after the decimal point in all intermediate calculations.
Find the entropy of the parent node. Enter your answer correct to two decimal places.

Type your answer on the interactive page.

Question Q10 SA · 2 marks

Consider a node in a decision tree that has $5$ data-points. The $i^{\text{th}}$ data-point is represented by a feature-label pair $(x_i, y_i)$, where $y_i\in\{-1,1\}$.
$i$$x_i$$y_i$
14-1
2101
3131
4251
538-1
Consider the split $x\le 7$ at the parent node resulting in left and right child nodes. The left child node has all data points for which $x\le7$ is true. Entropy is used to determine the purity of the nodes. Recall that the formula for the entropy of a node is $E(p) = -p\log_2 p-(1-p)\log_2(1-p)$ where $p$ is the fraction of positive data-points in the node. Use at least three digits after the decimal point in all intermediate calculations.
Find the entropy of the right child. Enter your answer correct to two decimal places.

Type your answer on the interactive page.

Question Q11 SA · 2 marks

Consider a node in a decision tree that has $5$ data-points. The $i^{\text{th}}$ data-point is represented by a feature-label pair $(x_i, y_i)$, where $y_i\in\{-1,1\}$.
$i$$x_i$$y_i$
14-1
2101
3131
4251
538-1
Consider the split $x\le 7$ at the parent node resulting in left and right child nodes. The left child node has all data points for which $x\le7$ is true. Entropy is used to determine the purity of the nodes. Recall that the formula for the entropy of a node is $E(p) = -p\log_2 p-(1-p)\log_2(1-p)$ where $p$ is the fraction of positive data-points in the node. Use at least three digits after the decimal point in all intermediate calculations.
Find the information gain. Enter your answer correct to two decimal places.

Type your answer on the interactive page.

Aug 2026 (14 Aug)

Question Q6 MCQ · 3 marks

A node in a decision tree contains an equal number of positive and negative training examples. What is the entropy of this node?
  1. $0$
  2. $0.5$
  3. $1$
  4. It depends on the total number of training examples.

Question Q1 MCQ · 4 marks

Consider a binary classification problem in $\mathbb{R}^2$. The feature space is partitioned into the following four regions: $R_1=\{(x_1,x_2)\mid x_1\ge0,x_2\ge0\}$, $R_2=\{(x_1,x_2)\mid x_1<0,x_2\ge0\}$, $R_3=\{(x_1,x_2)\mid x_1<0,x_2<0\}$, $R_4=\{(x_1,x_2)\mid x_1\ge0,x_2<0\}$. Each region contains the same number of observations. All observations in regions $R_1$ and $R_3$ belong to the positive class, while all observations in regions $R_2$ and $R_4$ belong to the negative class. A decision tree is constructed using axis-aligned binary splits of the form $x_1\le t$ or $x_2\le t$ where $t$ is any real number. At each node, the split is chosen to maximize the information gain based on entropy. What is the minimum number of binary questions (splits) that the decision tree must ask to obtain leaf nodes with zero entropy?
  1. $3$
  2. $2$
  3. $4$
  4. It is impossible using only axis-aligned splits.

Dec 2024 (01 Dec)

Question Q19 MCQ · 2 marks

Consider a binary classification problem in which a decision tree is classifying data points into two classes, A and B. In a particular node of the tree, $60\%$ of the data points belong to class A, while the remaining $40\%$ belong to class B.
Do you have enough information to find the entropy of this node?
  1. Yes
  2. No

Question Q20 SA · 4 marks

Consider a binary classification problem in which a decision tree is classifying data points into two classes, A and B. In a particular node of the tree, $60\%$ of the data points belong to class A, while the remaining $40\%$ belong to class B.
If the answer to the previous question is "Yes," calculate the entropy of this node to three decimal places. If the answer to the previous question is "No," enter $-1$ as your answer.

Type your answer on the interactive page.

Aug 2024 (04 Aug)

Question Q5 SA · 3 marks

Consider the following decision boundary obtained for a decision tree trained on a dataset in $\mathbb{R}^3$ for a binary classification problem. All green points (label $1$) lie inside the box and the red points (label $0$) are outside it. What it is the minimum depth of this tree? Recall that the depth is the number of edges on the longest path from the root to a leaf. [Figure in the bank: a 3D plot with an axis-aligned rectangular box; green points ($1$) inside all six faces, red points ($0$) outside.]

Type your answer on the interactive page.

Question Q19 SA · 1 marks

If $a$ and $b$ are integers, answer the given subquestions that follow. Hint: Plotting the dataset helps. Consider the following training dataset for a binary classification problem with the data-points in $\mathbb{R}^2$, the labels in the set $\{0,1\}$ and a decision tree grown from it that achieves zero training error: $$X=\begin{bmatrix}-2&-0.9&0.9&2&-2&-0.9&0.9&2\\1&0.9&0.9&1&-1&-0.9&-0.9&-1\end{bmatrix},\qquad y=\begin{bmatrix}1&1&0&0&0&0&1&1\end{bmatrix}^T$$ [In the bank's figure: on the left, a 2D plot of the 8 points (quadrants II and IV carry label 1, quadrants I and III carry label 0); on the right, a tree: root "$x_1<a$"; Yes leads to "$x_2<b$" (Yes: leaf 0, No: leaf 1); No leads to "$x_2<b$" (Yes: leaf 1, No: leaf 0).]
[ADDED] Redrawn from that description: the tree, and the 8 points (green = label 1, red = label 0).
YesNoYesNoYesNo01x2 < b ?10x2 < b ?x1 < a ?
The tree as described in the bank.
x1x2
The 8 training points. Green: label 1 (upper left and lower right). Red: label 0 (upper right and lower left).
What is the value of $a$?

Type your answer on the interactive page.

Question Q20 SA · 1 marks

If $a$ and $b$ are integers, answer the given subquestions that follow. Hint: Plotting the dataset helps. Consider the following training dataset for a binary classification problem with the data-points in $\mathbb{R}^2$, the labels in the set $\{0,1\}$ and a decision tree grown from it that achieves zero training error: $$X=\begin{bmatrix}-2&-0.9&0.9&2&-2&-0.9&0.9&2\\1&0.9&0.9&1&-1&-0.9&-0.9&-1\end{bmatrix},\qquad y=\begin{bmatrix}1&1&0&0&0&0&1&1\end{bmatrix}^T$$ [In the bank's figure: on the left, a 2D plot of the 8 points (quadrants II and IV carry label 1, quadrants I and III carry label 0); on the right, a tree: root "$x_1<a$"; Yes leads to "$x_2<b$" (Yes: leaf 0, No: leaf 1); No leads to "$x_2<b$" (Yes: leaf 1, No: leaf 0).]
[ADDED] Redrawn from that description: the tree, and the 8 points (green = label 1, red = label 0).
YesNoYesNoYesNo01x2 < b ?10x2 < b ?x1 < a ?
The tree as described in the bank.
x1x2
The 8 training points. Green: label 1 (upper left and lower right). Red: label 0 (upper right and lower left).
What is the value of $b$?

Type your answer on the interactive page.

Question Q21 SA · 1 marks

If $a$ and $b$ are integers, answer the given subquestions that follow. Hint: Plotting the dataset helps. Consider the following training dataset for a binary classification problem with the data-points in $\mathbb{R}^2$, the labels in the set $\{0,1\}$ and a decision tree grown from it that achieves zero training error: $$X=\begin{bmatrix}-2&-0.9&0.9&2&-2&-0.9&0.9&2\\1&0.9&0.9&1&-1&-0.9&-0.9&-1\end{bmatrix},\qquad y=\begin{bmatrix}1&1&0&0&0&0&1&1\end{bmatrix}^T$$ [In the bank's figure: on the left, a 2D plot of the 8 points (quadrants II and IV carry label 1, quadrants I and III carry label 0); on the right, a tree: root "$x_1<a$"; Yes leads to "$x_2<b$" (Yes: leaf 0, No: leaf 1); No leads to "$x_2<b$" (Yes: leaf 1, No: leaf 0).]
[ADDED] Redrawn from that description: the tree, and the 8 points (green = label 1, red = label 0).
YesNoYesNoYesNo01x2 < b ?10x2 < b ?x1 < a ?
The tree as described in the bank.
x1x2
The 8 training points. Green: label 1 (upper left and lower right). Red: label 0 (upper right and lower left).
Find the entropy of the root node. Use $\log_2$.

Type your answer on the interactive page.

Question Q22 SA · 2 marks

If $a$ and $b$ are integers, answer the given subquestions that follow. Hint: Plotting the dataset helps. Consider the following training dataset for a binary classification problem with the data-points in $\mathbb{R}^2$, the labels in the set $\{0,1\}$ and a decision tree grown from it that achieves zero training error: $$X=\begin{bmatrix}-2&-0.9&0.9&2&-2&-0.9&0.9&2\\1&0.9&0.9&1&-1&-0.9&-0.9&-1\end{bmatrix},\qquad y=\begin{bmatrix}1&1&0&0&0&0&1&1\end{bmatrix}^T$$ [In the bank's figure: on the left, a 2D plot of the 8 points (quadrants II and IV carry label 1, quadrants I and III carry label 0); on the right, a tree: root "$x_1<a$"; Yes leads to "$x_2<b$" (Yes: leaf 0, No: leaf 1); No leads to "$x_2<b$" (Yes: leaf 1, No: leaf 0).]
[ADDED] Redrawn from that description: the tree, and the 8 points (green = label 1, red = label 0).
YesNoYesNoYesNo01x2 < b ?10x2 < b ?x1 < a ?
The tree as described in the bank.
x1x2
The 8 training points. Green: label 1 (upper left and lower right). Red: label 0 (upper right and lower left).
If $E_R$ is the entropy of the root and $E_L$ is the weighted entropy of all the leaves, what is $E_R-E_L$? Use $\log_2$.

Type your answer on the interactive page.

Question Q23 SA · 1 marks

If $a$ and $b$ are integers, answer the given subquestions that follow. Hint: Plotting the dataset helps. Consider the following training dataset for a binary classification problem with the data-points in $\mathbb{R}^2$, the labels in the set $\{0,1\}$ and a decision tree grown from it that achieves zero training error: $$X=\begin{bmatrix}-2&-0.9&0.9&2&-2&-0.9&0.9&2\\1&0.9&0.9&1&-1&-0.9&-0.9&-1\end{bmatrix},\qquad y=\begin{bmatrix}1&1&0&0&0&0&1&1\end{bmatrix}^T$$ [In the bank's figure: on the left, a 2D plot of the 8 points (quadrants II and IV carry label 1, quadrants I and III carry label 0); on the right, a tree: root "$x_1<a$"; Yes leads to "$x_2<b$" (Yes: leaf 0, No: leaf 1); No leads to "$x_2<b$" (Yes: leaf 1, No: leaf 0).]
[ADDED] Redrawn from that description: the tree, and the 8 points (green = label 1, red = label 0).
YesNoYesNoYesNo01x2 < b ?10x2 < b ?x1 < a ?
The tree as described in the bank.
x1x2
The 8 training points. Green: label 1 (upper left and lower right). Red: label 0 (upper right and lower left).
What is the predicted label of the test data-point $\begin{bmatrix}3\\-4\end{bmatrix}$?

Type your answer on the interactive page.

Dec 2023 (day not given)

Question Q11 SA · 4 marks

You are working on a decision tree algorithm to classify whether a bank loan applicant will default on their loan based on several financial factors. The dataset includes Credit Score, Annual Income, Loan Amount, Loan Term as features. The target variable is binary: $1$ for "Default" and $0$ for "No Default." You have a dataset of $500$ loan applicants, and you want to construct a decision tree to predict loan default. To determine the first split (root node), you'll use the information gain as the criterion. Here's the distribution of loan default in the dataset: Default: $150$ applicants, No Default: $350$ applicants. Calculate the Entropy for the initial dataset.

Type your answer on the interactive page.

Question Q14 SA · 2 marks

If the proportion of points belonging to class $1$ in a node is $p$, for what value of $p$ is the node's entropy maximum?

Type your answer on the interactive page.

Mar 2025 (16 Mar)

Question Q4 MCQ · 2 marks

$p$ is the proportion of points with label $1$ in some node in a decision tree. Which of the following statements are true?
  1. As the value of $p$ increases from $0$ to $1$, the impurity of the node increases.
  2. As the value of $p$ increases from $0$ to $1$, the impurity of the node decreases.
  3. The impurity of the node does not depend on $p$.
  4. $p = 0.5$ correspond to the case of maximum impurity.

Question Q6 MCQ · 4 marks

Consider the following feature ($x$) along with its label ($y$):
$x$$y$
11
-11
21
-20
30
41
If you are provided with the following two questions, which one should you choose for the first (top) node of the decision tree?
(a) $x \le -2$
(b) $x \le -1$
Recall: $\text{Information Gain}=\text{Entropy}(D)-\gamma\,\text{Entropy}(D_{\text{Yes}})-(1-\gamma)\,\text{Entropy}(D_{\text{No}})$
Use the following values if required: $\log_2(3/4)=-0.41$, $\log_2(4/5)=-0.32$, $\log_2(1/5)=-2.32$, $\log_2(1/4)=-2$, $\log_2(1/2)=-1$.
  1. (a)
  2. (b)
  3. Insufficient information

Check your answers →

Weeks covering this topic

Other MLT topics