GATE 2020
Question 1 
Two straight lines are drawn perpendicular to each other in XY plane. If α and β are the acute angles the straight lines make with the Xaxis, then α+β is ______.
60°  
120°  
180°  
90° 
We know a + α + β = 180
α + β = 180  90
α + β = 90
Question 2 
The total revenue of a company during 20142018 is shown in the bar graph. If the total expenditure of the company in each year is 500 million rupees, then the aggregate profit or loss (in percentage) on the total expenditure of the company during 20142018 is ______.
20% profit  
20% loss  
16.67% loss  
16.67% profit 
20142018
Total expenditure = 500 million/year = 500 × 5 = 2500 million
Revenue total (from the graph)
= 400 + 500 + 600 + 700 + 800
= 3000 million
Profit = 3000  2500 = 500
⟹ 500/2500 = 20% profit
Question 3 
The figure below shows an annular ring with outer and inner radii as b and a, respectively. The annular space has been painted in the form of blue colour circles touching the outer and inner periphery of annular space. If maximum n number of circles can be painted, then the unpainted area available in annular space is ______.
π[(b^{2}  a^{2}) + π/4(b  a)^{2}]  
π[(b^{2}  a^{2})  π/4(b  a)^{2}]  
π[(b^{2}  a^{2})  n(b  a)^{2}]  
π[(b^{2}  a^{2}) + n(b  a)^{2}] 
Area of nonpainted between 2 circles area of part 1 = πb^{2}  πa^{2} = π(b^{2}  a^{2})
Radius of painted circles = ba/2
Area of painted circle = π(ba/2)^{2}
For n circles = nπ(ba/2)^{2}
Nonpainted area = π[b^{2}  a^{2} n/4(b  a)^{2}]
Question 4 
Goods and Services Tax (GST) is an indirect tax introduced in India in 2017 that is imposed on the supply of goods and services, and it subsumes all indirect taxes except few. It is a destinationbased tax imposed on goods and services used, and it is not imposed at the point of origin from where goods come. GST also has a few components specific to state governments, central government and Union Territories (UTs).
Which one of the following statements can be inferred from the given passage?
GST includes all indirect taxes.
 
GST is imposed at the point of usage of goods and services.
 
GST does not have a component specific to UT.  
GST is imposed on the production of goods and services.

Question 5 
Select the word that fits the analogy:
Cook : Cook :: Fly : _____
Flyer  
Flying  
Flew  
Flighter 
FlyFlyer
Question 6 
The drawn of the 21st century witnessed the melting glaciers oscillating between giving too much and too little to billions of people who depend on them for fresh water. The UN climate report estimates that without deep cuts to manmade emissions, at least 30% of the northern hemisphere’s surface permafrost could melt by the end of the century. Given this situation of imminent global exodus of billions of people displaced by rising seas, nationstates need to rethink their carbon footprint for political concerns, if not for environmental ones.
Which one of the following statements can be inferred from the given passage?
Nationstates are responsible for providing fresh water to billions of people.  
Billions of people are affected by melting glaciers.
 
Nationstates do not have environmental concerns.  
Billions of people are responsible for manmade emissions. 
Question 7 
There are multiple routes to reach from node 1 to node 2, as shown in the network.
The cost of travel on an edge between two nodes is given in rupees. Nodes ‘a’, ‘b’, ‘c’, ‘d’, ‘e’, and ‘f’ are toll booths. The toll price at toll booths marked ‘a’ and ‘e’ is Rs.200, and is Rs.100 for the other toll booths. Which is the cheapest route from node 1 to node 2?
1fe2
 
1fb2  
1b2  
1ac2

1  f  e  2 ─ 100 + 100 + 200 = 400
1  f  b  2 ─ 100 + 0 + 200 = 300 ⇾ shortest [Answer]
1  b  2 ─ 300 + 200 = 500
1  a  c ─ 2  200 + 100 + 100 = 400
Question 8 
Raman is confident of speaking English _____ six months as he has been practicing regularly_____the last three weeks.
for, in  
during, for
 
for, since
 
within, for

Question 9 
If P = 3, R = 27, T = 243, then Q+S = ______.
80  
110  
40  
90 
P=3^{1}, Q=3^{2}, R=3^{3}, S=3^{4}, T=3^{5}
Q+S = 3^{2} + 3^{4} = 9+81 = 90
Question 10 
His knowledge of the subject was excellent but his classroom performance was ______.
good
 
praiseworthy  
extremely poor  
desirable

Question 11 
Let G be a group of 35 elements. Then the largest possible size of a subgroup of G other than G itself is ______.
7 
If ‘H” is a subgroup of finite group (G,*) then O(H) is the divisor of O(G).
Given that the order of group is 35. Its divisors are 1,5,7,35.
It is asked that the size of largest possible subgroup other than G itself will be 7.
Question 12 
Consider a relational database containing the following schemas.
The primary key of each table is indicated by underlying the constituent fields.
SELECT s.sno, s.sname FROM Suppliers s, Catalogue c WHERE s.sno = c.sno AND Cost > (SELECT AVG (cost) FROM Catalogue WHERE pno = ‘P4’ GROUP BY pno);
The number of rows returned by the above SQL query is
0  
5  
4  
2 
AVG(COST)

225
The outer query “select s.sno, s.sname from suppliers s, catalogue c where s.sno=c.sno” returns:
SNO SNAME

S1 M/s Royal furniture
S1 M/s Royal furniture
S1 M/s Royal furniture
S2 M/s Balaji furniture
S2 M/s Balaji furniture
S3 M/s Premium furniture
S3 M/s Premium furniture
S3 M/s Premium furniture
S3 M/s Premium furniture
So, the final result of the query is:
SN SNAME

