GATE 2026
65 questions
MCQ 33 · MSQ 14 · NAT 181-mark 30 · 2-mark 35
Questions 56–60 of 65
Consider a fully-connected feed-forward multi-layer perceptron. It has neurons in the input layer, followed by two hidden layers and an output layer. The first hidden layer has neurons and the second hidden layer has 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)
The number of learnable parameters in the multi-layer perceptron is ________. (Answer in integer)
Answer: 135
There are no bias parameters. So the parameters in each layer are the neurons in the previous layer the neurons in the current layer:
Input () Hidden 1 ():
Hidden 1 () Hidden 2 ():
Hidden 2 () Output ():
Sum of all:
Answer: 135
Input () Hidden 1 ():
Hidden 1 () Hidden 2 ():
Hidden 2 () Output ():
Sum of all:
Answer: 135
A clinic specializes in testing for a disease . The result of the test can be either positive or negative.
A study revealed that if a person suffers from the disease , the test result in that clinic comes out positive of the time, and negative of the time. If a person is not suffering from the disease , the test comes out positive of the time and negative of the time. It is also known that among the general population, the disease occurs in of the individuals.
If a person tests positive for in that clinic, the probability that he/she actually suffers from the disease is ________. (Rounded off to two decimal places)
A study revealed that if a person suffers from the disease , the test result in that clinic comes out positive of the time, and negative of the time. If a person is not suffering from the disease , the test comes out positive of the time and negative of the time. It is also known that among the general population, the disease occurs in of the individuals.
If a person tests positive for in that clinic, the probability that he/she actually suffers from the disease is ________. (Rounded off to two decimal places)
Answer: 0.76 to 0.78
Use Bayes' theorem:
Total probability of a positive test:
Probability of disease given positive:
Answer: 0.77
Total probability of a positive test:
Probability of disease given positive:
Answer: 0.77
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 )Answer: 8
The call looks at adjacent elements . If they are out of order, it swaps them and adds to the count. Then it calls itself with . This is exactly one bubble-sort pass, and it counts the swaps made in that pass. The outer loop runs a fresh pass times, since . It adds the swap count each time.
:
Pass 1: swap, swap, swap, swap , swaps.
Pass 2: no swap, swap, swap, no swap , swaps.
Pass 3: swap, swap, no swap, no swap , swaps.
Passes 4, 5: the array is already sorted, so each pass has swaps.
Total:
Answer: 8
:
Pass 1: swap, swap, swap, swap , swaps.
Pass 2: no swap, swap, swap, no swap , swaps.
Pass 3: swap, swap, no swap, no swap , swaps.
Passes 4, 5: the array is already sorted, so each pass has swaps.
Total:
Answer: 8
Let there be two relations and as shown. has three columns and has two columns and .
Consider that the following tuple relational calculus expression is evaluated.
The number of tuples that will be returned is ________. (Answer in integer )
Consider that the following tuple relational calculus expression is evaluated.
The number of tuples that will be returned is ________. (Answer in integer )
Answer: 2 to 3
First, simplify the expression. The part is always true for any , because we can pick . So it puts no real limit on the result. The query becomes: .
Given: and .
Now check each for a matching with :
- : has rows with (both ). This is a match, so the tuple is included.
- : has row with . This is a match, so the tuple is included.
- : the only row with has , which is not . There is no match, so the tuple is excluded.
Answer: 2
Given: and .
Now check each for a matching with :
- : has rows with (both ). This is a match, so the tuple is included.
- : has row with . This is a match, so the tuple is included.
- : the only row with has , which is not . There is no match, so the tuple is excluded.
Answer: 2
Let Account be a relation as shown.
Consider the given SQL query.
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)Answer: 3
Take each account . The query tests whether the number of accounts with a strictly higher balance is the number with a strictly lower balance. Balances: .
Accounts that pass: , so rows.
Answer: 3
Accounts that pass: , so rows.
Answer: 3