0% found this document useful (0 votes)
219 views39 pages

CS GATE 2019 Solutions

This document provides detailed solutions to questions from the GATE 2019 Computer Science & IT exam, which was held on February 3, 2019. It begins by providing the solutions to 6 questions from the General Aptitude section in a question-answer format. This is followed by a multi-part word problem question involving Venn diagrams and sets. The document advertises classroom programs and test series from Made Easy to help prepare for the ESE 2019 Mains exam.

Uploaded by

Lakshay Kakkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
219 views39 pages

CS GATE 2019 Solutions

This document provides detailed solutions to questions from the GATE 2019 Computer Science & IT exam, which was held on February 3, 2019. It begins by providing the solutions to 6 questions from the General Aptitude section in a question-answer format. This is followed by a multi-part word problem question involving Venn diagrams and sets. The document advertises classroom programs and test series from Made Easy to help prepare for the ESE 2019 Mains exam.

Uploaded by

Lakshay Kakkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

GATE 2019

Computer Science & IT

Click here for


Questions and Solutions

Date of Exam : 3/2/2019


Scroll down to view

www.madeeasy.in
Corporate Office: 44-A/1, Kalu Sarai, New Delhi - 110016 | Ph: 011-45124612, 9958995830

Delhi | Hyderabad | Noida | Bhopal | Jaipur | Lucknow | Indore | Pune | Bhubaneswar | Kolkata | Patna
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

GENERAL APTITUDE
Q.1 Two cars start at the same time from the same location and go in the same direction.
The speed of the first car is 50 km/h and the speed of the second car is 60 km/h. The
number of hours it takes for the distance between the two cars to be 20 km is ________.
(a) 1 (b) 2
(c) 3 (d) 6

Ans. (b)
Speed of car A = 50 km/hr
Speed of car B = 60 km/hr
Since, both cars A and B are moving in same direction, the relative speed = 60 – 50
= 10 km/hr
Distance required between them = 20 km

Distance 20
∴ Time = = = 2 hrs
Speed 10

Q.2 The expenditure on the project ________ as follows; equipments Rs. 20 lakhs, salaries
Rs. 12 lakhs, and contingency Rs.3 lakhs.
(a) break (b) breaks
(c) breaks down (d) break down

Ans. (c)
‘Breaks down’ is a transitive phrasal verb which means to divide something such as
a total amount into separate parts.
Option (c) is most appropriate.

Q.3 Ten friends planned to share equally the cost of buying a gift for their teacher. When
two of them decided not to contribute, each of the other friends had to pay Rs. 150
more. The cost of the gift was Rs. ________.
(a) 12000 (b) 6000
(c) 3000 (d) 666

Ans. (b)
Let share of each student = x
Total cost of gift = 10 × x
x= 8(x + 150)
x= 600
Total cost = 10 × 600 = 6000

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 2
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.4 A court is to a judge as ________ is to a teacher.


(a) a syllabus (b) a school
(c) a student (d) a punishment

Ans. (b)
A ‘court’ is for a ‘judge’ as a ‘school’ is for a ‘teacher’.
Court is a place where a judge works.
Similarly, school is a place where a teacher works.

Q.5 The search engine’s business model ________ around the fulcrum of trust.
(a) plays (b) bursts
(c) revolves (d) sinks

Ans. (c)
The search engine business model revolves around the fulcrum of trust.
Fulcrum is any thing that plays a central or essential role in an activity, event, or situation.
Thus, out of the given options, ‘revolves’ is the most appropriate.

Q.6 In a college, there are three student clubs. Sixty students are only in the Drama club.
80 students are only in the Dance club, 30 students are only in the Maths club.
40 students are in both Drama and Dance clubs. 12 students are in both Dance and
Maths clubs, 7 students are in both Drama and Maths clubs, and 2 students are in all
the clubs. If 75% of the students in the college are not in any of these clubs, then the
total number of students in the college is ________.
(a) 225 (b) 1000
(c) 975 (d) 900

Ans. (d)

Dance
60 38 80
Drama 2
5 10

30

Maths

Total number of students = 60 + 80 + 30 + 38 + 5 + 10 + 2 = 225


25% = 225
225
⇒ 100% = × 100 = 900
25

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 3
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.7 The police arrested four criminals – P, Q, R and S. The criminals knew each other. They
made the following statements:
P says “Q committed the crime.”
Q says “S committed the crime.”
R says “I did not do it.”
S says “What Q said about me is false.”
Assume only one of the arrested four committed the crime and only one of the statements
made above is true. Who committed the crime?
(a) R (b) P
(c) S (d) Q

Ans. (a)
Suffix C as criminal, NC as not criminal.
Case I:

Criminals P Q R S
Assumption T F F F
Result QC SNC RC SC
Q and R are criminal in the result is impossible because only one person committed
the crime.
Case II:

Criminals P Q R S
Assumption F T F F
Result QNC SC RC SC
S and R are criminal in the result is impossible because only one person committed
the crime.
Case III:

Criminals P Q R S
Assumption F F T F
Result QNC SNC RNC SC
SNC and SC in the result which is contradiction. [S committed crime and same time not
committed crime which is contradiction]
Case IV
IV::

Criminals P Q R S
Assumption F F F T
Result QNC SNC RC SNC
R is criminal in the result.
Hence this case satisfies only one person committed the crime.
So option (a) is correct.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 4
India’s Best Institute for IES, GATE & PSUs

ESE 2019
Mains Mains
Classroom Test
Program Series
Conventional Ques. Conventional
Practice Program Test Series

Commencing from Commencing from


th th
20 Feb, 2019 17 Mar, 2019
These batches are offered only Test series will be conducted at
at Delhi Centre. all MADE EASY centres across India.

Features :
Very useful to develop numerical solving approach & improving writing skills.
Special focus on improving answer layout specially for theory questions.
Classes will be delivered by senior faculties.
Updated Mains workbook for every subject having varied practice question sets.
Test series will be conducted on every Sunday in synchronisation with the subject taught in class.
Discussion on probable questions.
Comprehensive and in-depth discussion on variety of conventional questions, thus strengthening fundamental concepts.

Batch Course Duration Class Duration Test Series


Details 90 days | 300 - 350 hours 5-6 days a week and 6-7 hours a day Every Sunday

Streams Batch Code Batch Commencing Date Venue (Delhi) Timing

ME A 20-Feb-2019 Ghitorni Centre 7:30 AM to 1:30 PM