S2 M/s Balaji furniture
S3 M/s Premium furniture
S3 M/s Premium furniture
S3 M/s Premium furniture
Therefore, 4 rows will be returned by the query.
Question 13 
Consider the language L = {a^{n} n≥0} ∪ {a^{n}b^{n} n≥0} and the following statements.
 I. L is deterministic contextfree.
II. L is contextfree but not deterministic contextfree.
III. L is not LL(k) for any k.
Which of the above statements is/are TRUE?
II only  
III only  
I only  
I and III only 
We can make DPDA for this.
L is not LL(k) for any “k” look aheads. The reason is the language is a union of two languages which have common prefixes. For example strings {aa, aabb, aaa, aaabbb,….} present in language. Hence the LL(k) parser cannot parse it by using any lookahead “k” symbols.
Question 14 
For parameters a and b, both of which are ω(1), T(n) = T(n^{1/a})+1, and T(b)=1.
Then T(n) is
θ(log_{a} log_{b} n)  
θ(log_{b} log_{a} n)
 
θ(log_{2} log_{2} n)
 
θ(log_{ab} n)

T(n) = [T(n^{1/a2})+1] + 1
= [T(n^{1/a3})+1] + 2
= [T(n^{1/a3})] + 3
= [T(n^{1/ak})] + b
= log_{b} n = a^{k}
= log log_{b} n = k log a
= k= log_{a} log_{b} n
T(n)=1+log_{a} log_{b} n
T(n)=O(log_{a} log_{b} n)
Question 15 
Consider the following statements.
 I. If L_{1} ∪ L_{2} is regular, then both L_{1} and L_{2} must be regular.
II. The class of regular languages is closed under infinite union.
Which of the above statements is/are TRUE?
Both I and II
 
II only  
Neither I nor II  
I only

Assume L_{1} = {a^{n} b^{n}  n>0} and L_{2} = complement of L_{1}
L_{1} and L_{2} both are DCFL but not regular, but L_{1} U L_{2} = (a+b)* which is regular.
Hence even though L_{1} U L_{2} is regular, L_{1} and L_{2} need not be always regular.
Statement II is wrong.
Assume the following finite (hence regular) languages.
L_{1} = {ab}
L_{2} = {aabb}
L_{3} = {aaabbb}
.
.
.
L_{100} = {a^{100} b^{100}}
.
.
.
If we take infinite union of all above languages i.e,
{L_{1} U L_{2} U ……….L_{100} U ……}
then we will get a new language L = {a^{n} b^{n}  n>0}, which is not regular.
Hence regular languages are not closed under infinite UNION.
Question 16 
Consider the following statements.
 I. Daisy chaining is used to assign priorities in attending interrupts.
II. When a device raises a vectored interrupt, the CPU does polling to identify the source of the interrupt.
III. In polling, the CPU periodically checks the status bits to know if any device needs its attention.
IV. During DMA, both the CPU and DMA controller can be bus masters at the same time.
Which of the above statements is/are TRUE?
I and IV only  
I and II only
 
III only  
I and III only

StatementII is false as vectored interrupt doesn’t involve polling but nonvectored interrupt involves polling.
StatementIII is true as polling means that CPU periodically checks the status bits to know if any device needs attention.
StatementIV is false as during DMA only one of the CPU or DMA can be bus master at a time.
Question 17 
A direct mapped cache memory of 1 MB has a block ize of 256 bytes. The cache has an access time of 3 ns and a hit rate of 94%. During a cache miss, it takes 20 ns to bring the first word of a block from the main memory, while each subsequent word takes 5 ns. The word size is 64 bits. The average memory access time in ns (round off to 1 decimal place) is _____.
13.5 
Hit ratio of cache = 0.94
Word size is 64 bits = 8 bytes.
Cache line size = 256 bytes = 32 words
Main memory access time = 20ns(time for first word) + 155ns(time for remaining 31 words, 31*5 = 155ns) = 175 ns
Average access time = h1*t1 + (1h1)(t1+t2) = t1 +(1h1)t2
⇒ 3 + (0.06)(175) = 13.5 ns
Question 18 
Let R be the set of all binary relations on the set {1,2,3}. Suppose a relation is chosen from R at random. The probability that the chosen relation is reflexive (round off to 3 decimal places) is _____.
0.125 
The number of reflexive relations is 2^(n^2n).
The total number of relations on a set with n elements is 2^ (n^2).
The probability of choosing the reflexive relation out of set of relations is
= 2^(n^2n) /2^ (n^2)
= 2^( n^2n n^2)
= 2^(n)
Given n=3, the probability will be 2^{n} = ⅛ = 0.125
Question 19 
Which one of the following is used to represent the supporting manyone relationships of a weak entity set in an entityrelationship diagram?
Ovals that contain underlined identifiers
 
Rectangles with double/bold border  
Diamonds with double/bold border
 
Ovals with double/bold border

Question 20 
Consider allocation of memory to a new process. Assume that none of the existing holes in the memory will exactly fit the process’s memory requirement. Hence, a new hole of smaller size will be created if allocation is made in any of the existing holes. Which one of the following statements is TRUE?
The hole created by worst fit is always larger than the hole created by first fit.  
The hole created by best fit is never larger than the hole created by first fit.
 
The hole created by first fit is always larger than the hole created by next fit.  
The hole created by next fit is never larger than the hole created by best fit. 
Question 21 
Consider the following grammar.
S → aSBd B → b
The number of reduction steps taken by a bottomup parser while accepting the string aaadbbb is _______.
7 
7 reductions total.
Question 22 
Consider the following statements about process state transitions for a system using preemptive scheduling.
 I. A running process can move to ready state.
II. A ready process can move to running state.
III. A blocked process can move to running state.
IV. A blocked process can move to ready state.
Which of the above statements are TRUE?
II and III only  
I, II and III only
 
I, II, III and IV
 
I, II and IV only

Question 23 
The preorder traversal of a binary search tree is 15, 10, 12, 11, 20, 18, 16, 19.
Which one of the following is the postorder traversal of the tree?
20, 19, 18, 16, 15, 12, 11, 10  
11, 12, 10, 16, 19, 18, 20, 15
 
10, 11, 12, 15, 16, 18, 19, 20  
19, 16, 18, 20, 11, 12, 10, 15 
Postorder:
11, 12, 10, 16, 19, 18, 20, 15
Question 24 
A multiplexer is placed between a group of 32 registers and an accumulator to regulate data movement such that at any given point in time the content of only one register will move to the accumulator. The minimum number of select lines needed for the multiplexer is _____.
5 
A 2^{5}x1 Multiplexer with 5 select lines selects one of the 32(= 2^{5}) registers at a time depending on the selection input.
The content from the selected register will be transferred through the output line to the Accumulator.
Question 25 
Consider a double hashing scheme in which the primary hash function is h_{1}(k) = k mod 23, and the secondary hash function is h_{2}(k) = 1 + (k mod 19). Assume that the table size is 23. Then the address returned by probe 1 in the probe sequence (assume that the probe sequence begins at probe 0) for key value k=90 is _______.
13 
• K=90
• h_{1}(k) = k mod 23 = 90 mod 23 = 21
• In case of collision, we need to use secondary hash function.
• h_{2}(k) = 1 + (k mod19) = 1 + 90mod19 = 1+14 = 15
• Now (21+15) mod 23 = 36 mod 23 = 13
• So the address is 13.
Question 26 
Consider the functions
 I. e^{x}
II. x^{2}sin x
III. √(x^{3}+1)
Which of the above functions is/are increasing everywhere in [0,1]?
II and III only  
III only  
II only  
I and III only 
I. e^{x}
II. f'(x) = e^{x}
f'(x)<0 on the interval [0,1] so this is not an increasing function.
II. x^{2}sinx
f'(x) = 2x  cosx
at x=0, f'(0) = 2(0)  1 = 1 < 0
f(x) = x^{2}  sinx is decreasing over some interval, increasing over some interval as cosx is periodic.
As the question is asked about increasing everywhere II is false.
III. √(x^{3}+1) = (x^{3}+1)^{1/2}
f'(x) = 1/2(3x^{2}/√(x^{3}+1))>0
f(x) is increasing over [0,1].
Question 27 
What is the worst case time complexity of inserting n elements into an empty linked list, if the linked list needs to be maintained in sorted order?
θ(n log n)  
θ(n^{2})  
θ(1)  
θ(n) 
Total number of elements inserted into an empty linked list is O(n). So, it will take O(n) time in the worst case.
After inserting elements into an empty linked list we have to perform sorting operation.
To get minimum time complexity to perform sorting order is merge sort. It will give O(nlogn) time complexity only.
Let head be the first node of the linked list to be sorted and head Reference be the pointer to head.
The head in MergeSort as the below implementation changes next links to sort the linked lists (not data at the nodes), so head node has to be changed if the data at the original head is not the smallest value in the linked list.
Note: There are other sorting methods also will give decent time complexity but quicksort will give O(n^{2}) and heap sort will not be suitable to apply.
Question 28 
Assume that you have made a request for a web page through your web browser to a web server. Initially the browser cache is empty. Further, the browser is configured to send HTTP requests in nonpersistent mode. The web page contains text and five very small images. The minimum number of TCP connections required to display the web page completely in your browser is ______.
6 
Hence, 1 Text + 5 Image = 6 Objects
Question 29 
Consider the following C program.
#includeint main () { int a [4] [5] = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20}}; printf (“%d\n”, *(*(a+**a+2) +3)); return (0); }
The output of the program is _______.
19 
#include
int main()
{
int a[4][5] = { {1,2,3,4,5},
{6,7,8,9,10},
{11,12,13,14,15},
{16,17,18,19,20}
};
printf("%d\n",a); //880 (consider base address = 880)
printf("%d\n",*a); //880
printf("%d\n",**a); //1
printf("%d\n",**a+2); //3
printf("%d\n",a+**a+2); //940
printf("%d\n",*(a+**a+2));//940
printf("%d\n",*(a+**a+2)+3);//952
printf("%d\n",*(*(a+**a+2)+3));//19
return 0;
}
Question 30 
Consider the following data path diagram.
Consider an instruction: R0 ← R1 + R2. The following steps are used to execute it over the given data path. Assume that PC is incremented appropriately. The subscripts r and w indicate read and write operations, respectively.
1. R2_{r}, TEMP1_{r}, ALU_{add}, TEMP2_{w} 2. R1_{r}, TEMP1_{w} 3. PC_{r}, MAR_{w}, MEM_{r} 4. TEMP2_{r}, RO_{w} 5. MDR_{r}, IR_{w}
Which one of the following is the correct order of execution of the above steps?
3, 5, 1, 2, 4
 
3, 5, 2, 1, 4
 
1, 2, 4, 3, 5  
2, 1, 4, 5, 3

First the PC value has to be moved into MAR (step3 from the given sequence), then the instruction has to be fetched(step5 from the given sequence). Then Temp1 is loaded with the value of R1 (step2 from the given sequence), then the addition operation is performed by accessing the R2 value directly and adding it to Temp1 value and storing the result in Temp2 (step1 from the given sequence).
Finally the result from Temp2 is stored in R0 (step4 from the given sequence).
Hence the correct sequence is (3, 5, 2, 1, 4).
Question 31 
Consider the following statements.
 I. Symbol table is accessed only during lexical analysis and syntax analysis.
II. Compilers for programming languages that support recursion necessarily need heap storage for memory allocation in the runtime environment.
III. Errors violating the condition ‘any variable must be declared before its use’ are detected during syntax analysis.
Which of the above statements is/are TRUE?
II only  
I only  
I and III only
 
