GATE 2026
65 questions
MCQ 33 · MSQ 14 · NAT 181-mark 30 · 2-mark 35
Questions 36–40 of 65
Let four points in three-dimensional space be:
, , and .
Hierarchical Agglomerative Clustering is used to cluster the above points. If Manhattan Distance is used as the distance metric during clustering, which of the following options indicates the two points that will be merged first?
, , and .
Hierarchical Agglomerative Clustering is used to cluster the above points. If Manhattan Distance is used as the distance metric during clustering, which of the following options indicates the two points that will be merged first?
Answer: (D)
The first merge joins the two points with the smallest distance. Manhattan distance is :
(The other two pairs are larger: and .)
The smallest distance is , for and .
Answer: (D)
(The other two pairs are larger: and .)
The smallest distance is , for and .
Answer: (D)
Which of the following statements is true for Ridge Regression?
Answer: (D)
Ridge Regression puts an penalty on the loss function. This penalty is the squared size of the weights. It does not use . So the option with the -norm is wrong. It also does not aim at parameters that have negative values.
The regularizer is there to guard against overfitting, which is the opposite of what the first option says. An overfit model works well on the training data but poorly on test data. The first option describes a model that works well on test data but poorly on training data, so it is wrong.
The main effect of this penalty is the well-known bias-variance tradeoff. The weights shrink towards zero. The model then fits the training data a little less perfectly, so bias goes up. But the model reacts much less to small changes in the training data, so variance goes down. This is usually a gain for generalization, most of all when the model without regularization would overfit.
Answer: (D)
The regularizer is there to guard against overfitting, which is the opposite of what the first option says. An overfit model works well on the training data but poorly on test data. The first option describes a model that works well on test data but poorly on training data, so it is wrong.
The main effect of this penalty is the well-known bias-variance tradeoff. The weights shrink towards zero. The model then fits the training data a little less perfectly, so bias goes up. But the model reacts much less to small changes in the training data, so variance goes down. This is usually a gain for generalization, most of all when the model without regularization would overfit.
Answer: (D)
Assume that a Creative person will Succeed if the person is also Disciplined (), but will not succeed otherwise. Now, consider the following statements:
Which of the following options is correct?
Which of the following options is correct?
Answer: (B)
The rule says: for a creative person, success happens exactly when the person is disciplined. In symbols this is , which is statement (ii). So (ii) is true.
Statement (i): . Take and , a person who is not creative but is disciplined. The rule says nothing about such a person, so it allows this case. Then but , so the biconditional is False. So (i) does not follow from the rule.
Statement (iii): . The right side is . So (iii) reduces to , which says every person is creative. That does not follow, since a person may be not creative.
Only (ii) is true.
Answer: (B)
Statement (i): . Take and , a person who is not creative but is disciplined. The rule says nothing about such a person, so it allows this case. Then but , so the biconditional is False. So (i) does not follow from the rule.
Statement (iii): . The right side is . So (iii) reduces to , which says every person is creative. That does not follow, since a person may be not creative.
Only (ii) is true.
Answer: (B)
A recursive function in Python is given.
Assume that a typical runtime stack is used to manage function calls. Each function call is pushed onto the stack and removed only after it finishes execution.
Which of the following options denotes the total number of function calls (i.e., the total number of stack activations), including the initial call, to compute mystery
def mystery(n):
if n <= 0:
return 1
else:
return mystery(n-1) + mystery(n-2) Now, consider the following function call: mystery(4) Assume that a typical runtime stack is used to manage function calls. Each function call is pushed onto the stack and removed only after it finishes execution.
Which of the following options denotes the total number of function calls (i.e., the total number of stack activations), including the initial call, to compute mystery
Answer: (C)
Let stand for the total number of calls (the first call included) made to evaluate . Every call that is not a base case makes two more calls, and it also counts as one call itself:
when , and when (base case: only the call itself, with no more recursion).
Answer: 15
when , and when (base case: only the call itself, with no more recursion).
Answer: 15
Consider a directed graph , where is the finite set of vertices and is the set of directed edges between the vertices. may contain cycles but there is no self-loop. Further, may not be strongly connected.
Let be the graph obtained by reversing the directions of all the edges in without changing the set of vertices.
Assume that Breadth First Search (BFS) or Depth First Search (DFS) from any given vertex of a graph visits only the reachable vertices from in that graph.
Which of the following statements must always be true, regardless of the structure of
Let be the graph obtained by reversing the directions of all the edges in without changing the set of vertices.
Assume that Breadth First Search (BFS) or Depth First Search (DFS) from any given vertex of a graph visits only the reachable vertices from in that graph.
Which of the following statements must always be true, regardless of the structure of
Answer: (D)
Say is reached from in . Then there is a directed path in . Reversing every edge on it gives a directed path in . So is reachable from in , and BFS from visits every reachable vertex, in whatever order. So (D) is always true.
For A, B and C take with a single edge . Then has the edge .
- (A): BFS of from reaches , but DFS of from reaches only . False.
- (B): the two visited sets are and , which differ. False.
- (C): the BFS order is and the DFS order is . Reversing does not give . False.
Answer: (D)
For A, B and C take with a single edge . Then has the edge .
- (A): BFS of from reaches , but DFS of from reaches only . False.
- (B): the two visited sets are and , which differ. False.
- (C): the BFS order is and the DFS order is . Reversing does not give . False.
Answer: (D)