ME B 20-Feb-2019 Ghitorni Centre 3:00 PM to 9:00 PM
ME C 20-Feb-2019 Saket Centre 7:30 AM to 1:30 PM
CE A 21-Feb-2019 Ignou Road Centre 7:30 AM to 1:30 PM Hostel
CE B Kalu Sarai Centre 3:00 PM to 9:00 PM
EE A
21-Feb-2019
22-Feb-2019 Lado Sarai Centre 7:30 AM to 1:30 PM
facility
EE B 22-Feb-2019 Kalu Sarai Centre 3:00 PM to 9:00 PM
will be
EC A 22-Feb-2019 Lado Sarai Centre 7:30 AM to 1:30 PM
arranged

Ex. MADE EASY Students


Program Non MADE EASY
Enrolled in Postal, Rank Improvement, Mains, GS,
Post-GATE, ESE+ GATE, GATE Batches
students
Fee Mains Exclusive Batch
Structure (Inclusive of ESE-2019 Mains Offline Test Series)
` 18,500 ` 22,500

ESE 2019 Mains Offline Test Series Rs. 3,500/- Rs. 2,500/- Rs. 4,500/- Rs. 3,500/-

Rs. 1000/- Discount on test series valid till 15-02-2019

Corporate office : 44-A/1, Kalu Sarai, New Delhi - 1100 16 011-45124612, 9958995830 Click here to enroll
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.8 In the given diagram, teachers are represented in the triangle, researchers in the circle
and administrators in the rectangle. Out of the total number of the people, the percentage
of administrators shall be in the range of ________.
Teachers
10
70

20 Administrators

20
Researchers
40

(a) 46 to 60 (b) 0 to 15
(c) 31 to 45 (d) 16 to 30

Ans. (c)
Administrators
Percentage of Administrators = × 100
Total
50
= × 100 = 31.25
160

Q.9 Three of the five students allocated to a hostel put in special requests to the warden.
Given the floor plan of the vacant rooms, select the allocation plan that will accommodate
all their requests.
Request by X : Due to pollen allergy. I want to avoid a wing next to the garden.
Request by Y : 1 want to live as far from the washrooms as possible, since I am very
sensitive to smell.
Request by Z : I believe in Vaastu and so want to stay in the South-West wing.
The shaded rooms are already occupied. WR is washroom.

WR X WR Z
Garden
Garden

N E N E

(a) Z Entrance (b) Entrance

W S Y W S Y
Garden
Garden

WR WR X

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 5
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

WR WR

Garden

Garden
N E N E

(c) Entrance (d) Z Entrance

W S Y W S

Garden

Garden
WR X Z WR X Y

Ans. (c)

Q.10 “A recent High Court judgement has sought to dispel the idea of begging as a disease
— which leads to its stigmatization and criminalization — and to regard it as a symptom.
The underlying disease is the failure of the state to protect citizens who fall through the
social security net”.
Which one of the following statements can be inferred from the given passage?
(a) Begging is an offence that has to be dealt with firmly
(b) Beggars are created because of the lack of social welfare schemes
(c) Begging has to be banned because it adversely affects the welfare of the state
(d) Beggars are lazy people who beg because they are unwilling to work

Ans. (b)
The passage states that the underlying disease behind begging is the failure of the
state to protect citizens who fall through the social security net.
Only option (b) can be inferred from this.

„„„„

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 6
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

COMPUTER SCIENCE
Q.1 A certain processor uses a fully associative cache of size 16 kB. The cache block size
is 16 bytes. Assume that the main memory is byte addressable and uses a 32-bit
address. How many bits are required for the Tag and the Index fields respectively in
the addresses generated by the processor?
(a) 28 bits and 0 bits (b) 24 bits and 0 bits
(c) 28 bits and 4 bits (d) 24 bits and 4 bits

Ans. (a)
Cache memory size = 16 kB
Block size = 16 B
Main memory address = 32 bit

16 K 214
Number of lines (N) = ⇒ 4 = 210
16 2
Fully associative cache memory (N-way)

N 210
So, number of sets (S) = ⇒ 10 = 1
P-way 2

32 bit

∴ Address format: TAG WO

28 bit log216 = 4 bit

So, TAG = 28 bit


Index = 0 bit (No address)

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 7
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.2 Let G be an undirected complete graph, on n vertices, where n > 2. Then, the number
of different Hamiltonian cycles in G is equal to
(a) n ! (b) (n – 1)!

(n − 1)!
(c) 1 (d)
2

Ans. (d)
In a complete graph we can traverse the n vertices in any order and return to the starting
vertex and form a Hamiltonian cycle. The number of such cycles will be n!
However, since circular rotations will have to ignored. Since for example K4 with vertices
{1, 2, 3, 4}, the cycle 1-2-3-4 is same as 2-3-4-1 is same as 3-4-1-2 etc. we now get
only (n – 1)! distinct Hamiltonian cycles. Further, the cycle 1-2-3-4 and 1-4-3-2 are also
same (clockwise and anticlockwise).

(n − 1)!
So ignoring this orientation also we finally get distinct Hamiltonian cycles which
2
is option (d).

Q.3 Consider the grammar given below:


S → Aa
A → BD
B → b⏐∈
D → d⏐∈
Let a, b, d and $ be indexed as follows:

a b d $
3 2 1 0
Compute the FOLLOW set of the non-terminal B and write the index values for the
symbols in the FOLLOW set in the descending order. (For example, if the FOLLOW set
is {a, b, d, $}, then the answer should be 3210)

Ans. (31)
S → Aa
A → BD
B → b⏐∈
D → d⏐∈
Follow (B) = {d, a}
Hence their index in descending order is 31.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 8
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.4 Consider a sequence of 14 elements: A = [–5, –10, 6, 3, –1, –2, 13, 4, –9, –1, 4, 12,

–3, 0]. The subsequence sum S (i, j ) = ∑ kj =1A[k ]. Determine the maximum of S (i, j ),
where 0 ≤ i ≤ j < 14. (Divide and conquer approach may be used.)

Ans. (29)

Q.5 Consider the following C program:


#include <stdio.h>
int main ( ) {
int arr[ ] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 5}, *ip = arr + 4;
printf (“%d\n”, ip[1])’
return 0;
}
The number that will be displayed on execution of the program is ________.

Ans. (6)

Q.6 Two numbers are chosen independently and uniformly at random from the set {1, 2, ...,13}.
The probability (rounded off to 3 decimal places) that their 4-bit (unsigned) binary
representations have the same most significant bit is ________.

Ans. (0.503)