None of I, II and III 
II is wrong as compilers which supports recursion require stack memory in run time environment.
III is wrong “any variable must be declared before its use” is a semantic error and not syntax error.
Question 32 
If there are m input lines and n output lines for a decoder that is used to uniquely address a byte addressable 1 KB RAM, then the minimum value of m + n is ____.
1034 
Each output line of the decoder is connected to one of the 1K(= 1024) rows of RAM.
Each row stores 1 Byte.
m=10 and n=1024
Question 33 
What is the worst case time complexity of inserting n^{2} elements into an AVLtree with n elements initially?
θ(n^{4})
 
θ(n^{2})
 
θ(n^{3})  
θ(n^{2} log n) 
In question they asked about n^{2} elements.
So, In worst case it will take o(n^{2} log n) time.
Question 34 
Which one of the following regular expressions represents the set of all binary strings with an odd number of 1’s?
10*(0*10*10*)*
 
((0 + 1)*1(0 + 1)*1)*10*
 
(0*10*10*)*10*  
(0*10*10*)*0*1

The regular expression ((0+1)*1(0+1)*1)*10* generate string “11110” which is not having odd number of 1’s , hence wrong option.
The regular expression (0*10*10*)10* is not a generating string “01”. Hence this is also wrong . It seems none of them is correct.
NOTE: Option 3 is most appropriate option as it generates the max number of strings with odd 1’s.
But option 3 is not generating odd strings. So, still it is not completely correct.
The regular expression (0*10*10*)*0*1 always generates all string ends with “1” and thus does not generate string “01110” hence wrong option.
Question 35 
Consider the following statements about the functionality of an IP based router.
 I. A router does not modify the IP packets during forwarding.
II. It is not necessary for a router to implement any routing protocol.
III. A router should reassemble IP fragments if the MTU of the outgoing link is larger than the size of the incoming IP packet.
Which of the above statements is/are TRUE?
I and II only  
II only  
I only  
II and III only

II: Is True.
III: Reassemble is not necessary at the router.
Question 36 
Consider a nonpipelined processor operating at 2.5 GHz. It takes 5 clock cycles to complete an instruction. You are going to make a 5stage pipeline out of this processor. Overheads associated with pipelining force you to operate the pipelined processor at 2 GHz. In a given program, assume that 30% are memory instructions, 60% are ALU instructions and the rest are branch instructions. 5% of the memory instructions cause stalls of 50 clock cycles each due to cache misses and 50% of the branch instructions cause stalls of 2 cycles each. Assume that there are no stalls associated with the execution of ALU instructions. For this program, the speedup achieved by the pipelined processor over the nonpipelined processor (round off to 2 decimal places) is _____.
2.16 
It is given that each instruction takes 5 clock cycles to execute in the nonpipelined architecture, so time taken to execute each instruction = 5 * 0.4 = 2ns
In the pipelined architecture the clock cycle time = 1/2G = 0.5 ns
In the pipelined architecture there are stalls due to memory instructions and branch instructions.
In the pipeline, the updated clocks per instruction CPI = (1 + stall frequency due to memory operations * stalls of memory instructions + stall frequency due to branch operations * stalls due to branch instructions)
Out of the total instructions , 30% are memory instructions. Out of those 30%, only 5% cause stalls of 50 cycles each.
Stalls per instruction due to memory operations = 0.3*0.05*50 = 0.75
Out of the total instructions 10% are branch instructions. Out of those 10% of instructions 50% of them cause stalls of 2 cycles each.
Stalls per instruction due to branch operations = 0.1*0.5*2 = 0.1
The updated CPI in pipeline = 1 + 0.75 + 0.1 = 1.85
The execution time in the pipeline = 1.85 * 0.5 = 0.925 ns
The speed up = Time in nonpipelined architecture / Time in pipelined architecture = 2 / 0.925 = 2.16
Question 37 
Consider the following set of processes, assumed to have arrived at time 0. Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the order P_{1},P_{2},P_{3},P_{4}.
If the time quantum for RR is 4 ms, then the absolute value of the difference between the average turnaround times (in ms) of SJF and RR (round off to 2 decimal places) is _____.
5.25 
Turn Around Time = (21 – 0) + (13 – 0) + (2 – 0) + (6 – 0), Average = 42/4 = 10.50
Turn Around Time (TAT) = (18 – 0) + (21 – 0) + (10 – 0) + (14 – 0), Average = 63/4 = 15.75
Absolute difference = 10.5015.75 = 5.25
Question 38 
Let G = (V,E) be a directed, weighted graph with weight function w:E → R. For some function f:V → R, for each edge (u,v) ∈ E, define w'(u,v) as w(u,v) + f(u)  f(v).
Which one of the options completes the following sentence so that it is TRUE?
“The shortest paths in G under w are shortest paths under w’ too, _______”.
if and only if f(u) is the distance from s to u in the graph obtained by adding a new vertex s to G and edges of zero weight from s to every vertex of G  
if and only if ∀u ∈ V, f(u) is positive
 
