GATE DA 2025 question paper with solutions
All 65 questions of the GATE 2025 Data Science and Artificial Intelligence paper, in order, with the official answer key from IIT Roorkee.
Download the solved paper (PDF, 2.3 MB)- questions · 100 marks
- 65questions · 100 marks
- official answer key
- IIT Roorkeeofficial answer key
- question types
- 35 MCQ · 18 MSQ · 12 NATquestion types
GATE DA 2025 answer key
| Question | Type | Marks | Answer |
|---|---|---|---|
| Q.1 | MCQ | 1 | A |
| Q.2 | MCQ | 1 | B |
| Q.3 | MCQ | 1 | C |
| Q.4 | MCQ | 1 | A |
| Q.5 | MCQ | 1 | C |
| Q.6 | MCQ | 2 | B |
| Q.7 | MCQ | 2 | B |
| Q.8 | MCQ | 2 | A |
| Q.9 | MCQ | 2 | C |
| Q.10 | MCQ | 2 | A |
| Q.11 | MCQ | 1 | C |
| Q.12 | MCQ | 1 | B |
| Q.13 | MCQ | 1 | C |
| Q.14 | MCQ | 1 | A |
| Q.15 | MCQ | 1 | A |
| Q.16 | MCQ | 1 | C |
| Q.17 | MCQ | 1 | C |
| Q.18 | MCQ | 1 | D |
| Q.19 | MCQ | 1 | A |
| Q.20 | MCQ | 1 | A |
| Q.21 | MCQ | 1 | A |
| Q.22 | MCQ | 1 | A |
| Q.23 | MCQ | 1 | A |
| Q.24 | MSQ | 1 | A, B, C |
| Q.25 | MSQ | 1 | B, D |
| Q.26 | MSQ | 1 | C, D |
| Q.27 | MSQ | 1 | C |
| Q.28 | MSQ | 1 | A, B |
| Q.29 | MSQ | 1 | A, C |
| Q.30 | MSQ | 1 | B, D |
| Q.31 | NAT | 1 | 0.25 |
| Q.32 | NAT | 1 | 0.5 |
| Q.33 | NAT | 1 | 3 |
| Q.34 | NAT | 1 | 0.285 to 0.287 |
| Q.35 | NAT | 1 | 0.39 to 0.41 |
| Q.36 | MCQ | 2 | B |
| Q.37 | MCQ | 2 | D |
| Q.38 | MCQ | 2 | A |
| Q.39 | MCQ | 2 | C |
| Q.40 | MCQ | 2 | A |
| Q.41 | MCQ | 2 | A |
| Q.42 | MCQ | 2 | A |
| Q.43 | MCQ | 2 | C |
| Q.44 | MCQ | 2 | C |
| Q.45 | MCQ | 2 | C |
| Q.46 | MCQ | 2 | D |
| Q.47 | MCQ | 2 | B |
| Q.48 | MSQ | 2 | A, C |
| Q.49 | MSQ | 2 | C, D |
| Q.50 | MSQ | 2 | A, B |
| Q.51 | MSQ | 2 | B, C, D |
| Q.52 | MSQ | 2 | A, D |
| Q.53 | MSQ | 2 | B, C |
| Q.54 | MSQ | 2 | A, C |
| Q.55 | MSQ | 2 | B, C |
| Q.56 | MSQ | 2 | B, C |
| Q.57 | MSQ | 2 | B, D |
| Q.58 | MSQ | 2 | A, C, D |
| Q.59 | NAT | 2 | 0 |
| Q.60 | NAT | 2 | 100 |
| Q.61 | NAT | 2 | 66.6 to 66.7 |
| Q.62 | NAT | 2 | 1 |
| Q.63 | NAT | 2 | 160 |
| Q.64 | NAT | 2 | 24 |
| Q.65 | NAT | 2 | 75 |
General Aptitude Q.1 to Q.10
- Q.1MCQ · 1 mark
Courage : Bravery :: Yearning : ______
Select the most appropriate option to complete the analogy.- (A)
Longing
- (B)
Yelling
- (C)
Yawning
- (D)
Glaring
Official answer: A
- (A)
- Q.2MCQ · 1 mark
We ______ tennis in the lawn when it suddenly started to rain.
Select the most appropriate option to complete the above sentence.
- (A)
have been playing
- (B)
had been playing
- (C)
would have been playing
- (D)
could be playing
Official answer: B
- (A)
- Q.3MCQ · 1 mark
A 4 × 4 digital image has pixel intensities () as shown in the figure. The number of pixels with is:
Tap to open full size- (A)
3
- (B)
8
- (C)
11
- (D)
9
Official answer: C
- (A)
- Q.4MCQ · 1 mark
In the given figure, the numbers associated with the rectangle, triangle, and ellipse are 1, 2, and 3, respectively. Which one among the given options is the most appropriate combination of P, Q, and R ?
Tap to open full size- (A)
P = 6; Q = 5; R = 3
- (B)
P = 5; Q = 6; R = 3
- (C)
P = 3; Q = 6; R = 6
- (D)
P = 5; Q = 3; R = 6
Official answer: A
- (A)
- Q.5MCQ · 1 mark
A rectangle has a length L and a width W, where L > W. If the width, W, is increased by 10%, which one of the following statements is correct for all values of L and W?
- (A)
Perimeter increases by 10%.
- (B)
Length of the diagonals increases by 10%.
- (C)
Area increases by 10%.
- (D)
The rectangle becomes a square.
Official answer: C
- (A)
- Q.6MCQ · 2 marks
Column-I has statements made by Shanthala; and, Column-II has responses given by Kanishk.
Column-I:
P. This house is in a mess.
Q. I am not happy with the marks given to me.
R. Politics is a subject I avoid talking about.
S. I don’t know what this word means.Column-II:
1. Alright, I won’t bring it up during our conversations.
2. Well, you can easily look it up.
3. No problem, let me clear it up for you.
4. Don’t worry, I will take it up with your teacher.Identify the option that has the correct match between Column-I and Column-II.
Tap to open full size- (A)
P – 2; Q – 3; R – 1; S – 4
- (B)
P – 3; Q – 4; R – 1; S – 2
- (C)
P – 4; Q – 1; R – 2; S – 3
- (D)
P – 1; Q – 2; R – 4; S – 3
Official answer: B
- (A)
- Q.7MCQ · 2 marks
Weight of a person can be expressed as a function of their age. The function usually varies from person to person. Suppose this function is identical for two brothers, and it monotonically increases till the age of 50 years and then it monotonically decreases. Let and (in years) denote the ages of the brothers and .
Which one of the following statements is correct about their age on the day when they attain the same weight?
- (A)
- (B)
- (C)
- (D)
Either or
Official answer: B
- (A)
- Q.8MCQ · 2 marks
A regular dodecagon (12-sided regular polygon) is inscribed in a circle of radius r cm as shown in the figure. The side of the dodecagon is d cm. All the triangles (numbered 1 to 12) in the figure are used to form squares of side r cm and each numbered triangle is used only once to form a square.
The number of squares that can be formed and the number of triangles required to form each square, respectively, are:
Note: The figure shown is representative.
Tap to open full size- (A)
3; 4
- (B)
4; 3
- (C)
3; 3
- (D)
3; 2
Official answer: A
- (A)
- Q.9MCQ · 2 marks
If a real variable satisfies , then the value of is:
- (A)
- (B)
- (C)
- (D)
Official answer: C
- (A)
- Q.10MCQ · 2 marks
The number of patients per shift () consulting Dr. Gita in her past 100 shifts is shown in the figure. If the amount she earns is Rs. , what is the average amount (in Rs.) she has earned per shift in the past 100 shifts?
Note: The figure shown is representative.
Tap to open full size- (A)
6,100
- (B)
6,300
- (C)
6,000
- (D)
6,500
Official answer: A
- (A)
Data Science and Artificial Intelligence Q.11 to Q.65
- Q.11MCQ · 1 mark
Suppose and are random variables. The conditional expectation of given is denoted by . Then equals
- (A)
- (B)
- (C)
- (D)
Official answer: C
- (A)
- Q.12MCQ · 1 mark
The number of additions and multiplications involved in performing Gaussian elimination on any upper triangular matrix is of the order
- (A)
- (B)
- (C)
- (D)
Official answer: B
- (A)
- Q.13MCQ · 1 mark
The sum of the elements in each row of is 1. If , which one of the following statements is correct (for )?
- (A)
The equation has no solution
- (B)
The equation has exactly two solutions
- (C)
The equation has infinitely many solutions
- (D)
The equation has a unique solution
Official answer: C
- (A)
- Q.14MCQ · 1 mark
Let , . Let denote the derivative of evaluated at . What is the value of ? (Note: ! denotes factorial)
- (A)
- (B)
- (C)
- (D)
Official answer: A
- (A)
- Q.15MCQ · 1 mark
Let and be any two propositions. Consider the following propositional statements.
, , , ,
where denotes conjunction (AND operation), denotes disjunction (OR operation), and denotes negation (NOT operation). Which one of the following options is correct?
(Note: denotes logical equivalence)
- (A)
- (B)
- (C)
- (D)
Official answer: A
- (A)
- Q.16MCQ · 1 mark
If a relational decomposition is not dependency-preserving, which one of the following relational operators will be executed more frequently in order to maintain the dependencies?
- (A)
Selection
- (B)
Projection
- (C)
Join
- (D)
Set union
Official answer: C
- (A)
- Q.17MCQ · 1 mark
Consider the following three relations:
Car (model, year, serial, color) Make (maker, model) Own (owner, serial)A tuple in Car represents a specific car of a given model, made in a given year, with a serial number and a color. A tuple in Make specifies that a maker company makes cars of a certain model. A tuple in Own specifies that an owner owns the car with a given serial number. Keys are underlined; (owner, serial) together form key for Own. (⋈ denotes natural join)
Which one of the following options describes what the above expression computes?
- (A)
All owners of a red car, a car made by ABC, or a red car made by ABC
- (B)
All owners of more than one car, where at least one car is red and made by ABC
- (C)
All owners of a red car made by ABC
- (D)
All red cars made by ABC
Official answer: C
- (A)
- Q.18MCQ · 1 mark
Consider a hash table of size 10 with indices , with the hash function
where linear probing is used to handle collisions. The hash table is initially empty and then the following sequence of keys is inserted into the hash table: . The indices where the keys 14 and 15 are stored are, respectively
- (A)
2 and 5
- (B)
2 and 6
- (C)
4 and 5
- (D)
4 and 6
Official answer: D
- (A)
- Q.19MCQ · 1 mark
Let be a continuous random variable whose cumulative distribution function (CDF) , for some , is given as follows:
If the median of is 3, then what is the value of ?
- (A)
2
- (B)
1
- (C)
- (D)
0
Official answer: A
- (A)
- Q.20MCQ · 1 mark
Let , where is a standard normal random variable, and , are two unknown constants. It is given that , , , where denotes the expectation of random variable . The values of are:
- (A)
- (B)
- (C)
- (D)
Official answer: A
- (A)
- Q.21MCQ · 1 mark
It is given that for an exponentially distributed random variable with , where denotes the expectation of . What is the value of ? (ln denotes natural logarithm)
- (A)
- (B)
- (C)
- (D)
Official answer: A
- (A)
- Q.22MCQ · 1 mark
Consider designing a linear classifier , on a dataset , , , . Recall that the sign function outputs if the argument is positive, and if the argument is non-positive. The parameters and are updated as per the following training algorithm: , whenever . In other words, whenever the classifier wrongly predicts a sample from the dataset, gets updated to , and likewise gets updated to . Consider the case , . Then
- (A)
- (B)
- (C)
- (D)
Official answer: A
- (A)
- Q.23MCQ · 1 mark
Consider the following Python declarations of two lists.
A=[1,2,3] B=[4,5,6]Which one of the following statements results in A= [1, 2, 3, 4, 5, 6]?
- (A)
A.extend(B)
- (B)
A.append(B)
- (C)
A.update(B)
- (D)
A.insert(B)
Official answer: A
- (A)
- Q.24MSQ · 1 mark
Consider two functions and . Both functions are differentiable at a point . Which of the following functions is/are ALWAYS differentiable at ? The symbol denotes product and the symbol denotes composition of functions.
- (A)
- (B)
- (C)
- (D)
Official answer: A, B, C
- (A)
- Q.25MSQ · 1 mark
Which of the following statements is/are correct?
- (A)
has a unique set of orthonormal basis vectors
- (B)
does not have a unique set of orthonormal basis vectors
- (C)
Linearly independent vectors in are orthonormal
- (D)
Orthonormal vectors are linearly independent
Official answer: B, D
- (A)
- Q.26MSQ · 1 mark
Which of the following statements is/are correct in a Bayesian network?
- (A)
Variable elimination is an approximate inference algorithm
- (B)
Gibbs sampling is an exact inference algorithm
- (C)
Variable elimination is used to determine conditional probabilities
- (D)
Rejection sampling is an approximate inference algorithm
Official answer: C, D
- (A)
- Q.27MSQ · 1 mark
For which of the following inputs does binary search take time in the worst case?
- (A)
An array of integers in any order
- (B)
A linked list of integers in any order
- (C)
An array of integers in increasing order
- (D)
A linked list of integers in increasing order
Official answer: C
- (A)
- Q.28MSQ · 1 mark
Let , where is the identity matrix and , . Which of the following options is/are correct?
- (A)
Rank of is
- (B)
is invertible
- (C)
is an eigenvalue of
- (D)
has a negative eigenvalue
Official answer: A, B
- (A)
- Q.29MSQ · 1 mark
Suppose that insertion sort is applied to the array and it takes exactly two swaps to sort the array. Select all possible values of .
- (A)
10
- (B)
12
- (C)
14
- (D)
16
Official answer: A, C
- (A)
- Q.30MSQ · 1 mark
Let and be two sets of objects. Let be a measure of dissimilarity between two objects and . Consider the following definitions of dissimilarity between and .
Which of the following statements is/are correct?
- (A)
Single Linkage Clustering uses DIS-1
- (B)
Single Linkage Clustering uses DIS-2
- (C)
Complete Linkage Clustering uses DIS-2
- (D)
Complete Linkage Clustering uses DIS-1
Official answer: B, D
- (A)
- Q.31NAT · 1 mark
There are three boxes containing white balls and black balls.
Box-1 contains 2 black and 1 white balls.
Box-2 contains 1 black and 2 white balls.
Box-3 contains 3 black and 3 white balls.
In a random experiment, one of these boxes is selected, where the probability of choosing Box-1 is , Box-2 is , and Box-3 is . A ball is drawn at random from the selected box. Given that the ball drawn is white, the probability that it is drawn from Box-2 is ____________ (Round off to two decimal places)
Official answer: 0.25
- Q.32NAT · 1 mark
(Round off to one decimal place)
Official answer: 0.5
- Q.33NAT · 1 mark
On a relation named Loan of a bank:
loan_number branch_name amount L11 Banjara Hills 90000 L14 Kondapur 50000 L15 SR Nagar 40000 L22 SR Nagar 25000 L23 Balanagar 80000 L25 Kondapur 70000 L19 SR Nagar 65000 the following SQL query is executed.
SELECT L1.loan_number FROM Loan L1 WHERE L1.amount > (SELECT MAX (L2.amount) FROM Loan L2 WHERE L2.branch_name = 'SR Nagar');The number of rows returned by the query is ______ (Answer in integer)
Tap to open full sizeOfficial answer: 3
- Q.34NAT · 1 mark
Given data of the form , we fit a model using linear least-squares regression. The optimal value of is ____________. (Round off to three decimal places)
Official answer: 0.285 to 0.287
- Q.35NAT · 1 mark
The naive Bayes classifier is used to solve a two-class classification problem with class-labels , . Suppose the prior probabilities are and . Assuming a discrete feature space with
for a specific feature vector . The probability of misclassifying is ______ (Round off to two decimal places)
Official answer: 0.39 to 0.41
- Q.36MCQ · 2 marks
Let , , where is a normal random variable with mean and variance . The variance of is
- (A)
1
- (B)
2
- (C)
3
- (D)
4
Official answer: B
- (A)
- Q.37MCQ · 2 marks
Let be such that . Which one of the following statements is ALWAYS correct?
- (A)
is invertible
- (B)
Determinant of is
- (C)
The sum of the diagonal elements of is
- (D)
and have the same rank
Official answer: D
- (A)
- Q.38MCQ · 2 marks
Let be a set of linearly independent vectors in . Let the -th element of matrix be given by , . Which one of the following statements is correct?
- (A)
is invertible
- (B)
is a singular value of
- (C)
Determinant of is
- (D)
for some non-zero
Official answer: A
- (A)
- Q.39MCQ · 2 marks
Consider the cumulative distribution function (CDF) of a random variable :
The value of is
- (A)
0.625
- (B)
0.25
- (C)
0.5
- (D)
0.5625
Official answer: C
- (A)
- Q.40MCQ · 2 marks
A random variable is said to be distributed as Bernoulli(), denoted by Bernoulli(), if , for . Let , where Bernoulli(), be independent and identically distributed random variables with . The value of , after approximation through Central Limit Theorem, is given by (Recall that )
- (A)
- (B)
- (C)
- (D)
Official answer: A
- (A)
- Q.41MCQ · 2 marks
For , the floor function is denoted by and defined as follows
where is an integer. Let , where is an exponentially distributed random variable with mean , where denotes natural logarithm. For any positive integer , one can write the probability of the event as follows
The value of is
- (A)
0.1
- (B)
0.01
- (C)
0.5
- (D)
0.434
Official answer: A
- (A)
- Q.42MCQ · 2 marks
Consider the neural network shown in the figure with
inputs:
weights:
output:denotes the ReLU function, .
Given , ,
,which one of the following is correct?
Tap to open full size- (A)
∂y/∂a = 8, ∂y/∂f = 0
- (B)
∂y/∂a = 1, ∂y/∂f = 0
- (C)
∂y/∂a = 1, ∂y/∂f = −1
- (D)
∂y/∂a = 2, ∂y/∂f = −1
Official answer: A
- (A)
- Q.43MCQ · 2 marks
Consider game trees Tree-1 and Tree-2 as shown. The first level is a MAX agent and the second level is a MIN agent. The value in the square node is the output of the utility function.
For what ranges of and , the right child of node and the right child of node will be pruned by alpha-beta pruning algorithm?
Tap to open full size- (A)
and
- (B)
and
- (C)
and
- (D)
and
Official answer: C
- (A)
- Q.44MCQ · 2 marks
The state graph shows the action cost along the edges and the heuristic function h associated with each state. Suppose A* algorithm is applied on this state graph using priority queue to store the frontier. In what sequence are the nodes expanded?
Tap to open full size- (A)
S,A,E,C,B,D,G
- (B)
S,E,A,C,B,D,G
- (C)
S,A,E,B,C,D,G
- (D)
S,A,B,E,C,D,G
Official answer: C
- (A)
- Q.45MCQ · 2 marks
A random experiment consists of throwing 100 fair dice, each die having six faces numbered 1 to 6. An event represents the set of all outcomes where at least one of the dice shows a 1. Then,
- (A)
- (B)
- (C)
- (D)
Official answer: C
- (A)
- Q.46MCQ · 2 marks
Consider a fact table in an OLAP application:
Facts(D1, D2, val), whereD1andD2are its dimension attributes andvalis a dependent attribute. Suppose attributeD1takes 3 values andD2takes 2 values, and all combinations of these values are present in the tableFacts. How many tuples are there in the result of the following query?SELECT D1, D2, sum(val) FROM Facts GROUP BY CUBE (D1, D2);- (A)
1
- (B)
6
- (C)
9
- (D)
12
Official answer: D
- (A)
- Q.47MCQ · 2 marks
Consider the following Python code snippet.
A={"this","that"} B={"that","other"} C={"other","this"} while "other" in C: if "this" in A: A,B,C=A-B,B-C,C-A if "that" in B: A,B,C=C|A,A|B,B|CWhen the above program is executed, at the end, which of the following sets contains "this"?
- (A)
Only A
- (B)
Only B
- (C)
Only C
- (D)
A, C
Official answer: B
- (A)
- Q.48MSQ · 2 marks
Which of the following statements is/are correct about the rectified linear unit (ReLU) activation function defined as , where ?
- (A)
ReLU is continuous everywhere
- (B)
ReLU is differentiable everywhere
- (C)
ReLU is not differentiable at
- (D)
, for all
Official answer: A, C
- (A)
- Q.49MSQ · 2 marks
Consider the function , . Which of the following statements is/are correct?
- (A)
The maximum value of is attained at
- (B)
The minimum value of is attained at
- (C)
The maximum value of is
- (D)
The minimum value of the derivative of is attained at
Official answer: C, D
- (A)
- Q.50MSQ · 2 marks
Let be a system of orthonormal vectors in . Consider the matrix . Which of the following statements is/are correct?
- (A)
Singular values of are also its eigenvalues
- (B)
Singular values of are either 0 or 1
- (C)
Determinant of is 1
- (D)
is invertible
Official answer: A, B
- (A)
- Q.51MSQ · 2 marks
Let be a twice-differentiable function and suppose its second derivative satisfies for all . Which of the following statements is/are ALWAYS correct?
- (A)
has a local minima
- (B)
There does not exist and , , such that
- (C)
has at most one global minimum
- (D)
has at most one local minimum
Official answer: B, C, D
- (A)
- Q.52MSQ · 2 marks
An matrix with real entries satisfies the property: , for all , where denotes the Euclidean norm. Which of the following statements is/are ALWAYS correct?
- (A)
must be orthogonal
- (B)
, where denotes the identity matrix, is the only solution
- (C)
The eigenvalues of are either or
- (D)
has full rank
Official answer: A, D
- (A)
- Q.53MSQ · 2 marks
Consider designing a linear binary classifier , on the following training data: Class-1: , Class-2: . Hard-margin support vector machine (SVM) formulation is solved to obtain and . Which of the following options is/are correct?
- (A)
and
- (B)
The number of support vectors is 3
- (C)
The margin is
- (D)
Training accuracy is 98%
Official answer: B, C
- (A)
- Q.54MSQ · 2 marks
Consider a coin-toss experiment where the probability of head showing up is . In the coin toss, let if head appears, and if tail appears. Consider where is the total number of independent coin tosses. Which of the following statements is/are correct?
- (A)
- (B)
- (C)
As increases, variance of decreases
- (D)
Variance of does not depend on
Official answer: A, C
- (A)
- Q.55MSQ · 2 marks
Consider a two-class problem in with class labels red and green. Let and be the means of the two classes. Given test sample , a classifier calculates the squared Euclidean distance (denoted by ) between and the means of the two classes and assigns the class label that the sample is closest to. That is, the classifier computes and assigns the label red to if , and green otherwise. Which of the following statements is/are correct?
- (A)
The sample is assigned the label green if
- (B)
is a linear function of
- (C)
, where and are functions of and
- (D)
is a quadratic polynomial in
Official answer: B, C
- (A)
- Q.56MSQ · 2 marks
Consider the following two relations, named
CustomerandPerson, in a database:Person ( aadhaar CHAR(12) PRIMARY KEY, name VARCHAR(32)); Customer ( name VARCHAR(32), email VARCHAR(32) PRIMARY KEY, phone CHAR(10), aadhaar CHAR(12), FOREIGN KEY (aadhaar) REFERENCES Person(aadhaar));Which of the following statements is/are correct?
- (A)
aadhaaris a candidate key in theCustomerrelation - (B)
phonecan be NULL in theCustomerrelation - (C)
aadhaaris a candidate key in thePersonrelation - (D)
aadhaarcan be NULL in thePersonrelation
Official answer: B, C
- (A)
- Q.57MSQ · 2 marks
Consider a database relation R with attributes ABCDEFG, and having the following functional dependencies:
A → BCEF E → DG BC → A
Which of the following statements is/are correct?
- (A)
A is the only candidate key of R
- (B)
A, BC are the candidate keys of R
- (C)
A, BC, E are the candidate keys of R
- (D)
Relation R is not in Boyce-Codd Normal Form (BCNF)
Official answer: B, D
- (A)
- Q.58MSQ · 2 marks
Let be a simple, unweighted, and undirected graph. A subset of the vertices and edges of are shown below.
It is given that is a shortest path between and ; is a shortest path between and ; is a shortest path between and . Which of the following is/are NOT the edges of ?
Tap to open full size- (A)
- (B)
- (C)
- (D)
Official answer: A, C, D
- (A)
- Q.59NAT · 2 marks
Let be such that for all . Then ______ (Answer in integer)
Official answer: 0
- Q.60NAT · 2 marks
Let be a dataset of observations where each . It is given that . The covariance matrix computed from has eigenvalues , . Let be the direction of maximum variance with .
The value of ______
(Answer in integer)
Official answer: 100
- Q.61NAT · 2 marks
A bag contains 5 white balls and 10 black balls. In a random experiment, balls are drawn from the bag one at a time with replacement. Let denote the total number of black balls drawn in the experiment.
The expectation of denoted by ______
(Round off to one decimal place)
Official answer: 66.6 to 66.7
- Q.62NAT · 2 marks
Consider the following tables, Loan and Borrower, of a bank.
Query: where denotes natural join.
The number of tuples returned by the above relational algebra query is ______ (Answer in integer)
Tap to open full sizeOfficial answer: 1
- Q.63NAT · 2 marks
Consider the following Python code snippet.
def f(a,b): if (a==0): return b if (a%2==1): return 2*f((a-1)/2,b) return b+f(a-1,b) print(f(15,10))The value printed by the code snippet is ____________ (Answer in integer)
Official answer: 160
- Q.64NAT · 2 marks
Consider the following pseudocode.
Create empty stack S Set x=0, flag=0, sum=0 Push x onto S while (S is not empty){ if (flag equals 0){ Set x = x+1 Push x onto S} if (x equals 8): Set flag=1 if (flag equals 1){ x = Pop(S) if (x is odd): Pop(S) Set sum = sum + x} } Output sumThe value of
sumoutput by a program executing the above pseudocode is ______________ (Answer in integer)Official answer: 24
- Q.65NAT · 2 marks
Consider a directed graph , where and . Suppose the adjacency list of each vertex is in decreasing order of vertex number, and depth-first search (DFS) is performed at vertex 0. The number of vertices that will be discovered after vertex 50 is ______ (Answer in integer)
Official answer: 75