Q.7 In 16-bit 2’s complement representation, the decimal number –28 is:
(a) 1111 1111 0001 1100 (b) 1111 1111 1110 0100
(c) 0000 0000 1110 0100 (d) 1000 0000 1110 0100

Ans. (b)
+28 ⇒ 0000 0000 0001 1100
–28 ⇒ 1111 1111 1110 0100 (2’s complement form)

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 9
*As per ASSOCHAM & Brands Academy

Announcing

NEW BATCHES
for ESE 2020 & GATE 2020
1 Yr/2Yrs CLASSROOM COURSES

Early start Extra edge

Batches Commencement Dates


Regular Batches Weekend Batches
Delhi Delhi Noida
CE 14-Feb-2019 CE 09-Feb-2019 16-Feb-2019
ME 14-Feb-2019 ME NA 03-Feb-2019
EE 18-Feb-2019 EE 23-Feb-2019 16-Feb-2019
EC Mid-Feb, 2019 EC 23-Feb-2019 16-Feb-2019
CS 16-May-2019
CS 17-Feb-2019

Rest of India (Regular Batches)


Patna Lucknow Bhopal Indore Jaipur
25-Feb'19 20-Feb'19 25-Feb'19 20-Feb'19 17-Feb'19

Pune Hyderabad Bhubaneswar Kolkata


11-Feb'19 17-Feb'19 25-Feb'19 2-Mar'19

Admission open
Corporate office : 44-A/1, Kalu Sarai, New Delhi - 1100 16 011-45124612, 9958995830
Delhi Hyderabad Noida Jaipur Bhopal Lucknow Indore Bhubaneswar Pune Kolkata Patna
Centres 011-45124612 040-66774612 0120-6524612 0141-4024612 0755-4004612 09919111168 0731-4029612 09040299888 020-26058612 8981888880 0612-2356615
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.8 Which one of the following is NOT a valid identity?


(a) x ⊕ y = (xy + x′y ′)′ (b) x ⊕ y = x + y, if xy = 0
(c) (x ⊕ y ) ⊕ z = x ⊕ (y ⊕ z) (d) (x + y) ⊕ z = x ⊕ (y + z)

Ans. (d)
(a) x ⊕ y = ( xy + x′y ′)′

= ( x  y )′
= x ⊕ y, it is valid.
(b) x ⊕ y = ( x + y )( x + y )
= ( x + y ) xy
= (x + y )0
= (x + y ), so it is valid.
(c) (x ⊕ y ) ⊕ z = x ⊕ (y ⊕ z)
Associativity is true on Ex-OR operator so it valid.
(d) (x + y ) ⊕ z = (x + y ) ⋅ z + (x + y)z
= x y z + xz + yz
1 4,6 2,6
= ∑m (1, 2, 4, 6)
x ⊕ (y +z) = x (y + z) + x(y + z)
= x y + xz + x y z
2,3 1,3 4
= ∑m (1, 2, 3, 4)
(x + y ) ⊕ z ≠ x ⊕ (y + z)
So option (d) is invalid.

Q.9 Which one of the following kinds of derivation is used by LR parsers?


(a) Rightmost (b) Rightmost in reverse
(c) Leftmost (d) Leftmost in reverse

Ans. (b)
LR parser is a bottom up parser. Hence it uses right most derivation in reverse order.
So option (b) is the correct answer.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 10
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.10 Which one of the following statements is NOT correct about the B+ tree data structure
used for creating an index of a relational database table?
(a) Key values in each node are kept in sorted order
(b) Each leaf node has a pointer to the next leaf node
(c) B+ tree is a height balanced tree
(d) Non-leaf nodes have pointers to data records

Ans. (d)
• B+ tree non leaf node have pointer to data records is false statement.
• B+ tree non leaf node consists of only keys and tree pointers (node pointers).
• Below is the structure of B+ tree non leaf node

B1 K1 B2 K2 B3 K1 and K2 are keys

Tree Tree Tree


pointer pointer pointer

Q.11 The value of 351 mod 5 is ________.

Ans. (2)
By Fermat’s theorem
3(5 – 1) mod 5 = 1
34 mod 5 = 1
351 mod 5 = (34)12 . 33 mod 5
= 33 mod 5
=2

Q.12 The chip selects logic for a certain DRAM chip in memory system design is shown below.
Assume that memory has 16 address lines denoted by A15 to A0. What is the range
of addresses (in hexadecimal) of the memory system that can get enabled by the chip
select (CS) signal?
A15
A14
A13 CS
A12
A11

(a) DA00 to DFFF (b) C800 to CFFF


(c) C800 to C8FF (d) CA00 to CAFF

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 11
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Ans. (b)
A15 A14 A13 A12 A11 A10 A9 A0

1 1 0 0 1 0 0 0

Chip select (CS)

1 1 1

[C800 to CFFF]

Q.13 Let X be a square matrix. Consider the following two statements on X.


I. X is invertible.
II. Determinant of X is non-zero.
Which one of the following is TRUE?
(a) I implies II; II does not imply I. (b) II implies I; I does not imply II.
(c) I and II are equivalent statements. (d) I does not imply II; II does not imply I.

Ans. (c)
Both I and II are equivalent statements.

Q.14 Consider the following C program:


#include <stdio.h>
int jumble(int x, int y) {
x = 2 * x + y;
return x;
}
int main ( ) {
int x = 2, y = 5;
y = jumble( y, x);
x = jumble( y, x);
printf(“%d\n”, x);
return 0;
}
The value printed by the program is ________.

Ans. (26)

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 12
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.15 Which of the following protocol pairs can be used to send and retrieve e-mails (in that
order)?
(a) IMAP, SMTP (d) SMTP, MIME
(c) IMAP, POP3 (d) SMTP, POP3

Ans. (d)
SMTP is push protocol and to send email and POP3 is pull protocol i.e. to retrieve email.

Q.16 Let U = {1, 2, ..., n} and A = {(x, X), x ∈ X and X ⊆ U}. Consider the following two
statements on ⏐A⏐.
I. ⏐A⏐ = n.2n – 1
n
⎛n ⎞
II. A = ∑k ⋅ ⎜k ⎟
k =1 ⎝ ⎠
Which of the following is correct?
(a) Both I and II (b) Neither I nor II
(c) Only II (d) Only I