if and only if ∀u ∈ V, f(u) is negative  
for every f: V→R 
Question 39 
Consider a schedule of transactions T_{1} and T_{2}:
Here, RX stands for “Read(X)” and WX stands for “Write(X)”. Which one of the following schedules is conflict equivalent to the above schedule?
• First, let’s list the conflict operations of each of the schedule given in the options and compare with the conflict operations of schedule which is given in the question.
Given schedule:
Conflict operations:
R2(B) → W1(B)
W2(B) → W1(B)
R1(C) → W2(C)
R2(D) → W1(D)
Option(1):
Conflict operations:
R1(C) → W2(C)
W1(D) → R2(D)
W1(B) → R2(B)
W1(B) → W2(B)
Option(2):
Conflict operations:
R2(B) → W1(B)
W2(B) → W1(B)
R2(D) → W1(D)
R1(C) → W2(C)
Option(3):
Conflict operations:
R2(B) → W1(B)
W2(B) → W1(B)
R2(D) → W1(D)
W2(C) → R1(C)
Option(4):
Conflict operations:
R1(C) → W2(C)
W1(D) → R2(D)
R2(B) → W1(B)
W2(B) → W1(B)
The conflict operations in the option (2) and given schedule are appearing in the same sequence order, so option (2) is the answer.
Question 40 
A computer system with a word length of 32 bits has a 16 MB byteaddressable main memory and a 64 KB, 4way set associative cache memory with a block size of 256 bytes. Consider the following four physical addresses represented in hexadecimal notation.
A1 = 0x42C8A4, A2 = 0x546888, A3 = 0x6A289C, A4 = 0x5E4880
Which one of the following is TRUE?
A1 and A4 are mapped to different cache sets.  
A1 and A3 are mapped to the same cache set.  
A3 and A4 are mapped to the same cache set.  
A2 and A3 are mapped to the same cache set. 
The word length is given as 32 bits and the physical addresses mentioned are all contain 6 hexadecimal digits, so the the physical address is 32 bits long.
Block size is 256 bytes, block offset = 8 bits as it is a byte addressable memory.
Cache size = 64KB
Number of blocks in the cache = 64KB/256B = 256
It is a 4way set associative cache, so no. of sets in the cache = 256/4 = 64 = 2^{6}
In the physical address we need 6 bits for the SET number.
TAG bits = 32  6  8 = 18
So the 32 bits physical address is divided as (18 TAG bits + 6 SET number bits + 8 OFFSET bits)
Since in all the options we are asked about SET numbers of the given addresses, we need to find the SET number of each of the addresses.
A1 = 0x42C8A4, here SET number is (00 1000) which includes the last 2 bits of C(1100) and binary representation of 8 (1000).
A2 = 0x546888, here SET number is (10 1000) which includes the last 2 bits of 6(0110) and binary representation of 8 (1000).
A3 = 0x6A289C here SET number is (10 1000) which includes the last 2 bits of 2(0010) and binary representation of 8 (1000).
A4 = 0x5E4880 here SET number is (00 1000) which includes the last 2 bits of 4 (0100) and binary representation of 8 (1000).
From the given options option4 is TRUE as A2, A3 are mapped to the same cache SET.
Question 41 
For n>2, let a ∈ {0,1}^{n} be a nonzero vector. Suppose that x is chosen uniformly at random from {0,1}^{n}. Then, the probability that is an odd number is _____.
0.5 
‘x’ is a vector chosen randomly from {0,1}^{n}
‘a’ can have 2(^{n}1) possibilities, x can have 2^{n} possibilities.
∑a_{i}x_{i} have (2^{n}1)(2^{n}) possibilities, which is an even number of outcomes.
The probability of https://solutionsadda.in/wpcontent/uploads/2020/02/41.jpg is odd is ½.
For example:
Take n=3
a = {001, 010, 100, 011, 101, 111}
x = {000, 001, 010, 011, 100, 101, 110, 111}
Computed as [001]×[000] = 0+0+0 = 0 Output = even
[001]×[001] = 0+0+1 = 0 Output = odd
Similarly, there could be 28 even, 28 odd outputs for the a(size=7), x(size=8) of total 56 outputs.
Question 42 
Graph G is obtained by adding vertex s to K_{3,4} and making s adjacent to every vertex of K_{3,4}. The minimum number of colours required to edgecolour G is _____.
7 
The vertex in the set of size 3 has 4 edges connected to 4 vertices on other set. So, edge color of G is max(3,4) i.e. 4.
When a vertex is added to the graph with 7 vertices ( K_{3x4} has 7 vertices), there would be 7 edges associated to that new vertex. As per the edge coloring “no two adjacent edges have same color).
As the new vertex with 7 edges need to be colored with 7 colors, the edge color of graph G is 7.
Question 43 
An organization requires a range of IP addresses to assign one to each of its 1500 computers. The organization has approached an Internet Service Provider (ISP) for this task. The ISP uses CIDR and serves the requests from the available IP address space 202.61.0.0/17. The ISP wants to assign an address space to the organization which will minimize the number of routing entries in the ISP’s router using route aggregation. Which of the following address spaces are potential candidates from which the ISP can allot any one to the organization?
I. 202.61.84.0/21 II. 202.61.104.0/21 III. 202.61.64.0/21 IV. 202.61.144.0/21
I and II only
 
III and IV only
 
II and III only
 
I and IV only

And to Assign an IP address for 1500 computer, we require 11 bit from HID part.
So NID + SID = 17 + 4 = 21 bits and HID = 11 bits
NID HID
202.61.0 0000 000.00000000
So, from the given option, possible IP Address is
I. 84 > 0 1010 100 (Because in HID bit 1 is not possible)
II. 104 > 0 1101 000
III. 64 > 0 1000 000
IV. 144 > 1 0010 000 (Because in NID bit 1 is not possible )
Question 44 
Consider a relational table R that is in 3NF, but not in BCNF. Which one of the following statements is TRUE?
A cell in R holds a set instead of an atomic value.  
R has a nontrivial functional dependency X→A, where X is not a superkey and A is a nonprime attribute and X is not a proper subset of any key.
 
R has a nontrivial functional dependency X→A, where X is not a superkey and A is a nonprime attribute and X is a proper subset of some key.  
R has a nontrivial functional dependency X→A, where X is not a superkey and A is a prime attribute. 
FDs:
AB → C
BC → A
(BD)^{+} = BD ✖
(ABD)^{+} = ABDC ✔
(CBD)^{+} = CBDA ✔
Candidate keys = {ABD, CBD}
• The relation R is in 3NF, as there are no transitive dependencies.
• The relation R is not in BCNF, because the left side of both the FD’s are not Super keys.
• In R, BC → A is a nontrivial FD and in which BC is not a Super key and A is a prime attribute.
Question 45 
Consider a database implemented using B+ tree for file indexing and installed on a disk drive with block size of 4 KB. The size of search key is 12 bytes and the size of tree/disk pointer is 8 bytes. Assume that the database has one million records. Also assume that no node of the B+ tree and no records are present initially in main memory. Consider that each record fits into one disk block. The minimum number of disk accesses required to retrieve any record in the database is ______.
4 
(1) Database BF = 1
No. of block = 10^{6} } ➝ 1 block access from database
(2) ⎡10^{6}/204⎤ = 491
(3) ⎡491/204⎤ = 3
(4) ⎡3/204⎤ = 1
So, 1+3 = 4 disk accesses are required to retrieve any record in the database.
Question 46 
A processor has 64 registers and uses 16bit instruction format. It has two types of instructions: Itype and Rtype. Each Itype instruction contains an opcode, a register name, and a 4bit immediate value. Each Rtype instruction contains an opcode and two register names. If there are 8 distinct Itype opcodes, then the maximum number of distinct Rtype opcodes is _____.
14 
All possible binary combinations = 2^{16}
There are 64 registers, so no. of bits needed to identify a register = 6
Itype instruction has (Opcode+Register+4bit immediate value). There are 8 distinct Itype instructions.
All the binary combinations possible with the Itype instructions are = 8*2^{6}*2^{4} = 2^{13}
Rtype instructions have 2 register operands.
Let x be the number of Rtype instructions.
All the possible binary combinations of Rtype instructions = x*2^{6}*2^{6} = x*2^{12}
The sum of Itype and Rtype binary combinations should be equal to 2^{16}.
x*2^{12} + 2^{13} = 2^{16}
2^{12} (x+2) = 2^{16}
x+2 = 2^{4}
x = 16  2 = 14
Question 47 
Which one of the following predicate formulae is NOT logically valid?
Note that W is a predicate formula without any free occurrence of x.
∃x(p(x) → W) ≡ ∀x p(x) → W  
∀x(p(x) → W) ≡ ∀x p(x) → W
 
