CS GATE 2019 Solutions
CS GATE 2019 Solutions
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
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
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
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.
ESE 2019 Mains Offline Test Series Rs. 3,500/- Rs. 2,500/- Rs. 4,500/- Rs. 3,500/-
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
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
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
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).
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)
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
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
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.
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
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
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
1 1 1
[C800 to CFFF]
Ans. (c)
Both I and II are equivalent statements.
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
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
: : :
: : :
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 ⎭
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
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
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/-
www.madeeasy.in
Detailed Solutions of
GATE 2019 : Computer Science & IT
Date of Test : 03-02-2019
Ans. (5)
S′ → .S < S → <.L>
S → .<L> L → .L, S
S → .id L → .S
S → .<L>
S → .id
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
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
Ans. (*)
Q.31 A relational database contains two tables Student and Performance as shown below:
Student Performance
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
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)
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
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
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
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
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
1+ 0 + 3 + 0
Average waiting time (WT) = = 1ms
4
Hence, Z=2
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) ________.
a b c d e f g h
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
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:
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
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 ⎠
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.
6. Basic of Energy and Environment : Conservation, Environmental pollution and degradation, Climate Change,
Environmental impact assessment.
9. Information and Communication Technologies (ICT) based tools and their applications in Engineering such as
networking, e-governance and technology based education.
Fee Structure
Non-MADE EASY Students Ex. MADE EASY Students
Enrolled in Postal, Rank Improvement, Mains, GS, GATE, GATE + ESE Batches
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
Ans. (10)
Corporate Office: 44-A/1, Kalu Sarai, New Delhi-110016 | [email protected] | ß www.madeeasy.in Page 34