Ans. (a)
A = {(x, X), x ∈ X and X ⊆ U}
⎛n ⎞
The number of k element subsets of a set U with n elements = ⎜ ⎟ = nCk.
⎝k ⎠
The number of possible ordered pairs (x, X) where x ∈ X is k ⋅ nCk for a given value
of k from 1 to n.
So total number of ordered pairs in A
n n
⎛n ⎞
= A = ∑ k ⋅ n Ck = ∑ k ⋅ ⎜ k ⎟
k =1 k =1 ⎝ ⎠
So II is correct.
(Note that k = 0 is excluded since empty set has no elements and cannot form an
order pair such as (x, X)).
But since by the combinational identity
n
⎛n ⎞
∑k ⋅ ⎜k ⎟ = n.2n – 1
k =1 ⎝ ⎠
So I is also correct.
So both I and II are correct.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 13
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.17 Consider the following two statements about database transaction schedules:
I. Strict two-phase locking protocol generates conflict serializable schedules that are
also recoverable.
II Timestamp-ordering concurrency control protocol with Thomas’ Write Rule can generate
view serializable schedules that are not conflict serializable.
Which of the above statements is/are TRUE?
(a) Neither I nor II (b) I only
(c) II only (d) Both I and II

Ans. (d)
I. Strict 2PL guaranteed conflict serializable because of 2PL condition and also strict
recoverable.
II. Thomas Write time stamp ordering ensures serializable. Thomas write rule time
stamp ordering allowed to execute schedule which is view equal serial schedule
based on time stamp ordering.

Q.18 For ∑ = {a, b}, let us consider the regular language L = {x⏐x = a2 +3k or x = b10+12k,
k ≥ 0}. Which one of the following can be a pumping length (the constant guaranteed
by the pumping lemma) for L ?
(a) 9 (b) 24
(c) 3 (d) 5

Ans. (d)
L = {a2 + 3k or b10 + 12k} for k ≥ 0
= a2 (a3)* or b10 (b12)*
= {a2, a5, a7, ..., b10, b22, b34 .....}
The smallest string which can be pumped is a 5

a2 (a3 ) ∈
a5 =
x y z
So minimum pumping length = 5
Note: Below a5, the string a2 cannot be pumped and at or above a5, all strings in the
[Note:
language can be pumped]
Since a3, a9 and a24 do not belong to the language. 3, 9 and 24 cannot serve as pumping
length, since if pumping length is k, ∀n ≥ k strings must be pumped and 3, 9 and
24 will fail at n = k.
So correct answer is (d).

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 14
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.19 Consider the following C program is executed on a Unix/Linux system:


#include<unistd.h>
int main( )
{
int i;
for (i = 0; i < 10; i++)
if (i % 2 == 0) fork( );
return 0;
}
The total number of child processes created is ________.

Ans. (31)

Q.20 If L is a regular language over ∑ = {a, b}, which one of the following languages is NOT
regular?
(a) L ⋅ LR {x y⏐x ∈ L, y R ∈ L}
(b) Suffix (L) = {y ∈ ∑*⏐∃x ∈ ∑* such that x y ∈ L}
(c) Prefix (L) = {x ∈ ∑*⏐∃ y ∈ ∑* such that x y ∈ L}
(d) {ww R⏐w ∈ L}

Ans. (d)
• If L is regular, L ⋅ LR is also regular by closure property.
• Suffix (L) and Prefix (L) are also regular by closure property.
However option (d) {ww R⏐w ∈ L} need not be regular since if L is an infinite regular
language, then {ww R⏐w ∈ L} will not only be infinite, but also non-regular. Since it involves
string matching and we can increase in length indefinitely and then finite automata FA
will run out of memory.
So answer is option (d).

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 15
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.21 An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot
element is chosen uniformly at random. The probability that the pivot element gets placed
in the worst possible location in the first round of partitioning (rounded off to 2 decimal
places) is ________.

Ans. (0.08)

Q.22 Consider three concurrent processes P1, P2 and P3 as shown below, which access a
shared variable D that has been initialized to 100.

P1 P2 P3
: : :
: : :
D = D + 20 D = D – 50 D = D + 10
: : :
: : :

The processes are executed on a uniprocessor system running a time-shared operating


system. If the minimum and maximum possible values of D after the three processes
have completed executed are X and Y respectively, then the value of Y – X is ________.

Ans. (80)

Q.23 Consider Z = X – Y, where X, Y and Z are all in sign-magnitude form. X and Y are each
represented in n bits. To avoid overflow, the representation of Z would require a minimum
of:
(a) n + 2 bits (b) n bits
(c) n – 1 bits (d) n + 1 bits

Ans. (d)
For example:

Let, X = + 6, n = 4 ⎫
⎬ ⇒ (X − Y) = +11
Y = − 5, n = 4 ⎭

So Z = 11 which required 5 bits which is (n + 1) bits

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 16
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

x 4 − 81
Q.24 Compute lim
x →3 2 x 2 − 5x − 3

108 53
(a) (b)
7 12
(c) 1 (d) Limit does not exists

Ans. (a)

x 4 − 81 0
lim = form. So apply L′H rule
x→3 2 x 2
− 5x − 3 0

4 x3 108
lim =
x →3 4 x − 5 7

Q.25 Let G be an arbitrary group. Consider the following relations on G :


R 1 : ∀a, b ∈G,a R1 b if and only if ∃g ∈ G such that a = g –1bg
R 2 : ∀a, b ∈G,a R2 b if and only if a = b –1
Which of the above is/are equivalence relation/relations?
(a) R1 and R2 (b) R1 only
(c) R2 only (d) Neither R1 nor R2

Ans. (b)
R1 : ∀a, b ∈ G,a R1 b if and only if ∃g ∈ G such that a = g –1bg
Reflexive: a = g –1ag can be satisfied by putting g = e, identity “e” always exists
in a group.
So reflexive
Symmetric: aRb ⇒ a = g –1bg for some g
⇒ b = gag –1 = (g –1)–1 ag –1
g always exists for every g ∈ G.
–1

So symmetric
Transitive: aRb and bRc ⇒ a = g1–1bg1 and b = g2–1 cg2 for some g1 g2 ∈ G.
Now a = g1–1 g2–1 cg2g1 = (g2g1) –1 cg2g1
g1 ∈ G and g2 ∈ G ⇒ g2g1 ∈ G since group is closed so aRb and aRb ⇒ aRc
hence transitive
Clearly R1 is equivalence relation.
R2 is not equivalence it need not even be reflexive, since aR2 a ⇒ a = a –1 ∀a which
not be true in a group.
R1 is equivalence relation is the correct answer.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 17
RRB-JE
Examination, 2019
India’s Best Institute for IES, GATE & PSUs

Admission Open in
Classroom Course for RRB-JE
(CBT-1)
Classroom Centres : Delhi Lucknow Patna

Batches commencing from


th
15 Feb, 2019
All streams are eligible

Fee Structure : Classroom Course (RRB-JE)

Exam Course Duration Timing Freshers Ex. MADE EASY Students


Enrolled in any classroom/postal courses

CBT 1 50 Days 7 days a week Rs. 10,170 + GST Rs. 7,628 + GST
(only) (180-200 hours) 4 hours per day = Rs. 12,000/- = Rs. 9,000/-

Delhi : Lucknow : Patna :


7303231082, 09919111168, 0612-2356615,
7303212325 08400029422 9955991166

www.madeeasy.in
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.26 Consider the augmented grammar given below:


S′ → S
S → <L>⏐id
L → L, S⏐S
Let I0 = CLOSURE ({[S′ → S]}). The number of items in the set GOTO (I0, < ) is ________.

Ans. (5)

S′ → .S < S → <.L>
S → .<L> L → .L, S
S → .id L → .S
S → .<L>
S → .id

Total number of items in the set GOTO (I0, 〈 ) is 5.

Q.27 Let the set of functional dependencies F = {QR → S, R → P, S → Q} hold on a relation


schema X = (PQRS). X is not in BCNF. Suppose X is decomposed into two schemas
Y and Z where Y = (PR) and Z = (QRS).
Consider the two statements given below:
I. Both Y and Z are in BCNF
II. Decomposition of X into Y and Z is dependency preserving and lossless
Which of the above statements is/are correct?
(a) I only (b) Neither I nor II
(c) Both I and II (d) II only

Ans. (d)
X(PQRS) {QR → S, R → P, S → Q} decomposed into
Y(PR) Z(QRS)
{R → P} {QR → S, S → Q}
Candidate key : R Candidate key : QR, RS
Relation Y in BCNF Relation Z in 3NF but not BCNF
Common attribute between Y and Z relations is R which is key for relation Y.
So that given decomposition is lossless join decomposition.
R → P in Y
QR → S ⎫
⎬ are in Z
S→Q ⎭
and dependency preserving decomposition.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 18
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.28 Consider the following statements:


I. The smallest element in a max-heap is always at a leaf node.
II. The second largest element in a max-heap is always a child of the root node.
III. A max-heap can be constructed from a binary search tree in Θ(n) time.
IV. A binary search tree can be constructed from a max-heap in Θ(n) time.
Which of the above statements are TRUE?
(a) II, III and IV (b) I, II and III
(c) I, III and IV (d) I, II and IV

Ans. (b)

Q.29 Which one of the following languages over ∑ = {a, b} is NOT context-free?
(a) {anb i⏐i ∈ {n, 3n, 5n}, n ≥ 0} (b) {wa nw R bn⏐w ∈ {a, b}*, n ≥ 0}
(c) {ww R⏐w ∈ {a, b}* } (d) {wa n bn w R⏐w ∈ {a, b}*, n ≥ 0}

Ans. (b)
(a) {anb i⏐i ∈ {n, 3n, 5n}, n ≥ 0}
= anbn ∪ anb3n ∪ anb5n is CFL since each of the three parts is a CFL and closure
under union guarantees that result also is a CFL.
(b) {wa nw R bn⏐w ∈ {a, b}*, n ≥ 0} is a not CFL
because after pushing w, we need to push a’s into stack which will stop the w from
being matched with w R. If we don’t push a’s after w, than later we cannot match
with bn. So this language is not acceptable by a PDA and hence not a CFL.
(c) {ww R⏐w ∈ {a, b}* } is a CFL
(d) {wa n bn w R⏐w ∈ {a, b}*, n ≥ 0} is a CFL, since we can first push w, then a’s,
b’s pop with a’s and w R pops with the w. So PDA can accept the language.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 19
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.30 Consider the following C function:


void convert (int n) {
if (n < 0)
printf(“%d”, n);
else {
convert (n /2);
printf(“%d”, n % 2);
}
}
Which one of the following will happen when the function convert is called with any
positive integer n as argument?
(a) It will print the binary representation of n in the reverse order and terminate.
(b) It will print the binary representation of n but will not terminate.
(c) It will not print anything and will not terminate.
(d) It will print the binary representation of n and terminate.

Ans. (*)

Q.31 A relational database contains two tables Student and Performance as shown below:
Student Performance

Roll_no. Student_name Roll_no. Student_code Marks


1 Amit 1 A 86
2 Priya 1 B 95
3 Vinit 1 C 90
4 Rohan 2 A 89
5 Smita 2 C 92
3 C 80

The primary key of the Student table is Roll_no. For the Performance table, the columns
Roll_no. and Subject_code together from the primary key. Consider the SQL query given
below:
SELECT S.Student_name, sum(P.Marks)
FROM Student S, Performance P
WHERE P.Marks > 84
GROUP BY S.Student_name;
The number of rows returned by the above SQL query is ________.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 20
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Ans. (5)
Student Performance

Roll_no. Student_name Roll_no. Student_code Marks


1 Amit 1 A 86
2 Priya 1 B 95
3 Vinit 1 C 90
4 Rohan 2 A 89
5 Smita 2 C 92
3 C 80

In where condition no condition over Roll_no so query produces all groups.


Total 5 different student names all 5 group records in result.

Q.32 Assume that in a certain computer, the virtual addresses are 64 bits long and the physical
addresses are 48 bits long. The memory is word addressable. The page size is 8 kB
and the word size is 4 bytes. The Translation Look-aside Buffer (TLB) in the address
translation path has 128 valid entries. At most how many distinct virtual addresses can
be translated without any TLB miss?
(a) 16 × 210 (b) 8 × 220
20
(c) 4 × 2 (d) 256 × 210

Ans. (d)
1 word = 4 bytes
Page size = 8 kB = 213 B

213
Number of words in 1 page = = 211
2
2
TLB can hold 128 valid entries so, at most 128 × 211 memory address can be addressed
without TLB miss.
128 × 211 = 256 × 210
So option (d) is correct.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 21
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.33 Consider the following snapshot of a system running n concurrent processes. Process
i is holding Xi instances of a resource R, 1 ≤ i ≤ n. Assume that all instances of R are
currently in use. Further, for all i, process i can place a request for at most Yi additional
instances of R while holding the Xt instances it already has. Of the n processes, there
are exactly two processes p and q such that Yp = Yq = 0. Which one of the following
conditions guarantees that no other process apart from p and q can complete execution?
(a) Xp + Xq < Min {Yk⏐1 ≤ k ≤ n, k ≠ p, k ≠ q}
(b) Min (Xp, Xq) ≥ Min {Yk⏐1 ≤ k ≤ n, k ≠ p, k ≠ q}
(c) Min (Xp, Xq) ≤ Max {Yk⏐1 ≤ k ≤ n, k ≠ p, k ≠ q}
(d) Xp + Xq < Max {Yk⏐1 ≤ k ≤ n, k ≠ p, k ≠ q}

Ans. (a)

Q.34 Let G be any connected, weighted, undirected graph:


I. G has a unique minimum spanning tree, if no two edges of G have the same weight.
II. G has a unique minimum spanning tree, if for every cut G, there is a unique minimum
weight edge crossing the cut.
Which of the above two statements is/are TRUE?
(a) Neither I nor II (b) I only
(c) II only (d) Both I and II

Ans. (d)
If no two edges of G have same weight surely G will have unique spanning tree is true.
So I is true
Also if, for every cut of G, there is a unique minimum weight edge crossing the cut
then G will have unique spanning tree is also true. So II is true
[Note:
Note: The converse of II is not true, but that is not relevant to this question]
So both I and II are true.
Option (d) is correct.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 22
India’s Best Institute for IES, GATE & PSUs

GATE 2019
RANK PREDICTOR
www.gaterankpredictor.madeeasy.in

Step 1 Step 2 Step 3


Select Your Stream Select the session Paste the URL of
you appeared for your Response Sheet

and predict your


• All India Rank
• Normalized Marks
Click here to redirect at MADE EASY GATE Rank Predictor
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.35 Consider the following matrix:


⎡1
8 ⎤ 2 4
⎢1
27 ⎥⎥ 3 9
R=⎢
4 16 64 ⎥ ⎢1
⎢ ⎥
5 25 125⎦ ⎣1
The absolute value of the product of Eigen values of R is ________.

Ans. (12)
Product of eigen values is same as the determinant of a matrix.

⎡1 2 22 23 ⎤ ⎡1 2 22 23 ⎤
⎢ ⎥ ⎢ ⎥
⎢1 3 32 33 ⎥ ⎢0 3 − 2 32 − 22 33 − 23 ⎥
⎢ ⎥ = ⎢ ⎥
⎢1 4 42 43 ⎥ ⎢0 4 − 2 42 − 22 43 − 23 ⎥
⎢ ⎥ ⎢ 2 2

⎣⎢1 5 52 53 ⎦⎥ ⎢⎣0 5 − 2 5 − 2 53 − 23 ⎦⎥

⎡1 5 19⎤
⎢ ⎥
= (3 – 2) (4 – 2) (5 – 2) ⎢1 6 28⎥
⎢⎣1 7 39⎥⎦

⎡ 1 5 19⎤
⎢ ⎥
= 1 . 2 .3 ⎢0 1 9 ⎥
⎢⎣0 2 20⎥⎦
= 1 . 2 . 3 . 2 = 12
So the product of eigen value is 12.

Q.36 In an RSA cryptosystem, the value of the public modulus parameter n is 3007. If it is
also known that φ(n ) = 2880, where φ( ) denotes Euler’s Totient Function, then the prime
factor of n which is greater than 50 is ________.

Ans. (97)
n = p × q = 3007
φ(n) = (p – 1) (q – 1) = 2880
Using RSA algorithm, n = 31 × 97 in which 97 is prime factor which greater than 50.
So 97 is correct answer.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 23
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.37 Consider the following relations P(X, Y. Z), Q(X, Y, T) and R(Y, V).

P Q R
X Y Z X Y T Y V

X1 Y1 Z1 X2 Y1 2 Y1 V1

X1 Y1 Z2 X1 Y2 5 Y3 V2

X2 Y2 Z2 X1 Y1 6 Y2 V3

X2 Y4 Z4 X3 Y3 1 Y2 V2

How many tuples will be returned by the following relational algebra query?
Π x(σ(P.Y = R.Y ∧ R.V = V2) (P × R)) – Π x(σ(Q.Y = R.Y ∧ Q.T > 2) (Q × R))

Ans. (1)

P X Y Z R Y V

X1 Y1 Z1 Y1 V1

X1 Y1 Z2 Y3 V2

X2 Y2 Z2 Y2 V3

X2 Y4 Z4 Y2 V2

X
Π x(σ(P.Y = R.Y ∧ R.V = V2) (P × R)) ⇒ ...(I)
X2

Q X Y T R Y V

X2 Y1 2 Y1 V1

X1 Y2 5 Y3 V2

X1 Y1 6 Y2 V3

X3 Y3 1 Y2 V2

X
Π x(σ(Q.Y = R.Y ∧ Q.T > 2) (Q × R)) ⇒ ...(II)
X1

X
I – II ⇒ one record in result.
X2

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 24
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.38 Consider the following C programs:


#include <stdio.h>
int main ( ) {
float sum = 0.0, j = 1.0, i = 2.0;
while (i / j > 0.0625) {
j = j + j;
sum = sum + i / j ;
printf(“%f \n”, sum);
}
return 0;
}
The number of times the variable sum will be printed, when the above program is
executed, is ________.

Ans. (5)

Q.39 What is the minimum number of 2-input NOR gates required to implement 4-variable
function expressed in sum-of-minterms from as f = Σ(0, 2, 5, 7, 8, 10, 13, 15)? Assume
that all the inputs and their complements are available ________.

Ans. (3)
f = Σm (0, 2, 5, 7, 8, 10, 13, 15)
f = ΠM (1, 3, 4, 6, 9, 11, 12, 14)
C, D
A, B 00 01 11 10

00 0 0

01 0 0
(B + D)
11 0 0

10 0 0

(B + D)

f = (B + D)(B + D)

B
D

B
D

So 3 NOR gates is required.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 25
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.40 Consider the following sets:


S 1 : Set of all recursively enumerable languages over the alphabet {0, 1}.
S 2 : Set of all syntactically valid C programs.
S 3 : Set of all languages over the alphabet {0, 1}.
S 4 : Set of all non-regular languages over the alphabet {0, 1}.
Which of the above sets are uncountable?
(a) S1 and S2 (b) S3 and S4
(c) S1 and S4 (d) S2 and S3

Ans. (b)
S1 : The set L RE is known to be countably infinite since it corresponds with set of turing
machines.
S2 : Since syntactically valid C programs surely run on Turing machines, this set is also
a subset of set of Turing machines, which is countable.
*
S3 : Set of all languages = 2Σ which is known to be uncountable. Σ* countably infinite
*
⇒ 2Σ is uncountable.
S4: Set of all non-regular languages includes set L NOT RE which is uncountable infinite
and hence is uncountable.
So, S3 and S4 are uncountable.

Q.41 Consider the following four processes with arrival times (in milliseconds) and their length
of CPU burst (in milliseconds) as shown below:

Process P1 P2 P3 P4
Arrival time 0 1 3 4
CPU time 3 1 3 Z

These processes are run on a single processor using preemptive Shortest Remaining
Time First scheduling algorithm. If the average waiting time of the processes is
1 millisecond, then the value of Z is ________.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 26
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Ans. (2)
Assume, Z=2
P1 P2 P1 P1 P4 P3

0 1 2 3 4 6 9

Arrival time CPU time Completion time Waiting time


P1 0 3 4 1
P2 1 1 2 0
P3 3 3 9 3
P4 4 Z=2 6 0

1+ 0 + 3 + 0
Average waiting time (WT) = = 1ms
4
Hence, Z=2

Q.42 Consider the following C program:


#include<stdio.h>
int r( )
{
Static int num = 7;
return num – –;
}
int main( )
{
for ( r( ); r( ); r( ) )
printf(“%d”,r( ) );
return 0;
}
Which one of the following values will be displayed on execution of the programs?
(a) 41 (b) 630
(c) 63 (d) 52

Ans. (d)

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 27
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.43 Let T be a full binary tree with 8 leaves. (A full binary tree has every level full.) Suppose
two leaves a and b of T are chosen uniformly and independently at random. The expected
value of the distance between a and b in T (i.e., the number of edges in the unique
path between a and b) is (rounded off to 2 decimal places) ________.

Ans. (4.85) (4.85 to 4.86)


Two nodes can be selected in 8C2 = 28 ways.

a b c d e f g h

X : length between two nodes selected

X2 4 6
4 8 16
P(x)
28 28 28
To find expected length between a and b is E[X]
⎛ 4 ⎞ ⎛ 8 ⎞ ⎛ 16 ⎞
E[X] = 2 ⎜ ⎟ + 4 ⎜ ⎟ + 6 ⎜ ⎟
⎝ ⎠
28 ⎝ ⎠
28 ⎝ 28 ⎠
8 + 32 + 96 136
= = = 4.857
28 28

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 28
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.44 Consider the first order predicate formula:


∀x[(∀z z⏐x ⇒ ((z = x) ∨ (z = 1))) ⇒ ∃w (w > x) ∧ (∀z z⏐w ⇒ ((w = z ) ∨ (z = 1)))]
Here ‘a⏐b’ denotes that ‘a divides b’, where a and b are integers. Consider the following
sets:
S1 : {1, 2, 3, ..., 100}
S2 : Set of all positive integers
S3 : Set of all integers
Which of the above sets satisfy ϕ?
(a) S1 and S3 (b) S2 and S3
(c) S1, S2 and S3 (d) S1 and S2

Ans. (b)
∀x[∀z⏐x ⇒ ((z = x) ∨ (z = 1)) ⇒ ∃w (w > x) ∧ (∀z z⏐w ⇒ ((w = z ) ∨ (z = 1)))]
The predicate ϕ simply says that if z is a prime number in the set then there exists
another prime number is the set which is larger.
Clearly ϕ is true in S2 and S3 since in set of all integers as well as all positive integers,
there is a prime number greater than any given prime number.
However, in S1 : {1, 2, 3, .....100} ϕ is false since for prime number 97 ∈ S1 there exists
no prime number in the set which is greater.

Q.45 Suppose Y is distributed uniformly in the open interval (1,6). The probability that the
polynomial 3x 2 + 6xY + 3Y + 6 has only real roots is (rounded off to 1 decimal place)
________.

Ans. (0.8)
Polynomial 3x 2 + 6xY + 3Y + 6 has only real roots
b2 – 4ax ≥ 0
(6Y)2 – 4(3) (3Y+ 6) ≥ 0
Y2 – Y + 2 ≥ 0
Y ∈ (–∞, – 1] ∩ [2, ∞)
⇒ Y ∈ [2, 6)
Since y is uniformly distributed in (1, 6)
Probability distributed function
1
f (Y ) = 1 < y < 6
5
6
p(2 ≤ y < 6) = ∫ f (Y )dy
2

1 6 4
= [Y ]2 = = 0.8
5 5

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 29
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.46 Consider three 4-variable functions f1, f2 and f3, which are expressed in sum-of-minterms
as
f1 = Σ(0, 2, 5, 8, 14)
f2 = Σ(2, 3, 6, 8, 14, 15)
f3 = Σ(2, 7, 11, 14)
For the following circuit with one AND gate and one XOR gate, the output function f can
be expressed as:
f1
AND
f2 XOR f

f3
(a) Σ(7, 8, 11) (b) Σ(2, 14)
(c) Σ(0, 2, 3, 5, 6, 7, 8, 11, 14, 15) (d) Σ(2, 7, 8, 11, 14)

Ans. (a)
f1 . f2 = Σ(2, 8, 14)
f 1 = f 3 ⊕ (f 1 . f 2 )
= Σ(7, 8, 11)

Q.47 Consider the following grammar and the semantic actions to support the inherited type
declaration attributes. Let X1, X2, X3, X4, X5 and X6 be the place holders for the non-
terminals D, T, L or L1 in the following table:

Pr oductions rule Semantic action


D → TL X1.type = X2 .type
T → int T.type = int
T → float T.type = float
X3 .type = X4 .type
L → L1, id
addType(id.entry, X5.type)
L → id addType(id.entry, X6 .type)
Which one of the following are the appropriate choices for X1, X2, X3 and X4?
(a) X1 = L, X2 = T, X3 = L1, X4 = L (b) X1 = L, X2 = L, X3 = L1, X4 = T
(c) X1 = T, X2 = L, X3 = L1, X4 = T (d) X1 = T, X2 = L, X3 = T, X4 = L1

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 30
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Ans. (a)
SDT for inserting type information in the symbol table
D → TL {L.idtype = T.stype}
T → int {T.stype = int}
T → float {T.stype = float}
L → L1, id {L1.itype = L.itype}
addtype(id.entry, L.itype)
L → id addtype(id.entry, L.itype)
Replace these attribute information in the given SDT.
So option (a) is the correct answer.

Q.48 Consider three machines M, N and P with IP addresses 100.10.5.2, 100.10.5.5 and
100.10.5.6 respectively. The subnet mask is set to 255.255.255.252 for all the three
machines. Which one of the following is true?
(a) M, N and P all belong to the same subnet
(b) Only N and P belong to the same subnet
(c) M, N, and P belong to three different subnets
(d) Only M and N belong to the same subnet

Ans. (b)

100.10.5.2 2 00000010
M → 255.255.255.252 252 11111100
194.56.10.0 0 00000000

100.10.5.5 5 00000101
N → 255.255.255.252 252 11111100
194.56.10.4 4 00000100

100.10.5.6 6 00000110
P → 255.255.255.252 252 11111100
194.56.10.4 4 00000100

N and P belongs to same subnet.

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 31
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.49 Let Σ be the set of all bijections from {1, ..., 5} to {1, ..., 5}, where id denotes the identity
function, i.e. id( j ) = j , ∀j . Let ° denote composition on functions.
For a string x = x1 x2 ... xn ∈ Σn, n ≥ 0, let π(x) = x1 ° x2 ° ... ° xn.
Consider the language L = {x ∈ Σ*⏐π(x) = id}. The minimum number of states in any DFA
accepting L is ________.

Ans. (120)
The DFA for accepting L will have 5! = 120 states, since we need one state for every
possible permutation function on 5 elements. The starting state will be “id” state, named

⎛ 12345 ⎞
as ⎜ ⎟ and from there n ! arrows will go the n ! states each named with a distinct
⎝ 12345 ⎠
permutation of the set {1, 2, 3, 4, 5}. Since composition of permutation function is closed
every arrow has to go to some permutation and hence some state.
Since the language only has those strings where π(x) = id only the starting state (“id”
state) will be the final state. Sample machine with only 2 states is shown below

12345 12345
12345 12345 12345
13245
12345 12345
12345 13245
12345
13245

Q.50 A certain processor deploys a single-level cache. The cache block size is 8 words and
the word size is 4 bytes. The memory system uses a 60 MHz clock. To service a cache
miss, the memory controller first takes 1 cycle to accept the starting address of the
block, it then takes 3 cycles to fetch all the eight words of the block, and finally transmits
the words of the requested block at the rate of 1 word per cycle. The maximum bandwidth
for the memory system when the program running on the processor issues a series of
read operations is _________ × 106 bytes/sec.

Ans. (160)
Total time to transfer a cache block = 1 + 3 + 8 = 12 cycles
8 W ------------------ 12 cycles
8 × 4 bytes ------------------ 12 cycles
? B ------------------ 1 sec

32B
=
⎛ 1 ⎞
12 × ⎜ + 10 −6 ⎟ sec
⎝ 60 ⎠

= 160 × 106 bytes/sec

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 32
General Studies &
Engineering Aptitude
Batches for ESE 2020 India’s Best Institute for IES, GATE & PSUs

(Preliminary Examination)

Syllabus Covered
1. Current issues of national and international importance relating to social economic and industrial development.

2. Engineering Aptitude covering Logical reasoning and Analytical ability.

3. Engineering Mathematics and Numerical Analysis.

4. General Principles of Design, Drawing, Importance of Safety.

5. Standards and Quality practices in production, construction, maintenance and services.

6. Basic of Energy and Environment : Conservation, Environmental pollution and degradation, Climate Change,
Environmental impact assessment.

7. Basic of Project Management.

8. Basics of Material Science and Engineering.

9. Information and Communication Technologies (ICT) based tools and their applications in Engineering such as
networking, e-governance and technology based education.

10. Ethics and values in engineering profession.

Course Duration Timings Teaching Hours


Regular Batches : 2.5 months Regular : 6 to 7 days a week and 4-6 hours a day 250-300
Weekend Batches : 4 months Weekend : Sat, Sun & public holiday, 8 hours each day hours

Batch Type Commencing Dates Venue Timing


Regular Batch 20th Feb, 2019 Ghitorni (Delhi) 8:00 AM to 12:00 PM
Weekend Batch 24th Feb, 2019 Ghitorni (Delhi) 8:00 AM to 5:00 PM
Weekend Batch 24th Feb, 2019 Noida Centre 8:00 AM to 5:00 PM

Fee Structure
Non-MADE EASY Students Ex. MADE EASY Students
Enrolled in Postal, Rank Improvement, Mains, GS, GATE, GATE + ESE Batches

` 25,000 • GS & Engg Aptitude Books will NOT be issued.


• GS & Engg Aptitude Books will be issued.
` 18,000 • Interested students can avail books by paying the fee of Rs. 2,000/-

Corporate office : 44-A/1, Kalu Sarai, New Delhi - 1100 16 011-45124612, 9958995830
ADMISSION
Noida office : D-28, Sector - 63, Noida, Uttar Pradesh - 201301 0120-6524612, 08860378009 OPEN
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.51 There are n unsorted arrays: A1, A2, ...., An. Assume that n is odd. Each of A1, A2, ....,
An contains n distinct elements. There are no common elements between any two arrays.
The worst-case time complexity of computing the median of the medians of A1, A2, ....,
An is
(a) Ο(n log n) (b) Ο(n2)
(c) Ο(n) (d) Ω(n 2 log n)

Ans. (b)

Q.52 Consider that 15 machines need to be connected in a LAN using 8-port Ethernet switches.
Assume that these switches do not have any separate uplink ports. The minimum number
of switches needed is ________.

Ans. (3)
3 switches of ethernet are required to connect 15 computers.

Q.53 The index node (inode) of a Unix-like file system has 12 direct, one single-indirect and
one double-indirect pointers The disk block size is 4 kB and the disk block address
is 32-bits long. The maximum possible file size is (rounded off to 1 decimal place)
________ GB.

Ans. (4.0)

Q.54 Suppose that in an IP-over-Ethernet network, a machine X wishes to find the MAC address
of another machine Y in its subnet. Which one of the following techniques can be used
for this?
(a) X sends an ARP request packet with broadcast IP address in its local subnet
(b) X sends an ARP request packet to the local gateway’s MAC address which then finds
the MAC address of Y and sends to X
(c) X sends an ARP request packet with broadcast MAC address in its local subnet
(d) X sends an ARP request packet to the local gateway’s IP address which then finds
the MAC address of Y and sends to X

Ans. (c)

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 33
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019

Q.55 Consider the following C program:


#include <stdio.h>
int main ( )
{
int a[ ] = {2, 4, 6, 8, 10};
int i, sum = 0, *b = a + 4;
for (i = 0; i < 5; i++)
sum = sum + (*b – i) – *(b – i);
printf (“%d\n”, sum);
return 0;
}
The output of the above C program is ________.

Ans. (10)

„„„„

Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 34

You might also like