Data Science and Artificial Intelligence
GATE DA topic:computing PYQs
Build your understanding with focused practice from past exam papers.
Questions 51–60 of 195. Imported answers require independent review unless marked reviewed.
Question 51
Open questionDAMSQ2 marksNeeds review
Consider a table Employee(EmpID, TeamID), where the column EmpID (ID of an employee) is the primary key. The column TeamID denotes the team ID of the team of which the employee is a member. TeamID is a NOT NULL column.
We want to display the size of the team (denoted as TeamSize) in which each employee is a member by using SQL. As an example, the desired output for the given Employee table is also shown in tabular form.
Employee
EmpID | TeamID |
|---|---|
1 | 8 |
2 | 8 |
3 | 8 |
4 | 7 |
5 | 7 |
6 | 9 |
Output
EmpID | TeamSize |
|---|---|
1 | 3 |
2 | 3 |
3 | 3 |
4 | 2 |
5 | 2 |
6 | 1 |
Which of the following is/are correct?
Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 52
Open questionDAMSQ2 marksNeeds review
Let
be a matrix, where
and
is the identity matrix of order
. Which of the following options is/are correct?Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 53
Open questionDAMSQ2 marksNeeds review
Let
be
independent random variables. Each of the random variables follows
distribution. Define
. Which of the following statements is/are correct?Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 54
Open questionDAMSQ2 marksNeeds review
Let
be a discrete valued random variable with cumulative distribution function
. Which of the following statements is/are correct?Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 55
Open questionDANAT2 marksNeeds review
Consider that Linear Ridge Regression is being used to learn a prediction function
, where
and Mean Absolute Error (MAE) is used to measure the prediction error. A weight of 0.20 is associated with the regularizer.At an intermediate step of the training process, assume that the parameter
. In the next step, for the input
, the predicted value of
is noted. Let the relation between
and the true value of
be
.The value of the overall regularized loss function for this instance is _____. (Rounded off to two decimal places)
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 56
Open questionDANAT2 marksNeeds review
Consider a fully-connected feed-forward multi-layer perceptron. It has 30 neurons in the input layer, followed by two hidden layers and an output layer. The first hidden layer has 4 neurons and the second hidden layer has 3 neurons. The output layer has only one neuron. Assume that no bias parameters are used.
The number of learnable parameters in the multi-layer perceptron is __________ . (Answer in integer)
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 57
Open questionDANAT2 marksNeeds review
A clinic specializes in testing for a disease D. The result of the test can be either positive or negative.
A study revealed that if a person suffers from the disease D, the test result in that clinic comes out positive 80% of the time, and negative 20% of the time. If a person is not suffering from the disease D, the test comes out positive 10% of the time and negative 90% of the time. It is also known that among the general population, the disease D occurs in 30% of the individuals.
If a person tests positive for D in that clinic, the probability that he/she actually suffers from the disease D is ________ . (Rounded off to two decimal places)
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 58
Open questionDANAT2 marksNeeds review
Consider the given Python program.
def fun(L, i=0):
if i >= len(L)-1:
return 0
if L[i] > L[i+1]:
L[i+1], L[i] = L[i], L[i+1]
return 1+fun(L, i+1)
else:
return fun(L, i+1)
data = [5, 3, 4, 1, 2]
count = 0
for _ in range(len(data)):
count += fun(data)
print(count)
The output of the program is __________. (Answer in integer)
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 59
Open questionDANAT2 marksNeeds review
Let there be two relations
and
as shown.
has three columns
,
and
.
has two columns
and
. | | |
|---|---|---|
P1 | Q1 | R1 |
P2 | Q2 | R2 |
P3 | Q3 | R2 |
| |
|---|---|
P1 | 10 |
P1 | 15 |
P2 | 20 |
P3 | 1 |
Consider that the following tuple relational calculus expression is evaluated.
The number of tuples that will be returned is ________ . (Answer in integer)
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 60
Open questionDANAT2 marksNeeds review
Let Account be a relation as shown.
AccNo | Balance |
|---|---|
A1 | 5000 |
A2 | 5000 |
A3 | 1000 |
A4 | 1500 |
A5 | 1800 |
Consider the given SQL query.
SELECT AccNo FROM Account AS A
WHERE (SELECT COUNT(*) FROM Account AS B
WHERE A.Balance < B.Balance) >= (SELECT COUNT(*)
FROM Account AS C WHERE A.Balance > C.Balance)
The number of rows returned by the SQL query is ________ . (Answer in integer)
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer