GATE 2023 CSE Forenoon Session Q&A
GATE 2023 CSE Forenoon Session Q&A
f ( x) g ( y)y R
Hence, the correct option is (B).
Question 10
PAGE GATE 2023 [Forenoon Session]
6 Computer Science Engineering
Which one of the options best describes the transformation of the 2-dimensional figure P to Q , and then
to R as shown?
[Spitial Aptitude]
Operation 1 Operation 2
P Q R
(A) Operation 1 : A clockwise rotation by 900 about an axis perpendicular to the plane of the figure.
Operation 2 : A reflection along a vertical line.
(B) Operation 1 : A clockwise rotation by 900 about an axis perpendicular to the plane of the figure
Operation 2 : A reflection along a horizontal line
(C) Operation 1 : A counter clockwise rotation by 900 about an axis perpendicular to the plane of the
figure.
Operation 2 : A reflection along a horizontal line
(D) Operation 1 : A counter clockwise rotation by 1800 about an axis perpendicular to the plane of the
figure.
Operation 2 : A reflection along a vertical line.
Ans. (B)
Sol. Given : The transformation of the 2-dimensional figure P to Q , and then to R as shown in below
figure,
Operation 1 Operation 2
P Q R
We can clearly see from P to Q , operation 1 is a clockwise rotation by 900 about an axis perpendicular
to the plane of the figure.
0
90
Clockwise
P Q
Horizontal line
Front end
Syntax Analysis (High level programming
language)
Semmantic Analysis
Back end
Code Optimization
(Hardware)
Code Generation
S1 : The front end or analysis phase consists of lexical, syntax and semantic analysis.
It takes source language and produces intermediate code representation. It is independent of target
hardware. So, S1 is true.
S2 : The bock-end or synthesis phase consists of code optimization and target code generation phases
which takes intermediate code and generates target code as output. It is dependent on target hardware. S2
is true.
S3 : Back-end phase is independent of source program as its task is to convert the intermediate code to
target code. S3 is false.
Hence, the correct option is (B).
Question 2
Which one of the following sequences when stored in an array at locations A[1],...,A[10] forms a max-
heap ? [Data Structure, Tree]
(A) 23, 17, 10, 6, 13, 14, 1, 5, 7, 12 (B) 23, 17, 14, 7, 13, 10, 1, 5, 6, 12
(C) 23, 17, 14, 6, 13, 10, 1, 5, 7, 15 (D) 23, 14, 17, 1, 10, 13, 16, 12, 7, 5
Ans. (B)
Sol. Here, we have to check all options for finding which one satisfies property of max-heap. i.e.
(i) Heap is a complete binary Tree
(ii) Parent element is always greater than child element value.
Upon checking only
23
17 14
7 13 10 1
5 6 12
PAGE GATE 2023 [Forenoon Session]
9 Computer Science Engineering
Hence, the correct option is (B).
Question 3
Let SLLdel be a function that deletes a node in a singly-linked list given a pointer to the node and a pointer
to the head of the list. Similarly, let DLLdel be another function that deletes a node in a doubly-linked list
given a pointer to the node and a pointer to the head of the list.
Let n denote the number of nodes in each of the linked lists. Which one of the following choices is TRUE
about the worst-case time complexity of SLLdel and DLLdel ?
[Data Structure, Linked List]
(A) SLLdel is O(1) and DLLdel is O(n) (B) Both SLLdel and DLLdel are O(log(n))
(C) Both SLLdel and DLLdel are O(1) (D) SLLdel is O(n) and DLLdel is O(1)
Ans. (D)
Sol. Given a single linked list SLL:
A B C X Y Z
Head Ptr
Here, were given head pointer and ptr pointer of the node to be deleted (Here y) We have to traverse from
head node till node before the one pointed by ptr (here X) which take O(n) time in worst case.
Given a doubly linked list DLL:
X A B X Y Z X
Head Ptr
Simply we can do it as:
ptr prev next = ptr next
ptr next prev= ptr prev
delete (ptr)
since it can be performed in O(1) time:
Hence, the correct option is (D).
Question 4
Consider the Deterministic Finite-state Automaton (DFA) A shown below. The DFA runs on the alphabet
{0, 1}, and has the set of states {s, p, q, r}, with s being the start state and p being the only final state
0
1
s 1 p q
0 0
r
0,1
PAGE GATE 2023 [Forenoon Session]
10 Computer Science Engineering
Which one of the following regular expressions correctly describes the language accepted by A?
[Theory of Computation & Finite Automata]
(A) 1(0*11)* (B) 0(0 1)*
(C) 1(0 11)* (D) 1(110*)*
Ans. (C)
Sol. : Method 1 :
The given DFA generate strings like:
{1,10,110,100,1011,1000....}
So, start with 1 to reach final state from where wave two choices os (0 11)
*
Checking options:
(a) Dosen’t generate 10
(b) Dosen’t generate any os it starts with 0.
(d) Dosen’t generate 10.
Hence, the correct option is (C).
: Method 2 :
Given DFA shown below
0
1
1
S P
Q
0 0
r
0, 1
Question 5
The Lucas sequence Ln is defined by the recurrence relation :
PAGE GATE 2023 [Forenoon Session]
11 Computer Science Engineering
Ln = Ln −1 + Ln − 2, for n ≥ 3,
with L1 = 1 and L2 = 3.
Which one of the options given is TRUE? [Discrete Mathematics & Combinatorics]
n n n n
1 5 1 5 1 5 1 5
(A) Ln (B) Ln
2 2 2 3
n n n n
1 5 1 5 1 5 1 5
(C) Ln (D) Ln
2 3 2 2
Ans. (A)
Sol. : Method 1 :
Lucas sequence
Put n = 1 in option we will get
1 5 1 5 2
l1 1
2 2 2
given that l1 1
Put n 2 in option we will get
2 2
1 5 1 5 1 5 6
l2 2 2 3
2 2 4 4 4
Given that l2 3
n n
1 5 1 5
ln
2 2
Hence, the correct option is (A).
: Method 2 :
Given that
Ln Ln1 Ln2 for n 3
P2 P 1 0
Characteristic ROOT
PAGE GATE 2023 [Forenoon Session]
12 Computer Science Engineering
1 5
P
2
Homogeneous function
c1 p1n c2 p2n
n n
1 5 1 5
Ln c1 c2 … (ii)
2 2
Put n 1
1 1
1 5 1 5
L1 c1 c2 … (iii)
2 2
1 5 1 5
1 c1 c2
2 2
Put n 2
2 2
1 5 1 5
L2 c1 c2 … (iii)
2 2
2 2
1 5 1 5
3 c1 c2 … (iv)
2 2
Solving equation (iii) and equation (iv)
c1 1, c2 1
n n
1 5 1 5
Ln
2 2
Question 6
Which one of the options given below refers to the degree (or arity) of a relation in relational database
systems?
[Database, ER Model]
(A) Number of attributes of its relation schema.
(B) Number of tuples stored in the relation.
(C) Number of entries in the relation.
(D) Number of distinct domains of its relation schema.
Ans. (A)
PAGE GATE 2023 [Forenoon Session]
13 Computer Science Engineering
Sol. By definition: “ The degree of relation is the number of attributes it contains”.
Hence, the correct option is (A).
Question 7
Suppose two hosts are connected by a point-to-point link and they are configured to use Stop-and-Wait
protocol for reliable data transfer. Identify in which one of the following scenarios, the utilization of the
link is the lowest.
[Computer Network & Datalink Layer]
(A) Longer link length and lower transmission rate
(B) Longer link length and higher transmission rate
(C) Shorter link length and lower transmission rate
(D) Shorter link length and higher transmission rate
Ans. (B)
Length of Packet (L)
Sol. Transmission Time (Tt )
Band width (B.W)
Link Length (D)
Propagation Time (Tp )
Speed (V)
Tt L / Bw L
Link Utilisation = Efficiency
Tt 2Tp L D D
2 Bw Tt 2
Bw V V
1
So, Efficiency
D (Link Length)
1
Also, Transmission rate = Band width and Efficiency
Bw
For low utilization, we need longer link length and higher transmission rate.
Hence, the correct option is (B).
Question 8
1 2 3 4 3 4 1 2
4 1 2 3
Let A and B 4 1 2 3
3 4 1 2 1 2 3 4
2 3 4 1 2 3 4 1
Let det(A) and det(B) denote the determinants of the matrices A and B, respectively.
Which one of the options given below is TRUE?
[Engineering Mathematics, Linear Algebra]
(A) det(A) = det(B) (B) det(B) = −det(A)
(C) det(A)=0 (D) det(AB) = det(A) + det(B)
Ans. (B)
PAGE GATE 2023 [Forenoon Session]
14 Computer Science Engineering
1 2 3 4 3 4 1 2
4 1 2 3 4 1 2 3
Sol. A B
3 4 1 2 1 2 3 4
2 3 4 1 2 3 4 1
R1 R3
det B = – det A
Hence, the correct option is (B).
Question 9
Consider the following definition of a lexical token id for an identifier in a programming language, using
extended regular expressions :
Letter [ A Za z ]
Digit [0 9]
id letter (letter/digit)*
Which one of the following Non - deterministic. Finite - state Automate with - transitions accepts the
set of valid identifiers? (A double-circle denotes a final state)
[Theory of Computation, Finite Automata]
(A)
Letter
Letter digit
Letter
Letter
(B)
Digit
Letter
(C) Letter
Digit
PAGE GATE 2023 [Forenoon Session]
15 Computer Science Engineering
(D)
Letter Letter Digit
Ans. (C)
Sol. The regular expression is:
Letter (letter + digit)*.
Given : Grammar
Letter [A-Z, a-z]
Digit [0-9]
Id Letter (letter/digit)*
Valid Identifier should start with letter and followed by either letter or digit
Regular expression (RE) = Letter (letter + digit)*
A. First option is wrong because as per NFA given identifier can be start with digit.
B. Second option is wrong because this NFA gives identifier as
Letter (letter)* OR Letter (digit)*
C. Third option is correct it gives correct Regular expression as per given grammar.
Letter
Letter
Digit
D. Fourth option is wrong because this NFA does not accept regular expression,
Letter (Letter)*
Hence, the correct option is (C).
Question 10
An algorithm has to store several keys generated by an adversary in a hash table. The adversary is
malicious who tries to maximize the number of collisions. Let k be the number of keys, m be the number
PAGE GATE 2023 [Forenoon Session]
16 Computer Science Engineering
of slots in the hash table, and k > m. Which one of the following is the best hashing strategy to counteract
the adversary? [Data Structure, Hashing]
(A) Division method, i.e., use the hash function h(k) = k mod m.
(B) Multiplication method, i.e., use the hash function h(k ) m kA kA , where A is a carefully
chosen constant.
(C) Universal hashing method
(D) If k is a prime number, use Division method. Otherwise, use Multiplication method.
Ans. (C)
Sol. Here, the attacker is trying to maximize collision and to minimize it we have to use a method that randomly
assigns keys to the slots. So option “C”- Universal hasting is best.
The only effective way to improve the situation is to choose the Hash function Randomly in such a way
that is independent of the key that are actually going to be stored this approach is called universal hashing.
Hence, the correct option is (C).
Question 11 (Digital Electronics)
The output of a 2-input multiplexer is connected back to one of its inputs as shown in the figure.
Multiplexer
0
Q
1
S
Match the functional equivalence of this circuit to one of the following options
[Digital Logic, Combinational Circuits]
(A) D Flip-flop (B) D Latch
(C) Half-adder (D) Demultiplexer
Ans. (B)
Sol. : Method 1 :
The output equation of above 2 1 mux is:
V S I 0 S .I1
So, when S = 0
Y I 0 Q , the previous state value
When S = 1
Y I1 , (Output = Input)
Thus, it is D, Latch
Hence, the correct option is (B).
: Method 2 :
PAGE GATE 2023 [Forenoon Session]
17 Computer Science Engineering
Qn 1 SQn SQn
Qn 1 Qn ( S S )
Qn1 Qn
Output is same as the input Qn1 is generated after delay.
Hence, the correct option is (B).
Question 12
Which one or more of the following need to be saved on a context switch from one thread (T1) of a process
to another thread (T2) of the same process? [Operating System, Memory Management Virtual table]
(A) Page table base register (B) Stack pointer
(C) Program counter (D) General purpose registers
Ans. (B), (C), (D)
Sol. (A) Page Table Base Register holds base address of page table for currently executing thread since,
thread switch between same process so there’s no need of updation:
(B) Each thread has its own stack. So stack painter needs to be saved.
(C) PC register contains address of next instruction to be executed by current thread. So it needs to be
saved when switch occurs.
(D) These registers are used to store temporary data during thread execution and needs to be saved before
thread switches.
Hence, the correct options are (B), (C) & (D).
Question 13
Which one or more of the following options guarantee that a computer system will transition from user
mode to kernel mode? [Operating System, Process Management I]
(A) Function Call (B) malloc Call
(C) Page Fault (D) System Call
Ans. (C), (D)
Sol. Function calls and malloc calls do not necessarily result in transition to kernel mode.
System call guarantees that computer system will transition from user mode to kernel mode as using
system calls a user requests services from OS and transition from user mode to kernel mode.
Page fault occures when program requests access of page not currently in memory (Physical
memory) so, OS needs to handle page fault and may need to allocate physical memory.
Hence, the correct options are (C) & (D).
Question 14
Which of the following statements is/are CORRECT?
[Theory of Computation, Properties of Languages]
(A) The intersection of two regular languages is regular.
(B) The intersection of two context-free languages is context-free.
(C) The intersection of two recursive languages is recursive.
PAGE GATE 2023 [Forenoon Session]
18 Computer Science Engineering
(D) The intersection of two recursively enumerable languages is recursively enumerable.
Ans. (A), (C), (D)
Sol. Intersection options are closed under Regular Language, Recursive Language and Recursively
Enumerable Language.
For Context free Language
Let L1 a b c / m, n 0 and L2 a b c / m, n 0
n n m m n n
So (B) is False
Hence, the correct options are (A), (C) & (D).
Question 15
Which of the following statements is/are INCORRECT about the OSPF (Open Shortest Path First) routing
protocol used in the Internet? [Algorithm, Greedy Algorithm]
(A) OSPF implements Bellman-Ford algorithm to find shortest paths.
(B) OSPF uses Dijkstra’s shortest path algorithm to implement least-cost path routing.
(C) OSPF is used as an inter-domain routing protocol.
(D) OSPF implements hierarchical routing.
Ans. (A), (C)
Sol. OSPF uses Dijkstra’s algorithm to compute the shortest path tree for each route, the cost of a route is
calculated by gathering link state information from available routers.
Also, OSPF is hierarchical routing protocol, using are 0 (autonomous system) at top of hierarchy.
So, A and C are False.
Hence, the correct options are (A) & (C).
Question 16
Geetha has a conjecture about integers, which is of the form
x P ( x) yQ ( x, y ) ,
where P is a statement about integers, and Q is a statement about pairs of integers. Which of the following
(one or more) option(s) would imply Geetha’s conjecture?
[Discrete Mathematics, Mathematical Logic]
(A) x( P( x)) yQ( x, y) (B) xyQ( x, y)
(C) yx P ( x) Q( x, y ) (D) x P ( x) yQ( x, y )
Ans. (B), (C)
Sol. Here, domain is set of integers, So Elements
x, y E{..... 3,2,1,0,1,2,......}
Expression E x{P( x) y Q( x, y)}
Which says if x is P then ‘ always exists a y such such that Q (x,y).
PAGE GATE 2023 [Forenoon Session]
19 Computer Science Engineering
Now, checking options.
For option (A) :
[ P( x)] y ( x, y ) E
Is True?
LHS RHS
Here, for LHS to be true. Say there exists an x (6) for which p( x) p(c) True and for all y(6, y)
is True.
p ( x) y 2( x, y )
Now, RHS : E x
A B
A True for say x 7, so p(7) True
For B, say there doesn’t exist any y such that Q(7, y) = True. Hence A B
T F is false.
So, its case of True False as LHS is True and A
RHS is False
Therefore it becomes case of True False and eventually its False:
For option (B) :
x y Q( x, y ) E
True?
LHS RHS
Here, LHS is True for all values of x and y.
[ P( x)] yQ( x, y )]
Now Ans: E x
A B
Now, since,
x y Q( x, y) True.
yQ( x, y) True too.
So, For A B
A True is always True.
As RHS is True. Its case of
True True which is true.
For option (C) :
y x[ P( x) Q( x, y )] E
True?
LHS RHS
For LHS to be true, there exists some y say y = 2 for which for all x which are satisfying property p
implies property Q (x,y)
P( x) y Q( x, y )
Now, RHS: = E x
A B
B y Q( x, y) is always, true as there exists at least one y (we assumed y = 2) such that x Q(x,2) is
True. So B is true
The case becomes A B
PAGE GATE 2023 [Forenoon Session]
20 Computer Science Engineering
A True which is true
So, L.H.S R.H.S. is true.
For Option (D) :
[ P( x) y 2( x, y )] E
True?
LHS RHS
For LHS to be true, assume x 6 for which properly P(6) is true and there exists a y assume y 2
such that Q(6, 2) is true.
P( x) yQ( x, y )
Now, RHS E Vx
A B
Say x 3 and P( x) True
But there exists no y for Q(3, y) to be true.
Hence, it becomes A B
True False so RHS is False
Also, it becomes case of True False which is false.
Hence, the correct options are (B) & (C).
Question 17
Which one or more of the following CPU scheduling algorithms can potentially cause starvation?
[Operating System, Process Management II]
(A) First-in First-Out (B) Round Robin
(C) Priority Scheduling (D) Shortest Job First
Ans. (A), (C), (D)
Sol. • SJF and priority scheduling are prone to starvation as for SJF the shorter jobs might keep coming
and longer burst time jobs have to keep waiting.
• Also, for priority scheduling the higher priority job might keep coming causing lower priority jobs
to starve.
• Round Robin never cause starvation as every job gets a fixed time quantum to execute, which is
finite and evry job get time for execution.
• For FCFS, in case of infinite loop like
while (1);
then it cause starvation
so until there’s special case of a task running forever there will be no starvation.
Hence, the correct options are (A), (C) & (D).
Question 18
Let f ( x) x3 15x2 33x 36 be a real-valued function. Which of the following statements is/are
TRUE?
[Engineering Mathematics, Calculus]
(A) f (x) does not have a local maximum. (B) f(x) has a local maximum.
(C) f(x) does not have a local minimum. (D) f(x) has a local minimum
PAGE GATE 2023 [Forenoon Session]
21 Computer Science Engineering
Ans. B, D
Sol. f ( x) x3 15x2 33x 36
f '( x) 3x2 30x 33
f "( x) 6 x 30
f '( x) 0
3x2 30 x 33 0
x2 10 x 11 0
( x 11) ( x 1) 0
x 11 , x 1
f "( x) 6 x 30
at x 11
f "(11) 66 30
36 0
Local maxima
at x 1
f "(1) 6 30
36 0
Local minima
f ( x) has a local maximum.
f ( x) has a local minimum.
Hence, the correct options are B and D.
Question 19
Let f and g be functions of natural numbers given by f(n) = n and g(n) = n2. Which of the following
statements is/are TRUE? [Algorithm, Complexity Analysis & Asymptotic notation]
(A) f O( g ) (B) f ( g )
(C) f o( g ) (D) f ( g )
Ans. (A), (C)
Given, F (n) n and g (n) n
2
Sol.
(a) F o( g ) (Big oh)
F (n) c1 g (n)
n c1n 2 c1 1
n n2 True
(b) F ( g ) (omega)
F (n) c2 g (n)
PAGE GATE 2023 [Forenoon Session]
22 Computer Science Engineering
n c2 n2 False
F (n) c3 g (n)
n c3 n2 c3 1
n n2 True
(d) F ( g ) (theta notation)
5
2 1
Let λ1, λ2, λ3, λ4, and λ5 be the five eigenvalues of A. Note that these eigenvalues need not be distinct.
The value of λ1 + λ2 + λ3 + λ4 + λ5 = ______. [Discrete Mathematics, Graph Theory]
Ans. 2
Sol.
3 2 1 3 2 1
3 2
I 4x y( z )11dydx (0)
2
3 2
3 2
I 8x
2
ydydx
3 2
3
2
I 8 x ydy dx
2
3 2
3
I 8x 2 (0)dx 0
3
5 6 0 (110)5
1 1
(110)5
Hence, the correct answer is 110.
Question 23
PAGE GATE 2023 [Forenoon Session]
24 Computer Science Engineering
Consider a 3-stage pipelined processor having a delay of 10 ns (nanoseconds), 20 ns, and 14 ns, for the
first, second, and the third stages, respectively. Assume that there is no other delay and the processor does
not suffer from any pipeline hazards. Also assume that one instruction is fetched every cycle. The total
execution time for executing 100 instructions on this processor is ________ ns.
[Computer Organization & Architecture, Instructions and Addressing Format]
Ans. 2040
Sol. Given delays 10ns, 20 ns, 14 ns
There’s no buffer delay or hazard and one instruction is fetched every cycles.
Total instruction (n) 100
Pipeline delay (Tp ) max(10, 20,14) 20 ns
Number of stages (k ) 3
So, total execution time, T [k (n 1)] Tp
(3 100 1) 20
2040 ns
Hence, the correct answer is 2040.
Question 24
A keyboard connected to a computer is used at a rate of 1 keystroke per second. The computer system
polls the keyboard every 10 ms (milli seconds) to check for a keystroke and consumes 100 s (micro
seconds) for each poll. If it is determined after polling that a key has been pressed, the system consumes
an additional 200 μs to process the keystroke. Let T1 denote the fraction of a second spent in polling and
processing a keystroke.
In an alternative implementation, the system uses interrupts instead of polling. An interrupt is raised for
every keystroke. It takes a total of 1 ms for servicing an interrupt and processing a keystroke. Let T2 denote
the fraction of a second spent in servicing the interrupt and processing a keystroke.
T
The ratio 1 is__________. (Rounded off to one decimal place)
T2
[Computer Organization & Architecture, Input Output Organization]
Ans. 10.2
Sol. Computer system polls keyboard every 10 ms.
1s 1000 ms
In one second, it polls 100 times
10 ms 10 ms
Each poll take 100 μs
So, total polling time =100 100 s 10 10 μs 10ms
3
ii. y funcp( ) x;
3 2 5
funcp ( )
2 1 x
3
300
f1 f 2 f 3 f1 f 2 f 3
f 3 f2 f 3 f1
f 3 f1
(C) main (D) main
f1 f1 f 2 f 3
f2 f3 f 2 f1
f3 f1
Ans. (A)
Sol. Following the execution sequence
Main ( )
F1 ( ) F 2 (2) F3 ( )
Return (1) x =2 Return (5)
F3 ( ) else
Return (5) return (x * F2 (x _ 1))
return (x * F2 (1))
F3 ( ) F1 (1)
Return (5) Return (1)
Hence, the correct option is (A).
Question 27
Consider the control flow graph shown.
PAGE GATE 2023 [Forenoon Session]
27 Computer Science Engineering
ENTRY
B1
i = m- 1
j=n
a = 10
B2
i = i +1
j=j-1
B3
a = 20
B4
i = a +1
EXIT
Which one of the following choices correctly lists the set of live variables at the exit point of each basic
block? [Compiler Design, Syntax Directed Translation]
(A) B1: {}, B2: {a}, B3: {a}, B4: {a}
(B) B1: {i, j}, B2: {a}, B3: {a}, B4: {i}
(C) B1: {a, i, j}, B2: {a, i, j}, B3: {a, i}, B4: {a}
(D) B1: {a, i, j}, B2: {a, j}, B3: {a, j}, B4: {a, i, j}
Ans. (D)
Sol. A variable 'V ' is live (for statement b ) if there exist a path from this statement to another statement is
' a ' in CFG such that for each b k a and V is defined in any statement k in CFG.
For B1 : There’s path to B2 , B3 and B4 .
In this path ' i ' and ' J ' are live as they’re both used before modifying.
' a ' is not live as it’s used in B3 before being used in B4 .
Another path is B2 B4
Where all 3 ' a ' , ' i ' and ' J ' are live so live variable at exit of B1 {a, i, J } .
For B2 : Similarly for path B3 , B4 ' J ' is live for path B4 ' a ' and ' J ' are live.
For B3 : Same as B1 as path for exit is same.
So, live variable at exits of B4 {a, i, J } .
i j m n a
B1 Live Live Dead Dead Live
B2 Dead Live Dead Dead Live
B3 Dead Live Dead Dead Live
B4 Live Live Dead Dead live
Hence, the correct option is (D).
Question 28
PAGE GATE 2023 [Forenoon Session]
28 Computer Science Engineering
Consider the two functions incr and decr shown below.
[Operating System, Process Management II]
incr(){ decr(){
wait(s); wait(s);
X = X+1; X = X-1;
signal(s); signal(s);
} }
There are 5 threads each invoking incr once, and 3 threads each invoking decr once, on the same shared
variable X. The initial value of X is 10.
Suppose there are two implementations of the semaphore s, as follows:
I-1: s is a binary semaphore initialized to 1.
I-2: s is a counting semaphore initialized to 2.
Let V1, V2 be the values of X at the end of execution of all the threads with implementations I-1, I-2,
respectively.
Which one of the following choices corresponds to the minimum possible values of V1, V2, respectively?
(A) 15, 7 (B) 7, 7
(C) 12, 7 (D) 12, 8
Ans. (C)
Sol. For implementation I1 :
Binary semaphore s 1 and incr ( ) called 5 times and decr ( ) called 3 times by threads
So, it alternate as sequence.
incr ( ) , decr ( ) , incr ( ) , decr ( ) , incr ( ) , decr ( ) which all make X as same value 10 and then two incre( )
making V1 12
For implementation I 2 :
Counting semaphore s 2 .
So, one possible sequence is
decr ( )
{
wait(s); //s becomes ‘1’
read X; //X becomes/reads and stores value 10.
---------------
Run incr ( ) 5 times
--------------
X 9 //write X .
Two more decr ( ) so, X 7 .
Value V2 7 .
Hence, the correct option is (C).
PAGE GATE 2023 [Forenoon Session]
29 Computer Science Engineering
Question 29
Consider the context-free grammar G below
S aSb X
X aX Xb a b
where S and X are non-terminals, and a and b are terminal symbols. The starting non-terminal is S.
Which one of the following statements is CORRECT?
[Theory of Computation, Properties of Language]
(A) The language generated by G is (a b)*
(B) The language generated by G is a *(a b)b *
(C) The language generated by G is a * b *(a b)
(D) The language generated by G is not a regular language
Ans. (B)
Sol. : Method 1 :
Option A : Since E can’t be generated by G so, option (A) is false, which accept E .
Option C : Since ' ba ' G but is accepted by a * b *(a b) 10(C ) s false.
Option D : It is false since the language generated has satisfied all conditions of being regular language.
Option B : It is true as it accepts all strings generated by a *(a b)b * .
Hence, the correct option is (B).
: Method 2 :
S asb
a xb a b
S a s b
a n sbn n 0
a n bn
an a bbn
an a bbn
a n a bb n
an a (a b)bbn
a (a b)b
Question 30
PAGE GATE 2023 [Forenoon Session]
30 Computer Science Engineering
Consider the pushdown automaton (PDA) P below, which runs on the input alphabet {a, b} , has stack
alphabet (, A) , and has three states {s, p, q} , with s being the start state. A transition from state u to
state v ¸labelled c / X / , where c is an input symbol or , X is a stack symbol, and is a string of stack
symbols, represents the fact that in state u, the PDA can read c from the input, with X on the top of its
stack, pop X from the stack, push in the string on the stack, and go to state v . In the initial configuration,
the stack has only the symbol in it.
The PDA accepts by empty stack.
a | | A
a | A | AA b | A |
b | A |
s p
| A | | A |
| A |
||
Which one of the following options correctly describes the language accepted by P?
[Theory of Computation, Pushdown Automata]
(A) {a b 1 m and n m}
m n
(B) {ambn 0 n m}
(D) {a 0 m} {b 0 n}
m n
(C) {a mbn 0 m and 0 n}
Ans. (A)
Sol. : Method 1 :
Option B : This option is not true since E is not accepted by P .
Option C : This option is false since E is not accepted by P .
Option D : This option is false since E is not accepted by P .
Option A : It accept all strings generated by P .
Hence, the correct option is (A).
: Method 2 :
From the given diagram it is clear that the starting symbol in the input string must be ‘a’ and on every ‘a’
it pushes ‘A’ into stack. If the input string becomes empty it goes to the state Q and it empties the stack.
This means that PDA accepts the language
L a n n 1
PAGE GATE 2023 [Forenoon Session]
31 Computer Science Engineering
If after a’s in the input string if b’s comes then for every ‘b’ it will be delete ‘A’ from the stack. When the
string becomes empty if the top most symbol in the stack in ‘A’ then the PDA empties the stack. This
means the PDA accepts the language.
L a mb n n m
L a m m 1 a m
b n n m
OR
L a mb n 1 m and n m
Question 31
Consider the given C-code and its corresponding assembly code, with a few operands U1–U4 being
unknown. Some useful information as well as the semantics of each unique assembly instruction is
annotated as inline comments in the code. The memory is byte-addressable.
//C-code ;assembly-code (; indicates comments)
;r1-r5 are 32-bit integer registers
;initialize r1=0, r2=10
;initialize r3, r4 with base address of a, b
int a[10], b[10], i; L01: jeq r1, r2, end ;if(r1==r2) goto end
// int is 32-bit L02: lw r5, 0(r4) ;r5 <- Memory[r4+0]
for (i=0; i<10;i++) L03: shl r5, r5, U1 ;r5 <- r5 << U1
a[i] = b[i] * 8; L04: sw r5, 0(r3) ;Memory[r3+0] <- r5
L05: add r3, r3, U2 ;r3 <- r3+U2
L06: add r4, r4, U3
L07: add r1, r1, 1
L08: jmp U4 ;goto U4
L09: end
Which one of the following options is a CORRECT replacement for operands in the position (U1, U2,
U3, U4) in the above assembly code?
[Computer Organisation & Architecture, Machine Instruction & Addressing Format]
(A) (8, 4, 1, L02) (B) (3, 4, 4, L01)
(C) (8, 1, 1, L02) (D) (3, 1, 1, L01)
Ans. (B)
Sol. : Method 1 :
PAGE GATE 2023 [Forenoon Session]
32 Computer Science Engineering
Here an analyzing code we can observe that. We are to shift value of r5 left by u places. In code were
multiplying element of b by 8. So, u1 3 , which is same as multiplying value by 8 or 23 .
Also, r3 and r4 stores storing address of next element of arrays a and v. Since it’s 32 bit system and size
of int is 4B so well increment by 4 so, value of u2 and u3 s 4.
We have to jump to short of code i.e. L01 so that for-loop can be run.
So, u4 is L01 .
Hence, the correct option is (B).
: Method 2 :
Since memory is byte addressable and integer is 32 bit means 4 byte.
So increment variables and byte needed to add.
LO5 : add r3 , r3 ,U 2 r3 r3 u2
Here, U 2 4
Similarly, U 3 4
LO8 JUMP U4;goto U4
Decoder
X1 CS X2 CS X3 CS X4 CS
Q0
IA4 A1 Q1
IA3 A0 Q 2
Q3
The input memory addresses (IA11–IA0), in decimal, for the starting locations (Addr=0) of each block
(indicated as X1, X2, X3, X4 in the figure) are among the options given below. Which one of the following
options is CORRECT?
(A) (0, 1, 2, 3) (B) (0, 1024, 2048, 3072)
(C) (0, 8, 16, 24) (D) (0, 0, 0, 0)
Ans. (C)
Sol. The addresses are of length 12 bits.
The 2:4 decoder with input IA3 and IA4 decides which chip is selected.
Possible values of IA4 IA3 at 4.
For starting address the valued I11.....I5 remains '0 ' and we’re focused on value from I 4 ......I0 .
So,
I4 I2 Resulting value/Starting address
0 0 (X0 ) 0(00000)
0 1 ( X1 ) 8(01000)
1 0 (X2) 16(10000)
1 1 ( X3) 24(11000)
T D T
Q Q Q
Q1 Q2 Q3
CLKIN
CLK CLK CLK
Which one of the given values of (Q1, Q2, Q3) can NEVER be obtained with this digital circuit?
[Digital Logic, Sequential Circuit]
(A) (0, 0, 1) (B) (1, 0, 0)
(C) (1, 0, 1) (D) (1, 1, 1)
Ans. (A)
Sol. Given circuit is made from two T flip flops and one D flp-flop.
Here, T1 Q3
So, Q1 T1 Q1 Q3 Q1 Q3 Q1
Also, D2 Q1
So, Q2 Q1
Now, T3 Q2
Q3 T3 Q2 Q3 Q2
The state table looks like :
Q1 Q2 Q3 T1 Q3 Q1 D2 Q1 T3 Q2 Q3
0 1 1 0 0 0
0 0 0 1 0 0
1 0 0 0 1 0
0 1 0 1 0 1
1 0 1 1 1 1
1 1 1 1 1 0
1 1 0 0 1 1
X7 3
S1 S0
A
C
B
Which one of the following set of values of (X0, X1, X2, X3, X4, X5, X6, X7) will realise the Boolean
function A A.C A.B.C ?
(A) (1, 1, 0, 0, 1, 1, 1, 0) (B) (1, 1, 0, 0, 1, 1, 0, 1)
(C) (1, 1, 0, 1, 1, 1, 0, 0) (D) (0, 0, 1, 1, 0, 1, 1, 1)
Ans. (C)
Sol. Given :
F A A C ABC .
Since final output is given by 2 1 mux m3
So, MSB (most significant bit) is selection line of m3 i.e. B .
Also we can observe from M 1 and M 2 , that the selection lines (S1, S0 ) ( A, C) so the function has C
as LSB
The function F ( B, A, C) A AC ABC is implemented using inputs as :
B A C
X0 0 0 0 1 Due to A '
X1 0 0 1 1 Due to A '
X2 0 1 0 0
X3 0 1 1 1 Due to AB ' C
PAGE GATE 2023 [Forenoon Session]
36 Computer Science Engineering
X4 1 0 0 1 Due to A '
X5 1 0 1 1 Due to A '
X6 1 1 0 0
X7 1 1 1 0
Similarity, Q 0x3F5C2EE4 0011 1111 0101 1100 0010 1110 1111 0100
Sign 0
Biased exponent 126
Actual exponent 126 127 1
1
So, Q 1.10111000010111011110100 2
P * Q 1.10111000010111011110100 21 24
P * Q 1.10111000010111011110100 23
Sign 1
Biased exponent 127 3 130 10000010 .
The number in IEEE-754 format is :
0xC15C2EF4
Hence, the correct option is (C).
Question 36
Let A be a priority queue for maintaining a set of elements. Suppose A is implemented using a max-heap
data structure. The operation Extract-Max(A) extracts and deletes the maximum element from A. The
operation Insert(A, key) inserts a new element key in A. The properties of a max-heap are preserved at
the end of each of these operations.
When A contains n elements, which one of the following statements about the worst case running time of
these two operations is TRUE? [Data Structure, tree]
(A) Both Extract-Max(A) and Insert(A, key) run in O(l).
(B) Both Extract-Max(A) and Insert(A, key) run in O(log(n)).
(C) Extract-Max(A) runs in O(l) whereas Insert(A, key) runs in O(n).
(D) Extract-Max(A) runs in O(l) whereas Insert(A, key) runs in O(log(n)).
Ans. (B)
Sol. Since both extract-max (A) and Insert (A) needs to perform heapify ( ) operation, both take 0(log(n))
time.
Hence, the correct option is (B).
Question 37
Consider the C function foo and the binary tree shown.
10
5 11
3 8 13
int foo(node *p ) {
int retval;
if (p == NULL)
return 0;
else {
retval = p->val + foo(p->left) + foo(p->right);
PAGE GATE 2023 [Forenoon Session]
38 Computer Science Engineering
printf("%d ", retval);
return retval;
}
}
When foo is called with a pointer to the root node of the given binary tree, what will it print?
[Data Structure, Tree]
(A) 3 8 5 13 11 10 (B) 3 5 8 10 11 13
(C) 3 8 16 13 24 50 (D) 3 16 8 50 24 13
Ans. (C)
Sol. : Method 1 :
Given : Retval P val foo( P left) foo( P right )
Now, considering given tree with root 10.
Retval 10 foo( P left) foo( P right)
So, until we execute leaf node we won’t get to return to root node.
Also child-Nodes 3, 8 and 13 will return value of leaf nodes, i.e. 3,8 and 13 only.
So, 5 node will return 5 3 8 16 .
11 node will return 11 13 24
10 node will return 10 16 24 50
Since there’s no rule about evaluation order of parameters of ' ' but considering/assuming left right rule
by default we get output as : 3,8,16,13, 24,50 .
Hence, the correct option is (C).
: Method 2 :
Ret val P val F 00( P Left) F 00( P Right)
10+16+24
10 Retval = 50
5+3+8
Retval = 16 5 11+0+13
11
Retval = 24
3
8 13
3+0+0 8+0+0 13+0+0
Retval = 3 Retval = 8 Retval = 13
A U , B U and A B K
A B
Case 1 : If all element of A appear before the element of B then number of permutation
nc2 K (n 2K )! K ! K !
nc2 K (n 2 K )! ( K !) 2
Case 2 : If all element of B appears before the elements of A then number of permutation
nc2 K (n 2K )! K ! K !
nc2 K (n 2 K )! ( K !) 2
Total permutation
Case-1 + Case-2
n
(n 2 K )! ( K !)
2
2
2K
Hence, the correct option is (D).
Question 39
Let f : A B be an onto (or surjective) function, where A and B are nonempty sets. Define an equivalence
relation ∼ on the set A as
a ~ a2 if f (a1 ) f (a2 ) ,
Where a1 , a2 A . Let {[ x]: x A} be the set of all the equivalence classes under ∼. Define a new
mapping F : B as
F ( x ) f ( x) , for all the equivalence classes [x] in .
Which of the following statements is/are TRUE?
PAGE GATE 2023 [Forenoon Session]
40 Computer Science Engineering
[Discrete Mathematics & Graph theory, Set theory and Algebra]
(A) F is NOT well-defined. (B) F is an onto (or surjective) function.
(C) F is a one-to-one (or injective) function. (D) F is a bijective function.
Ans. (B), (C), (D)
Sol. The equivalence relation on set A is defined as :
a1 ~ a2 if f (a1 ) f (a2 )
Where a1 , a2 EA .
Consider ai , bi ci .........EA and , r..........EB and the mapping a3 :
a1 , a2 , a3 .......an
Similarity,
b1 , b2 , b3 .......bn and so on……….
According to equivalent, equivalent loss is :
[a1 ] [a2 ] [a3 ] .......... [am ]
[b1 ] [b2 ] [b3 ] .......... [bn ] ………and so on.
So, set of equivalence classes under relation is :
{[a1 ],[b1 ],[c1 ] …..}
Now, given new mapping F B as :
F ([ x]) F ( x) for all [ x] E
It means mapping will be :
a1 , b1 , c1 r …………….and so on.
Since, all distinct a1 , b1 , c1............... maps to different element of set B . SO F is injective.
We’ve considered {a1 , b1 , c1......} as leaders of their equivalent class.
We can also consider {a2 , b2 , c2 ......}
Also, its cleared from mapping of F that all the elements of set B are
So, F is subjective.
Since F is both injective and subjective so F is bijective.
Also, we con observe that is well-defined function since its bijective.
Hence, the correct options are (B), (C), (D).
Question 40
Suppose you are asked to design a new reliable byte-stream transport protocol like TCP. This protocol,
named myTCP, runs over a 100 Mbps network with Round Trip Time of 150 milliseconds and the
maximum segment lifetime of 2 minutes.
Which of the following is/are valid lengths of the Sequence Number field in the myTCP header?
[Computer Network, Transport Layer]
PAGE GATE 2023 [Forenoon Session]
41 Computer Science Engineering
(A) 30 bits (B) 32 bits
(C) 34 bits (D) 36 bits
Ans. (B), (C) (D)
Sol. Given bandwidth (BW) = 100 Mbps
So, in 1 second we can send 100 106 bits
125 103 B
In 120 seconds 120 125 103 B
15000 105 B
Since n lifetime of 120 seconds 15 108 bytes are generated, so
Sequence number bits log 2 (15 108 )
30.48
31 bits
Hence, the correct options are (B), (C) & (D).
Question 41
Let X be a set 2 X and denote the powerset of X.
Define a binary operation on 2 X as follows :
AB ( A B) ( B A).
Let H (2 X , ). Which of the following statements about H is/are correct?
[Discrete Mathematics Set theory & Algebra]
(A) H is a group.
(B) Every element in H has an inverse, but H is NOT a group.
(C) For every A 2 X , the inverse of A is the complement of A.
(D) For every A 2 X , the inverse of A is A.
Ans. (A), (D)
Sol. The symmetric difference is similar to EXOR operation in digital logic.
Now left check it for following properties :
1. Closure property : Operator is defined as
AB ( A B) ( B A)
( A B) ( A B)
2 X is power set of X , so it contains all subset of X .
So, AB 2 A, B 2 .
X X
So, ( A B) ( A B)
It’s possible ( A B) ( A B)
If A B then its possible.
Hence, every element of 2 X is it’s own inverse and H is a group.
Hence, the correct options are (A) & (D).
Question 42
Suppose in a web browser, you click on the www.gate-2023.in URL. The browser cache is empty. The IP
address for this URL is not cached in your local host, so a DNS lookup is triggered (by the local DNS
server deployed on your local host) over the 3-tier DNS hierarchy in an iterative mode. No resource
records are cached anywhere across all DNS servers.
Let RTT denote the round trip time between your local host and DNS servers in the DNS hierarchy. The
round trip time between the local host and the web server hosting www.gate-2023.in is also equal to RTT.
The HTML file associated with the URL is small enough to have negligible transmission time and
negligible rendering time by your web browser, which references 10 equally small objects on the same
web server.
Which of the following statements is/are CORRECT about the minimum elapsed time between clicking
on the URL and your browser fully rendering it? [Computer Network & Transport Layer]
(A) 7 RTTs, in case of non-persistent HTTP with 5 parallel TCP connections.
(B) 5 RTTs, in case of persistent HTTP with pipelining.
(C) 9 RTTs, in case of non-persistent HTTP with 5 parallel TCP connections.
(D) 6 RTTs, in case of persistent HTTP with pipelining.
Ans. (C), (D)
Sol. Case I :
Persistent HTTP : TCP connection is established once and multiple files are transmitted in single
connection.
Pipelined : New HTTP request can be sent to server without receiving acknowledgement of previous.
a client request a page from server, following steps are followed in order before gets all data needed :
(i) There’s 3-tier DNS hierarchy, it is done in iterative mode taking 3 RTT.
(ii) 1 RTT is used for TCP connection establishment.
(iii) 1 RTT is used to fetch HTML base file.
(iv) 1 RTT is for all other 10 objects.
So, total 6 RTT’s are used.
Case-II : Non persistent HTTP with 5 parallel connections :
Non persistent : TCP connection is made for each HTTP request and closed.
5-parallel connections : 5 objects could be sent parallel at same time.
PAGE GATE 2023 [Forenoon Session]
43 Computer Science Engineering
So, in this case the client have to wait for request to be fulfilled as following steps need to be completed.
(i) 3 RTT for DNS resolution.
(ii) 1 RTT for TCP connection establishment.
(iii) 1 RTT for fetch base HTML page.
(iv) 1 RTT for TCP connection establishment.
(v) 1 RTT to get 5 objects parallely (5 still test)
(vi) 1 RTT for TCP connection establishment
(viii) 1 RTT for getting remaining 5 objects.
In total it takes RTT’s = 9
Hence, the correct options are (C) & (D).
Question 43
Consider a random experiment where two fair coins are tossed. Let A be the event that denotes HEAD on
both the throws, B be the event that denotes HEAD on the first throw, and C be the event that denotes
HEAD on the second throw. Which of the following statements is/are TRUE?
[Engineering Mathematics, Probability]
(A) A and B are independent. (B) A and C are independent.
(C) B and C are independent. (D) Prob( B|C) Prob( B)
Ans. (C, D)
Sol. Let, A be the event that denotes HEAD on both the throws.
Let, B be the event that denotes HEAD on the first throw.
Let, C be the event that denotes HEAD on the second throw.
For, Event A (Head on both coins), only one case is feasible which is HH.
1
P( A)
4
For, Event B (Head on first coins), only two cases are feasible which is HH, HT.
1
P( B)
2
For, Event C (Head on second coins), only one case is feasible which is HH, TH.
1
P (C )
2
NOTE : Two or more events are said to be independent, when the occurrence of one event does not
affect the occurrence of other event.
In case of Independent Events : P( A B) P( A). P( B)
1
P( A B)
2
1
P( A)
4
1
P( B)
2
1
P( A).P( B)
8
1
P( A)
4
P(C ) 1/ 2
P( A).P(C) 1/ 8
P( B) 1/ 2
P(C ) 1/ 2
P( B).P(C ) 1/ 4
PAGE GATE 2023 [Forenoon Session]
45 Computer Science Engineering
Clearly, P( B C) P( B).P(C). So, option C is TRUE.
Option D : P( B / C) P( B)
P( B / C) P( B C) / P(C)
P(C ) 1/ 2
P( B) 1/ 2
But we need 3 colours to color it also, number of neighbor’s can’t be more than the degree, i.e . G .
So, at most G 1 colours needed.
This option is true.
For Option (C) It’s False as we have explained above.
For Option (D) It is not always the case as sometimes we might see that greedy coloring might not be
giving optimal result. Consider example.
Uses 3 color
When coloured greedily in order (v1 , v2 .......v6 ) . 90, number of color used Chromatic number of graph
Hence, the correct options are (A) & (B).
Question 46
Let U {1,2,3}. Let 2U denote the powerset of U. Consider an undirected graph G whose vertex set is
2U . For any A, B 2U , ( A, B) is an edge in G if and only if (i) A B, and (ii) either A B or B A. For
any vertex A in G, the set of all possible orderings in which the vertices of G can be visited in a Breadth
First Search (BFS) starting from A is denoted by B( A).
If denotes the empty set, then the cardinality of B() is _______.
[Discrete Mathematics, Graph theory]
Ans. 5040
Sol. Here, given that U <1, 2, 3>
Vertex set Power set of U 2U { , <1>, <2>, <3>, <1,2>, <1,3>, <2,3>, <1,2,3>}
So, number of vertices 8
Now, there’s edge between A and B if either of them is proper subset of another.
Since, is proper subset of all other vertices except itself, so its’ connected to all 7 vertices. Since it can
be visited in any order.
PAGE GATE 2023 [Forenoon Session]
48 Computer Science Engineering
1,3
2,3
1,2
1,2,3 3
1 2
Step -2 :
1 3 7 8 9 2
Head Tail
Step-3 :
9
TOS
8
7
5
1
Step – 4 :
5 7 8 9 2
Head Tail
Step – 5 :
8 TOS
7
5
1
Step – 6 :
7 8 9 2
Head Tail
Step – 7 :
Step-8 :
PAGE GATE 2023 [Forenoon Session]
51 Computer Science Engineering
Step – 9 :
9
TOS
8
7
8
7
5
1
Step – 10 :
8
TOS
7
8
7
5
1
‘8’ in Top of stack So answer is 8.
Hence, the correct option is 8.
Question 50
Consider the syntax directed translation given by the following grammar and semantic rules. Here N, I, F
and B are non-terminals. N is the starting non-terminal, and #, 0 and 1 are lexical tokens corresponding to
input letters “#”, “0” and “1”, respectively. X.val denotes the synthesized attribute (a numeric value)
associated with a non-terminal X. I1 and F1 denote occurrences of I and F on the right hand side of a
production, respectively. For the tokens 0 and 1, 0.val = 0 and 1.val = 1.
N I #F N .val I .val F .val
I I1B I .val (2I1.val ) B.val
I B I .val B.val
1
F B F1 F .val ( B.val F1.val )
2
1
F B F .val B.val
2
PAGE GATE 2023 [Forenoon Session]
52 Computer Science Engineering
B 0 B.val 0.val
B 1 B.val 1.val
The value computed by the translation scheme for the input string
10 # 011
is _______. (Rounded off to three decimal places)
[Compiler Design, Syntax Directed Translation]
Ans. 2.375
Sol.
Index File
Block Anchor Block
Primary key Pointer
Suppose the block size of the file system is 1024 bytes, and a pointer to a block occupies 5 bytes. The
system uses binary search on the index file to search for a record with a given key. You may assume that
a binary search on an index file of b blocks takes [log2 b] block accesses in the worst case.
Given a key, the number of block accesses required to identify the block in the data file that may contain
a record with the key, in the worst case, is _______.
[Database, File Structure]
Ans. 6
PAGE GATE 2023 [Forenoon Session]
54 Computer Science Engineering
Sol. Given database is stored as ordered file and indexed by primary index file
There’re 25,000 records
100 B records size
15 B Primary key size
5B Pointer size
1024 B Block size
It’s stored in unspanned organization.
Block size 1024B
So, Number of records per block 10
Record size 100 B
Number of records 25000
Number of data blocks needed = 10 2500
Number of records per block
Block size 1024 1024
No. of Index records per block 51
primany key size Pointer size 15 5 20
2500
Number of index block needed 50
51
Applying binary search, log2 (50) 6
Hence, the correct answer is 6.
Question 53
Consider the language L over the alphabet {0, 1}, given below :
L {{0,1}*| does not contain three or more consecutive 1’s}.
The minimum number of states in a Deterministic Finite-State Automaton (DFA) for L is _______.
[Theory of Computation, Finite Automata]
Ans. 4
Sol. Say L : set of strings containing 3 consecutive is.
The MDFA for L