∃x(p(x) ∧ W) ≡ ∃x p(x) ∧ W  
∀x(p(x) ∨ W) ≡ ∀x p(x) ∨ W 
~p→q ≡ ~p∨q
Demorgan laws:
~(∀x(a(x)) ≡ ∃x~a(x)
~(∃x(a(x)) ≡ ∀x~a(x)
(A) ∃x(p(x)→w) ≡ ∀x p(x)→w
LHS: ∃x(p(x)→w) ≡ ∃x(~p(x)∨w)
≡ ∃x(~p(x))∨w
Demorgan’s law:
~(∀x(a(x)) = ∃x ~ a(x)
≡ ~(∀x P(x)) ∨ w
≡ (∀x) P(x) → w ≡ RHS
It’s valid.
(B) ∀x(P(x) → w) ≡ ∀x(~P(x) ∨ w)
≡ ∀x(~P(x)) ∨ w
≡ ~(∃x P(x)) ∨ w
≡ ∃x P(x) → w
This is not equal to RHS.
(C) ∃x(P(x) ∧ w) ≡ ∃x P(x) ∧ w
‘w’ is not a term which contains x.
So the quantifier does not have any impact on ‘w’.
Thus it can be written as
∃x(P(x)) ∧ w) ≡ ∃x P(x) ∧ w
(D) ∀(x)(P(x) ∨ w) ≡ ∀x P(x) ∨ w
‘w’ is not a term which contains ‘x’.
So the quantifier does not have an impact on ‘w’.
Thus ∀(x)(P(x) ∨ w) ≡ ∀x P(x) ∨ w
Question 48 
In a balanced binary search tree with n elements, what is the worst case time complexity of reporting all elements in range [a,b]? Assume that the number of reported elements is k.
θ(n log k)  
θ(log n + k)  
θ(k log n)  
θ(log n) 
Time complexity of the above program is O(h + k) where h is the height of BST and k is the number of nodes in a given range.
Here h is log n, hence O(log n+k).
Question 49 
The number of permutations of the characters in LILAC so that no character appears in its original position, if the two L’s are indistinguishable, is _______.
12 
― ― ― ― ―
Given: L I L A C
The derangement formula ⎣n!/e⎦ cannot be directly performed as there are repeated characters.
Let’s proceed in regular manner:
The L, L can be placed in other ‘3’ places as
(1) Can be arranged such that A, I, C be placed in three positions excluding ‘C’ being placed at its own position, which we get only 2×2×1 = 4 ways.
Similarly (2) can be filled as A, I, C being placed such that 4th position is not filled by A, so we have 2×2×1 = 4 ways. Similarly with (3).
Totally, we get 4+4+4 = 12 ways.
Question 50 
Let G = (V,E) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighted edge (u,v) ∈ V×V is added to G. The worst case time complexity of determining if T is still an MST of the resultant graph is
θ(E+V)  
θ(E logV)  
θ(EV)  
θ(V) 
• As T is a minimum spanning tree and we need to add a new edge to existing spanning tree.
• Later we need to check still T is a minimum spanning tree or not, So we need to check all vertices whether there is any cycle present after adding a new edge.
• All vertices need to traverse to confirm minimum spanning tree after adding new edge then time complexity is O(V).
Method2:
Time Complexity:
Total vertices: V, Total Edges : E
• O(logV) – to extract each vertex from the queue. So for V vertices – O(VlogV)
• O(logV) – each time a new pair object with a new key value of a vertex and will be done at most once for each edge. So for total E edge – O(ElogV)
• So overall complexity: O(VlogV) + O(ElogV) = O((E+V)logV) = O(ElogV)
Note: Method1 is the most appropriate answer for giving a question.
Question 51 
Consider the following C functions.
int fun1 (int n) { int fun2 (int n) { static int i = 0; static int i = 0; if (n > 0) { if (n > 0) { ++i; i = i + fun1 (n); fun1 (n1); fun2 (n1); } } return (i); return (i); } }
The return value of fun2 (5) is _______.
55 
int fun1(int n) {
printf("fun1 call\n");
static int i = 0;
if(n>0){
++i;
printf("fun1(%d1)\n",n);
fun1(n1);
}
printf("fun1(%d)= %d\n",n, i);
return(i);
}
int fun2(int n) {
printf("\n******* fun2 call ********\n");
static int i = 0;
if(n>0){
printf("%d + fun1(%d)\n", i,n);
i=i+fun1(n);
fun2(n1);
}
printf("fun2(%d)= %d\n",n, i);
return(i);
}
void main()
{
printf("final = %d\n", fun2(5));
}
Check step by step hand run of the code to understand the recursion:
******* fun2 call ********
0 + fun1(5)
fun1 call
fun1(51)
fun1 call
fun1(41)
fun1 call
fun1(31)
fun1 call
fun1(21)
fun1 call
fun1(11)
fun1 call
fun1(0)= 5
fun1(1)= 5
fun1(2)= 5
fun1(3)= 5
fun1(4)= 5
fun1(5)= 5
******* fun2 call ********
5 + fun1(4)
fun1 call
fun1(41)
fun1 call
fun1(31)
fun1 call
fun1(21)
fun1 call
fun1(11)
fun1 call
fun1(0)= 9
fun1(1)= 9
fun1(2)= 9
fun1(3)= 9
fun1(4)= 9
******* fun2 call ********
14 + fun1(3)
fun1 call
fun1(31)
fun1 call
fun1(21)
fun1 call
fun1(11)
fun1 call
fun1(0)= 12
fun1(1)= 12
fun1(2)= 12
fun1(3)= 12
******* fun2 call ********
26 + fun1(2)
fun1 call
fun1(21)
fun1 call
fun1(11)
fun1 call
fun1(0)= 14
fun1(1)= 14
fun1(2)= 14
******* fun2 call ********
40 + fun1(1)
fun1 call
fun1(11)
fun1 call
fun1(0)= 15
fun1(1)= 15
******* fun2 call ********
fun2(0)= 55
fun2(1)= 55
fun2(2)= 55
fun2(3)= 55
fun2(4)= 55
fun2(5)= 55
final = 55
Question 52 
Consider the array representation of a binary minheap containing 1023 elements. The minimum number of comparisons required to find the maximum in the heap is _______.
511 
n=1023
= Ceil(1023/2)
= 512
So, the maximum element is also part of n/2.
So, we have to subtract from the total elements
= 5121
= 511
Question 53 
Let A and B be two n×n matrices over real numbers. Let rank(M) and det(M) denote the rank and determinant of a matrix M, respectively. Consider the following statements,
 I. rank(AB) = rank(A) rank(B)
II. det(AB) = det(A) det(B)
III. rank(A + B) ≤ rank(A) + rank(B)
IV. det(A + B) ≤ det(A) + det(B)
Which of the above statements are TRUE?
I and II only
 
I and IV only  
III and IV only  
II and III only

Rank is the number of independent rows(vectors) of a matrix. On product of two matrices, the combined rank is more than the sum of individual matrices (subtracted with the order n)
det(AB) = det(A)∙det(B) as the magnitude remains same for the matrices after multiplication.
Note: We can just take a 2x2 matrix and check the options.
Question 54 
Each of a set of n processes executes the following code using two semaphores a and b initialized to 1 and 0, respectively. Assume that count is a shared variable initialized to 0 and not used in CODE SECTION P.
wait (a); count = count+1; if (count==n) signal (b); signal (a); wait (b); signal (b);
What does the code achieve?
It ensures that all processes execute CODE SECTION P mutually exclusively.  
It ensures that at most two processes are in CODE SECTION Q at any time.  
It ensures that no process executes CODE SECTION Q before every process has finished CODE SECTION P.
 
It ensures that at most n1 processes are in CODE SECTION P at any time.

Question 55 
Consider the productions A⟶PQ and A⟶XY. Each of the five nonterminals A, P, Q, X, and Y has two attributes: s is a synthesized attribute, and i is an inherited attribute. Consider the following rules.
Rule 1: P.i = A.i + 2, Q.i = P.i + A.i, and A.s = P.s + Q.s Rule 2: X.i = A.i + Y.s and Y.i = X.s + A.i
Which one of the following is TRUE?
Only Rule 2 is Lattributed.
 
Neither Rule 1 nor Rule 2 is Lattributed.  
Both Rule 1 and Rule 2 are Lattributed.  
Only Rule 1 is Lattributed.

Question 56 
Consider a TCP connection between a client and a server with the following specifications: the round trip time is 6 ms, the size of the receiver advertised window is 50 KB, slow start threshold at the client is 32 KB, and the maximum segment size is 2 KB. The connection is established at time t=0. Assume that there are no timeouts and errors during transmission. Then the size of the congestion window (in KB) at time t+60 ms after all acknowledgements are processed is ______.
44 
Here, t + 60 is nothing but at the 10 RTT (60/6 = 10), but here it’s asking after all acknowledgement are processed it means after the 10^{th} RTT, i.e., at the 11RTT.
1^{st} transmission: 2 KB
2^{nd} transmission: 4 KB
3^{rd} transmission: 8 KB
4^{th} transmission: 16 KB
5^{th} transmission: 32 KB (Threshold reached)
6^{th} transmission: 34 KB
7^{th} transmission: 36 KB
8^{th} transmission: 38 KB
9^{th} transmission: 40 KB
10^{th} transmission: 42 KB
At the completion of 10^{th} transmission RTT = 10*6 = 60 ms
For the 11^{th} transmission, The congestion window size is 44 KB.
Question 57 
Consider the Boolean function z(a,b,c).
Which one of the following minterm lists represents the circuit given above?
Z = ∑(0,1,3,7)  
Z = ∑(2,4,5,6,7)  
Z = ∑(1,4,5,6,7)  
Z = ∑(2,3,5) 
Convert a+b’c into canonical form which is sum of minterms.
a + b’c = a(b + b’)(c + c’) + (a + a’)b’c
= abc + abc’ + ab’c + ab’c’ + ab’c + a’b’c
= Σ(7,6,5,4,1)
Question 58 
Consider three registers R1, R2 and R3 that store numbers in IEEE754 single precision floating point format. Assume that R1 and R2 contain the values (in hexadecimal notation) 0x42200000 and 0xC1200000, respectively.
If R3 = R1/R2, what is the value stored in R3?
0x40800000  
0x83400000  
0xC8500000  
0xC0800000 
R1 = 1.0100..0 X 2^{132127}
= 1.0100..0 X 2^{5}
= 101.0 X 2^{3}
= 5 X 8
= 40
R2 = (1) x 1.0100..0 X 2^{130127}
= (1) x 1.0100..0 X 2^{3}
= (1) x 101.0 X 2^{1}
= (1) x5 X 2
= 10
R3 = R1/R2
= 4
= (1)x 1.0 x 2^{2}
Sign = 1
Mantissa = 000..0
Exponent = 2+127 = 129
R3 = 1100 0000 1000 000..0
= 0x C 0 8 0 0 0 0 0
Question 59 
Consider the following five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given time.
(P, 155), (Q, 85), (R, 110), (S, 30), (T, 115)
Assume the head is positioned at cylinder 100. The scheduler follows Shortest Seek Time First scheduling to service the requests.
Which one of the following statements is FALSE?
The head reverses its direction of movement between servicing of Q and P.  
T is serviced before P.  
R is serviced before P.  
Q is serviced after S, but before T.

Question 60 
Consider a graph G = (V, E), where V = {v_{1}, v_{2}, …, v_{100}}, E = {(v_{i}, v_{j})  1 ≤ i < j ≤ 100}, and weight of the edge (v_{i}, v_{j}) is i  j. The weight of the minimum spanning tree of G is ______.
99 
• N =100
• Edge weight is ij for Edge (vi,vj) {1<=i<=100}
• The weight of edge(v1,v2) is 1 , edge(v5,v6) is 1.
• So, 99 edges of weight is 99.
Question 61 
int tob (int b, int* arr) {
int i;
for (i=0; b>0; i++) {
if (b%2) arr [i] = 1;
else arr [i] = 0;
b = b/2;
}
return (i);
}
int pp (int a, int b) {
int arr [20];
int i, tot = 1, ex, len;
ex = a;
len = tob (b,arr);
for (i=0; i
tot = tot * ex;
ex = ex * ex;
}
return (tot);
}
The value returned by pp(3,4) is ________.
81 
a=3,b=4
tot=1
ex=a=3
len=tob(b,arr) which is 3
[
tob(4,arr)==>
b=4
b%2 =4%2=0 Condition is false then arr[0]=0
=> b=b/2 =4/2 =2
b=2
b%2 =2%2=0 condition is false then arr[1]=0
=>b=b/2=2/2=1
b=1
then b%2=1%2 condition is true then arr[2]=1
=>b=b/2=1/2=0
The i value is 3 [length is 3]
]
i=0,
arr[0] ==1 condition is false
ex=3*3=9
i=1
arr[1]==1 condition is false
then
ex=9*9=81
i=2
then arr[2]==1 condition is true
tot=tot*ex=1*81=81
ex=81*81
Finally it returns tot value which 81.
Question 62 
Which of the following languages are undecidable? Note that
 L_{1} =
L_{2} = {
L_{3} = {
L_{4} = {
L_{2} and L_{3} only
 
L_{1} and L_{3} only
 
L_{2}, L_{3} and L_{4} only  
L_{1}, L_{3} and L_{4} only 
Only L_{3} is decidable. We can check whether a given TM reach state q in exactly 100 steps or not. Here we have to check only upto 100 steps, so here is not any case of going to infinite loop.
Question 63 
Consider a paging system that uses a 1level page table residing in main memory and a TLB for address translation. Each main memory access takes 100 ns and TLB lookup takes 20 ns. Each page transfer to/from the disk takes 5000 ns. Assume that the TLB hit ratio is 95%, page fault rate is 10%. Assume that for 20% of the total page faults, a dirty page has to be written back to disk before the required page is read in from disk. TLB update time is negligible. The average memory access time in ns (round off to 1 decimal places) is ______.
154.5 ns 
T=20ns
D=5000ns
h=0.95
p=0.1, 1p=0.9
d=0.2, 1d=0.8
EMAT = h×(T+M)+(1h)[(1p)×2M+p[(1d)[D+M]+d(2D+M)]+T]
= 0.95×(20+100)+(10.95)[(10.1)×200+(0.1)[(10.2)[5000+100]+(0.2)(10000+100)]+20]
= 154.5 ns
Question 64 
Consider the following language.
L = {x ∈ {a,b}*  number of a’s in x is divisible by 2 but not divisible by 3}
The minimum number of states in a DFA that accepts L is ______.
6 
DFA 1: No. of a’s not divisible by 3
Using product automata:
Question 65 
Consider the following languages.
 L_{1} = {wxyx  w,x,y ∈ (0 + 1)^{+}}
L_{2} = {xy  x,y ∈ (a + b)*, x = y, x ≠ y}
Which one of the following is TRUE?
L_{1} is contextfree but not regular and L_{2} is contextfree.  
Neither L_{1} nor L_{2} is contextfree.
 
L_{1} is regular and L_{2} is contextfree.
 
L_{1} is contextfree but L_{2} is not contextfree. 
So it is equivalent to
(a+b)^{+} a (a+b)^{+} a + (a+b)^{+} b (a+b)^{+} b
L_{2} is CFL since it is equivalent to complement of L=ww.
Complement of L=ww is CFL.