GATE 2012
Question 1 
Consider the following logical inferences.
 I1: If it rains then the cricket match will not be played.
The cricket match was played.
Inference: There was no rain.
I2: If it rains then the cricket match will not be played.
It did not rain.
Inference: The cricket match was played.
Which of the following is TRUE?
Both I_{1} and I_{2} are correct inferences  
I_{1} is correct but I_{2} is not a correct inference  
I_{1} is not correct but I_{2} is a correct inference  
Both I_{1} and I_{2} are not correct inferences 
The cricket match was played.
Let p = it rains
q = playing cricket/ match played
If (it rains) then (the match will not be played)
p ⇒ (∼q)
Inference: There was no rain. (i.e., p = F)
So for any F ⇒ (∼q) is true.
So this inference is valid.
I_{2}: If it rains then the cricket match will not be played.
It did not rain.
p ⇒ (∼q)
Inference: The cricket match was played.
q = T
p ⇒ (∼q)
p ⇒ (∼T)
p ⇒ F
This is false for p = T, so this is not true.
Question 2 
Which of the following is TRUE?
Every relation in 3NF is also in BCNF  
A relation R is in 3NF if every nonprime attribute of R is fully functionally dependent on every key of R  
Every relation in BCNF is also in 3NF  
No relation can be in both BCNF and 3NF 
Question 3 
What will be the output of the following C program segment?
char inchar = 'A'; switch (inchar) { case 'A' : printf ("choice A n") ; case 'B' : printf ("choice B ") ; case 'C' : case 'D' : case 'E' : default: printf ("No Choice") ; }
No Choice  
Choice A  
Program gives no output as it is erroneous 
So,
→ Choice A
→ Choice B. No choice. Is the output.
Question 4 
Assuming P ≠ NP, which of the following is TRUE?
NPcomplete = NP  
NPcomplete ∩ P = ∅  
NPhard = NP  
P = NPcomplete 
The definition of NPcomplete is,
A decision problem p is NPcomplete if:
1. p is in NP, and
2. Every problem in NP is reducible to p in polynomial time.
It is given that assume P ≠ NP , hence NPcomplete ∩ P = ∅ .
This is due to the fact that, if NPcomplete ∩ P ≠ ∅ i.e. there are some problem (lets say problem P1) which is in P and in NPcomplete also, then it means that P1 (NPcomplete problem) can be solved in polynomial time also (as it is also in P class) and this implies that every NP problem can be solve in polynomial time, as we can convert every NP problem into NPcomplete problem in polynomial time.
Which means that we can convert every NP problem to P1 and solve in polynomial time and hence P = NP, which is contradiction to the given assumption that P ≠ NP.
Question 5 
The worst case running time to search for an element in a balanced binary search tree with n2^{n} elements is
Θ (n log n)  
Θ (n2^{n})  
Θ (n)  
Θ (log n) 
→ No of elements = n.2^{n} then search time = (log n.2^{n})
= (log n + log 2^{n})
= (log n + n log 2)
= O(n)
Question 6 
The truth table
represents the Boolean function
X  
X + Y  
X ⊕ Y  
Y 
Question 7 
The decimal value 0.5 in IEEE single precision floating point representation has
fraction bits of 000…000 and exponent value of 0  
fraction bits of 000…000 and exponent value of −1  
fraction bits of 100…000 and exponent value of 0  
no exact representation 
So, value of the exponent = 1
and
fraction is 000…000 (Implicit representation)
Question 8 
A process executes the code
fork(); fork(); fork();
The total number of child processes created is
3  
4  
7  
8 
7 are child processes.
Question 9 
Consider the function f(x) = sin(x) in the interval x ∈ [π/4, 7π/4]. The number and location(s) of the local minima of this function are
One, at π/2  
One, at 3π/2  
Two, at π/2 and 3π/2  
Two, at π/4 and 3π/2 
f’(x) = cos x
[just consider the given interval (π/4, 7π/4)]
f'(x) = 0 at π/2, 3π/2
To get local minima f ’’(x) > 0, f ’’(x) =  sin x
f ’’(x) at π/2, 3π/2
f ’’(x) = 1< 0 local maxima
f ’’ (3π/2) = 1 > 0 this is local minima
In the interval [π/4, π/2] the f(x) is increasing, so f(x) at π/4 is also a local minima.
So there are two local minima for f(x) at π/4, 3π/2.
Question 10 
The protocol data unit (PDU) for the application layer in the Internet stack is
Segment  
Datagram  
Message  
Frame 
Question 11 
Let A be the 2×2 matrix with elements a_{11} = a_{12} = a_{21} = +1 and a_{22} = 1. Then the eigenvalues of the matrix A^{19} are
1024 and 1024  
1024√2 and 1024√2  
4√2 and 4√2  
512√2 and 512√2 
The 2×2 matrix =
Cayley Hamilton theorem:
If matrix A has ‘λ’ as eigen value, A^{n} has eigen value as λ^{n}.
Eigen value of
AλI = 0
(1λ)(1+λ)1 = 0
(1λ^{2} )1 = 0
1 = 1λ^{2}
λ^{2} = 2
λ = ±√2
A^{19} has (√2)^{19} = 2^{9}×√2 (or) (√2)^{19} = 512√2
= 512√2
Question 12 
What is the complement of the language accepted by the NFA shown below?
Assume Σ={a} and ε is the empty string.
∅  
{ε}  
a*  
{a ,ε} 
Hence the complement of language is: {a* − a^{+}} = {ϵ}
Question 13 
What is the correct translation of the following statement into mathematical logic?
“Some real numbers are rational”
∃x (real(x) ∨ rational(x))  
∀x (real(x) → rational(x))  
∃x (real(x) ∧ rational(x))  
∃x (rational(x) → real(x)) 
∃x (real(x) ∧ rational(x))
(A) ∃x(real(x) ∨ rational(x))
means There exists some number, which are either real or rational.
(B) ∀x (real(x)→rational(x))
If a number is real then it is rational.
(D) ∃x (rational(x)→real(x))
There exists a number such that if it is rational then it is real.
Question 14 
Given the basic ER and relational models, which of the following is INCORRECT?
An attribute of an entity can have more than one value  
An attribute of an entity can be composite  
In a row of a relational table, an attribute can have more than one value  
In a row of a relational table, an attribute can have exactly one value or a NULL value 
Option (B): In ER model, the attribute which can be further broken down into some other attributes is called composite attribute.
Option (C): In Relational model, the intersection of one row and column should contain only one value. So, option (C) is INCORRECT.
Option (D): In Relational model, the intersection of one row and column should contain either exactly one value or NULL.
Question 15 
Which of the following statements are TRUE about an SQL query?

P:An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause.
Q:An SQL query can contain a HAVING clause even if it has a GROUP BY clause.
R: All attributes used in the GROUP BY clause must appear in the SELECT clause.
S: Not all attributes used in the GROUP BY clause need to appear in the SELECT clause
P and R  
P and S  
Q and R  
Q and S 
The HAVING Clause enables you to specify conditions that filter which group results appear in the results. The WHERE clause places conditions on the selected columns, whereas the HAVING clause places conditions on groups created by the GROUP BY clause. So, we cannot use HAVING clause without GROUP BY clause.
Question 16 
The recurrence relation capturing the optimal execution time of the Towers of Hanoi problem with n discs is
T(n) = 2T(n  2) + 2  
T(n) = 2T(n  1) + n  
T(n) = 2T(n/2) + 1  
T(n) = 2T(n  1) + 1 
T(n) = 2T(n – 1) + 1
= 2 [2T(n – 2) + 1] + 1
= 2^{2} T(n – 2) + 3
⋮
= 2^{k} T( n – k) + (2^{k} – 1)
n – k = 1
= 2^{n1} T(1) + (2^{n1} – 1)
= 2^{n1} + 2^{n1} – 1
= 2^{n} – 1
≌ O(2^{n})
Question 17 
Let G be a simple undirected planar graph on 10 vertices with 15 edges. If G is a connected graph, then the number of bounded faces in any embedding of G on the plane is equal to
3  
4  
5  
6 
ve+f = 2
Given 10 vertices & 15 edges
1015+f = 2
f = 2+1510
f = 7
There will be an unbounded face always. So, number of faces = 6.
Question 18 
Let W(n) and A(n) denote respectively, the worst case and average case running time of an algorithm executed on an input of size n. Which of the following is ALWAYS TRUE?
A(n) = Ω (W(n))  
A(n) = Θ (W(n))  
A(n) = O (W(n))  
A(n) = o (W(n)) 
So, A(n) would be upper bounded by W(n) and it will not be strict upper bound as it can even be same (e.g. Bubble Sort and merge sort).
A(n) = O(W(n))
Note: Option A is wrong because A(n) is not equal to Ω(w(n)) .
Question 19 
The amount of ROM needed to implement a 4 bit multiplier is
64 bits  
128 bits  
1 Kbits  
2 Kbits 
Hence option D is the answer.
Question 20 
Register renaming is done in pipelined processors
as an alternative to register allocation at compile time  
for efficient access to function parameters and local variables  
to handle certain kinds of hazards  
as part of address translation 
Question 21 
Consider a random variable X that takes values +1 and −1 with probability 0.5 each. The values of the cumulative distribution function F(x) at x = −1 and +1 are
0 and 0.5  
0 and 1  
0.5 and 1  
0.25 and 0.75 
The sum of probabilities at x=1, x=1 itself is 0.5+0.5 = 1. It is evident that, there is no probability for any other values.
The F(x=1) is 0.5 as per given probabilities and
F(x=1) = sum of F(x=1) +F(x=0) = ...f(X=1) = 0.5 +0.5 = 1
Question 22 
Which of the following transport layer protocols is used to support electronic mail?
SMTP  
IP  
TCP  
UDP 
Question 23 
In the IPv4 addressing format, the number of networks allowed under Class C addresses is
2^{14}  
2^{7}  
2^{21}  
2^{24} 
Question 24 
Which of the following problems are decidable?
1) Does a given program ever produce an output?
2) If L is a contextfree language, then, is also contextfree?
3) If L is a regular language, then, is also regular?
4) If L is a recursive language, then, is also recursive?
1, 2, 3, 4  
1, 2  
2, 3, 4  
3, 4 
Context free languages are not closed under complement operation, so compliment of CFL may or may not be CFL. Hence statement 2 is also undecidable.
Complement of Regular languages is also regular. Since a DFA that accepts the complement of L, i.e. ∑* – L, can be obtained by swapping its final states with its nonfinal states and viceversa. Hence it is decidable and if L is a regular language, then, L must also be regular.
Recursive languages are closed under complement, so if L is a recursive language then L must also be recursive, hence it is decidable.
Question 25 
Given the language L ={ab,aa,baa}, which of the following strings are in L *?

1) abaabaaabaa
2) aaaabaaaa
3) baaaaabaaaab
4) baaaaabaa
1, 2 and 3  
2, 3 and 4  
1, 2 and 4  
1, 3 and 4 
String 1: abaabaaabaa : ab aa baa ab aa
String 2: aaaabaaaa : aa aa baa aa
String 3: baaaaabaaaab: baa aa ab aa aa b, because of the last “b” the string cannot belong to L*.
String 4: baaaaabaa : baa aa ab aa
Question 26 
Which of the following graphs is isomorphic to
(A) 3 cycle graph not in original one.
(B) Correct 5 cycles & max degree is 4.
(C) Original graph doesn’t have a degree of 3.
(D) 4 cycles not in original one.
Question 27 
Consider the following transactions with data items P and Q initialized to zero:
T1: read (P) ; read (Q) ; if P = 0 then Q : = Q + 1 ; write (Q) ; T2: read (Q) ; read (P) ; if Q = 0 then P : = P + 1 ; write (P) ;
Any nonserial interleaving of T1 and T2 for concurrent execution leads to
a serializable schedule  
a schedule that is not conflict serializable  
a conflict serializable schedule  
a schedule for which a precedence graph cannot be drawn 
The above schedule is not conflict serializable.
Question 28 
The bisection method is applied to compute a zero of the function f(x) = x^{4}  x^{3}  x^{2}  4 in the interval [1,9]. The method converges to a solution after ________ iterations.
1  
3  
5  
7 
Question 29 
Let G be a weighted graph with edge weights greater than one and G' be the graph constructed by squaring the weights of edges in G. Let T and T' be the minimum spanning trees of G and G', respectively, with total weights t and t'. Which of the following statements is TRUE?
T' = T with total weight t' = t^{2}  
T' = T with total weight t'  
T' ≠ T but total weight t' = t^{2}  
None of the above 
Then MST for G is,
Now let's square the weights,
Then MST for G' is,
So, from above we can see that T is not necessarily equal to T' and moreover (t^{1}) < (t^{2}).
So option (D) is correct answer.
Question 30 
What is the minimal form of the karnaugh map shown below? Assume that X denotes a don't care term
Question 31 
Consider the 3 processes, P1, P2 and P3 shown in the table.
Process Arrival time Time Units Required P1 0 5 P2 1 7 P3 3 4
The completion order of the 3 processes under the policies FCFS and RR2 (round robin scheduling with CPU quantum of 2 time units) are
FCFS: P1, P2, P3 RR2: P1, P2, P3  
FCFS: P1, P3, P2 RR2: P1, P3, P2  
FCFS: P1, P2, P3 RR2: P1, P3, P2  
FCFS: P1, P3, P2 RR2: P1, P2, P3 
FCFS is clear.
RR Queue: In RR queue time slot is of 2 units.
Processes are assigned in following order
P1, P2, P1, P3, P2, P1, P3, P2, P2
This question used the ready queue concept. At t=2, P2 starts and P1 is sent to the ready queue and at t=3 P3 arrives so then the job P3 is queued in the ready queue after P1. So at t=4, again P1 is executed then P3 is executed for the first time at t=6.
RR2: P1, P3, P2
So option C.
Question 32 
Fetch_And_Add(X,i) is an atomic ReadModifyWrite instruction that reads the value of memory location X, increments it by the value i, and returns the old value of X. It is used in the pseudocode shown below to implement a busywait lock. L is an unsigned integer shared variable initialized to 0. The value of 0 corresponds to lock being available, while any nonzero value corresponds to the lock being not available.
AcquireLock(L){ while (Fetch_And_Add(L,1)) L = 1; } ReleaseLock(L){ L = 0; }
This implementation
fails as L can overflow  
fails as L can take on a nonzero value when the lock is actually available  
works correctly but may starve some processes  
works correctly without starvation 
while (Fetch_And_Add (L,1))
L = 1; // A waiting process can be here just after
// the lock is released, and can make L = 1.
Assume P1 executes until while condition and preempts before executing L =1. Now P2 executes all statements, hence L = 0. Then P1 without checking L it makes L = 1 by executing the statement where it was preempted.
It takes a nonzero value (L=1) when the lock is actually available (L = 0). So option B.
Question 33 
Suppose a fair sixsided die is rolled once. If the value on the die is 1, 2, or 3, the die is rolled a second time. What is the probability that the sum total of values that turn up is at least 6?
10/21  
5/12  
2/3  
1/6 
The value on second time can be {1, 2, 3, 4, 5, 6}
So the Sum can be
We have Sample space = 36
The no. of events where (Sum = atleast 6) = {6, 7, 6, 7, 8, 6, 7, 8, 9}
So the probability atleast ‘6’ while getting {1, 2, 3} in first time = 9/36 → ①
If we get ‘6’ in the first time itself, then we do not go for rolling die again.
So, its probability = 1/6
Total probability = 1/6 + 9/36 = 1/6 + 1/4 = 10/24 = 5/12
Question 34 
An Internet Service Provider (ISP) has the following chunk of CIDRbased IP addresses available with it: 245.248.128.0/20. The ISP wants to give half of this chunk of addresses to Organization A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of addresses to A and B?
245.248.136.0/21 and 245.248.128.0/22  
245.248.128.0/21 and 245.248.128.0/22  
245.248.132.0/22 and 245.248.132.0/21  
245.248.136.0/24 and 245.248.132.0/21 
Question 35 
Suppose a circular queue of capacity (n  1) elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are
full: (REAR+1)mod n == FRONT empty: REAR == FRONT  
full: (REAR+1)mod n == FRONT empty: (FRONT+1) mod n == REAR  
full: REAR == FRONT empty: (REAR+1) mod n == FRONT  
full: (FRONT+1)mod n == REAR empty: REAR == FRONT 
To circulate within the queue we have to write mod n for (Rear + 1).
We insert elements using Rear & delete through Front.
Question 36 
Consider the program given below, in a blockstructured pseudolanguage with lexical scoping and nesting of procedures permitted.
Program main; Var ... Procedure A1; Var ... Call A2; End A1 Procedure A2; Var ... Procedure A21; Var ... Call A1; End A21 Call A21; End A21 Call A1; End main.
Consider the calling chain : Main>A1>A2>A21>A1 The correct set of activation records along with their access links is given by:
Main → A1 → A2 → A21 → A1
Since, Activation records are created at procedure exit time.
A1 & A2 are defined under Main ( ). So A1 & A2 access links are pointed to main.
A21 is defined under A2, hence its access link will point to A2.
Question 37 
How many onto (or surjective) functions are there from an nelement (n ≥ 2) set to a 2element set?
2^{n}  
2^{n}1  
2^{n}2  
2(2^{n}– 2) 
Onto function is possible if m ≥ n. So, no. of onto functions possible is,
n^{m}  ^{n}C_{1} (n1)^{m} + ^{n}C_{2} (n2)^{m} + .......
Here in Question,
m = n, n = 2
So, the final answer will be,
= 2^{n}  ^{2}C_{1} (21)^{n} + ^{2}C_{2} (22)^{n}
= 2^{n}  2 × 1 + 0
= 2^{n}  2
Question 38 
Let G be a complete undirected graph on 6 vertices. If vertices of G are labeled, then the number of distinct cycles of length 4 in G is equal to
15  
30  
45  
360 
It is asked to find the distinct cycle of length 4. As it is complete graph, if we chose any two vertices, there will be an edge.
So, to get a cycle of length 4 (means selecting the 4 edges which can form a cycle) we can select any four vertices.
The number of such selection of 4 vertices from 6 vertices is ^{6}C_{4} => 15.
From each set of 4 vertices, suppose a set {a, b, c, d} we can have cycles like
abcd
abdc
acbd
acdb
adbc
adcb (Total 6, which is equal to number of cyclic permutations (n1)! )
As they are labelled you can observe, abcd and adcb are same, in different directions.
So, we get only three combinations from the above 6.
So, total number of distinct cycles of length 4 will be 15*3 = 45.
If it is asked about just number of cycles then 15*6 = 90
Question 39 
A list of n strings, each of length n, is sorted into lexicographic order using the mergesort algorithm. The worst case running time of this computation is
O (n log n)  
O (n^{2} log n)  
O (n^{2} + log n)  
O (n^{2}) 
2.The length of the string is n, the time taken is to be O(n) for each comparison.
3. For level 1(bottomup order): Every element has to be compared with other element the number of comparisons is O(n/2).
4. For level 1(bottomup order): Total time taken by one level is O(n^{2}).
5. For copying level to level the time taken by O(n^{2}).
So, For level 1= O(n^{2})+ O(n^{2})
6. Second level O(n^{2})+ O(n^{2}).
;
;
;
Final n level (logn)*O(n^{2}) = O(n^{2} logn)
Question 40 
Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices S and T. Which one will be reported by Dijkstra's shortest path algorithm? Assume that, in any iteration, the shortest path to a vertex v is updated only when a strictly shorter path to v is discovered.
SDT  
SBDT  
SACDT  
SACET 
The shortest path between S to T is SBDT also but if you follow Dijkstra shortest path algorithm then the shortest path you will getting from S to T is only SACET. We suggest you to apply Dijkstra algorithm on S and find the shortest path between S to all vertices. Then the path you will get from S to T is SACET.
Here we will draw edge from E to T not D to S because we updated the T value to 10 after selecting vertex E.
So, path is S, A, C, E, T.
Here D will get 7 only through S. So, SBDT is not possible and SDT is not possible because T will get 10 only after selecting E. So, path is SACET.
Question 41 
A file system with 300 GByte disk uses a file descriptor with 8 direct block addresses, 1 indirect block address and 1 doubly indirect block address. The size of each disk block is 128 Bytes and the size of each disk block address is 8 Bytes. The maximum possible file size in this file system is
3 KBytes  
35 KBytes  
280 KBytes  
dependent on the size of the disk 
So, one direct block addressing will point to 8 disk blocks = 8*128 B = 1 KB
Singly Indirect block addressing will point to 1 disk block which has 128/8 disc block addresses = (128/8)*128 B = 2 KB
Doubly indirect block addressing will point to 1 disk block which has 128/8 addresses to disk blocks which in turn has 128/8 addresses to disk blocks = 16*16*128 B = 32 KB
Maximum possible file size = 1 KB + 2 KB + 32 KB = 35 KB
Question 42 
Consider the virtual page reference string
1, 2, 3, 2, 4, 1, 3, 2, 4, 1
On a demand paged virtual memory system running on a computer system that main memory size of 3 pages frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacements policy. Then
OPTIMAL < LRU < FIFO  
OPTIMAL < FIFO < LRU  
OPTIMAL = LRU  
OPTIMAL = FIFO 
No. of page faults with FIFO = 6
LRU:
No. of page faults with LRU = 9
Optimal:
No. of page faults with optimal = 5
∴ Optimal < FIFO < LRU
Question 43 
Suppose R_{1}(A, B) and R_{2}(C, D) are two relation schemas. Let r_{1} and r_{2} be the corresponding relation instances. B is a foreign key that refers to C in R_{2}. If data in r_{1} and r_{2} satisfy referential integrity constraints, which of the following is ALWAYS TRUE?
∏_{B} (r_{1})  ∏_{C} (r_{2}) = ∅  
∏_{C} (r_{2})  ∏_{B} (r_{1}) = ∅  
∏_{B} (r_{1}) = ∏_{C} (r_{2})  
∏_{B} (r_{1})  ∏_{C} (r_{2}) ≠ ∅ 
So we can say that r_{2}(C) is the superset of r_{1}(B).
So (subset  superset) is always empty.
Question 44 
Consider a source computer (S) transmitting a file of size 10^{6} bits to a destination computer (D) over a network of two routers (R_{1} and R_{2}) and three links (L_{1}, L_{2} and L_{3}). L_{1} connects S to R_{1}; L_{2} connects R_{1} to R_{2}; and L_{3} connects R_{2} to D. Let each link be of length 100 km. Assume signals travel over each link at a speed of 10^{8} meters per second. Assume that the link bandwidth on each link is 1Mbps. Let the file be broken down into 1000 packets each of size 1000 bits. Find the total sum of transmission and propagation delays in transmitting the file from S to D?
1005 ms  
1010 ms  
3000 ms  
3003 ms 
Propagation delay = (Distance) / (Velocity) = 3*10^{5}/10^{8} = 3ms
Total transmission delay for 1 packet = 3 * L / B = 3*(1000/10^{6}) = 3ms. Because at source and 2 routers, we need to transmit the bits.
The first packet will reach destination = T_{t} + T_{p} = 6ms.
While the first packet was reaching to D, other packets must have been processing in parallel. So D will receive remaining packets 1 packet per 1 ms from R_{2}. So remaining 999 packets will take 999 ms.
And total time will be 999 + 6 = 1005 ms
Question 45 
Consider an instance of TCP’s Additive Increase Multiplicative Decrease (AIMD) algorithm where the window size at the start of the slow start phase is 2 MSS and the threshold at the start of the first transmission is 8 MSS. Assume that a timeout occurs during the fifth transmission. Find the congestion window size at the end of the tenth transmission.
8 MSS  
14 MSS  
7 MSS  
12 MSS 
Time = 1 during 1st trans. , window size = 2 (Slow start),
Time = 2 congestion window size = 4 (double the no. of ack.)
Time = 3 congestion window = 8
Time = 4 congestion window size = 9, after threshold, increase by one additive increase.
Time = 5 transmit 10 MSS, but time out occur congestion window size = 10
Hence threshold = (congestion window size)/2 = 10/2 = 5
Time = 6 transmit 2(since in the question, they are saying ss is starting from 2)
Time = 7 transmit 4
Time = 8 transmit 5
Time = 9 transmit 6
Time = 10 transmit 7
Question 46 
Consider the set of strings on {0,1} in which, every substring of 3 symbols has at most two zeros. For example, 001110 and 011001 are in the language, but 100010 is not. All strings of length less than 3 are also in the language. A partially completed DFA that accepts this language is shown below.
The missing arcs in the DFA are
From the state “00” it is clear that if another “0” comes then the string is going to be rejected, so from state “00” the transition with input “0” will lead to state “q”. So option A and B are eliminated.
Now option C has the self loop of “0” on state “10” which will accept any number of zeros (including greater than three zeros), hence the C option is also wrong. We left with only option D which is correct option.
Question 47 
The height of a tree is defined as the number of edges on the longest path in the tree. The function shown in the pseudocode below is invoked as height (root) to compute the height of a binary tree rooted at the tree pointer root.
The appropriate expression for the two boxes B1 and B2 are
B1: (1+height(n→right)) B2: (1+max(h1,h2))  
B1: (height(n→right)) B2: (1+max(h1,h2))  
B1: height(n→right) B2: max(h1,h2)  
B1: (1+ height(n→right)) B2: max(h1,h2) 
Now, we analyze the code,
The box B1 gets executed when left sub tree of n is NULL & right subtree is not NULL.
In such case, height of n will be the height of the right subtree + 1.
The box B2 gets executed when both left & right subtrees of n are not NULL.
In such case, height of n will be max of heights of left & right subtrees of n+1.
Question 48 
Consider the following C program
int a, b, c = 0; void prtFun (void); int main () { static int a = 1; /* line 1 */ prtFun(); a += 1; prtFun(); printf ( "n %d %d " , a, b) ; } void prtFun (void) { static int a = 2; /* line 2 */ int b = 1; a += ++b; printf (" n %d %d " , a, b); }
What output will be generated by the given code segment?
Hence
4 2
6 2
2 0
Question 49 
Consider the following C program
int a, b, c = 0; void prtFun (void); int main () { static int a = 1; /* line 1 */ prtFun(); a += 1; prtFun(); printf ( "n %d %d " , a, b) ; } void prtFun (void) { static int a = 2; /* line 2 */ int b = 1; a += ++b; printf (" n %d %d " , a, b); }
What output will be generated by the given code segment if:
 Line 1 is replaced by auto int a = 1;
Line 2 is replaced by register int a = 2;
Line 2 replaced by register int a=2;
In main there will be no change if it is static or auto because of a+=1 the auto variable a is updated to 2 from 1.
In prtfun ( ), register makes a difference.
For first print statement a is updated to 4 & prints 4, 2.
But now it is not a static variable to retain the value of a to 4. So it becomes 2, when second function call takes place & prints 4, 2 again. There is no change in b, it acts like a local variable.
Hence,
4 2
4 2
2 0.
Question 50 
Consider the following relations A, B, C.
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of AUB is the same as that of A.
(AUB)⋈_{A.Id>40∨C.Id<15} C
7  
4  
5  
9 
Performs the cross product and selects the tuples whose A∙Id is either greater than 40 or C∙Id is less than 15. It yields:
Question 51 
Consider the following relations A, B, C.
How many tuples does the result of the following SQL query contain?
SELECT A.id FROM A WHERE A.age > ALL (SELECT B.age FROM B WHERE B. name = "arun")
4  
3  
0  
1 
First query (2) will be executed and 0 (no) rows will be selected because in relation B there is no Name ‘Arun’.
The outer query (1) results the follow and that will be the result of entire query now. (Because inner query returns 0 rows).
Question 52 
For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. ε is the empty string, $ indicates end of input, and,  separates alternate right hand sides of productions.
S → aAbB  bAaB  ε A → S B → S
The FIRST and FOLLOW sets for the nonterminals A and B are
FIRST(A) = {a,b,ε} = FIRST(B) FOLLOW(A) = {a,b} FOLLOW(B) = {a,b,$}  
FIRST(A) = {a,b,$} FIRST(B) = {a,b,ε} FOLLOW(A) = {a,b} FOLLOW(B) = {$}  
FIRST(A) = {a,b,ε} = FIRST(B) FOLLOW(A) = {a,b} FOLLOW(B) = ∅  
FIRST(A) = {a,b} = FIRST(B) FOLLOW(A) = {a,b} FOLLOW(B) = {a,b} 
FOLLOW(P): is the set of terminals that can appear immediately to the right of P in some sentential form.
FIRST(A) = FIRST (S)
FIRST (S) = FIRST (aAbB) and FIRST (bAaB) and FIRST (ϵ)
FIRST(S) = {a, b, ϵ}
FIRST (B) = FIRST (S) = {a, b, ϵ} = FIRST (A)
FOLLOW(A) = {b} // because of production S→a A b B
FOLLOW(A) = {a} // because of production S→ b A a B
So FOLLOW (A) = {a, b}
FOLLOW (B) = FOLLOW (S) // because of production S→ a A b B
FOLLOW (S) = FOLLOW (A) // because of production S → A
So FOLLOW (S) = {$, a, b} = FOLLOW(B)
Question 53 
For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. ε is the empty string, $ indicates end of input, and,  separates alternate right hand sides of productions.
S → aAbB  bAaB  ε A → S B → S
The appropriate entries for E1, E2, and E3 are
E1: S → aAbB,A → S E2: S → bAaB,B→S E3: B → S  
E1: S → aAbB,S→ ε E2: S → bAaB,S → ε E3: S → ε  
E1: S → aAbB,S → ε E2: S → bAaB,S→ε E3: B → S  
E1: A → S,S →ε E2: B → S,S → ε E3: B →S 
S→ aAbB  bAaB  ε
The production S→ aAbB will go under column FIRST (aAbB) = a, so S→ aAbB will be in E1.
S→ bAaB will go under column FIRST(bAaB) = b, so S→ bAaB will be in E2.
S→ ε will go under FOLLOW (S) = FOLLOW(B) = {a, b, $ } , So S→ ε will go in E1, E2 and under column of $.
So E1 will have: S→ aAbB and S→ ε.
E2 will have S→ bAaB and S→ ε.
Now, B→ S will go under FIRST (S) = {a, b, ε}
Since FIRST(S) = ε so B→ S will go under FOLLOW (B) = {a, b, $}
So E3 will contain B→ S.
Question 54 
A computer has a 256 KByte, 4way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit.
The number of bits in the tag field of an address is
11  
14  
16  
27 
Cache block size = 32 Bytes
So, number of blocks in the cache = 256K / 32 = 8 K
It is a 4way set associative cache. Each set has 4 blocks.
So, number of sets in cache = 8 K / 4 = 2 K = 2^{11}.
So, 11 bits are needed for accessing a set. Inside a set we need to identify the cache block.
Since cache block size is 32 bytes, block offset needs 5 bits.
Out of 32 bit address, no. of TAG bits = 32  11  5 = 32  16 = 16
So, we need 16 tag bits.
Question 55 
A computer has a 256 KByte, 4way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit.
The size of the cache tag directory is
160 Kbits  
136 Kbits  
40 Kbits  
32 Kbits 
Cache block size = 32 Bytes
So, number of blocks in the cache = 256K / 32 = 8 K
It is a 4way set associative cache. Each set has 4 blocks.
So, number of sets in cache = 8 K / 4 = 2 K = 2^{11}.
So, 11 bits are needed for accessing a set. Inside a set we need to identify the cache block.
Since cache block size is 32 bytes, block offset needs 5 bits.
Out of 32 bit address, no. of TAG bits = 32  11  5 = 32  16 = 16
So, we need 16 tag bits.
It is given that in addition to address tag there are 2 valid bits, 1 modified bit and 1 replacement bit.
So size of each tag entry = 16 tag bits + 2 valid bits + 1 modified bit + 1 replacement bit = 20 bits
Size of cache tag directory = Size of tag entry × Number of tag entries
= 20 × 8 K
= 160 Kbits
Question 56 
The cost function for a product in a firm is given by 5q^{2}, where q is the amount of production. The firm can sell the product at a market price of ₹50 per unit. The number of units to be produced by the firm such that the profit is maximized is
5  
10  
15  
25 
Profit = 50q  5q^{2}
For Profit to be maximum,
d(Profit)/dq = 0
d(50q  5q^{2}) /dq = 0
50  10q = 0
50 = 10q
q = 5
Question 57 
Choose the most appropriate alternative from the options given below to complete the following sentence:
Despite several ––––––––– the mission succeeded in its attempt to resolve the conflict.
attempts  
setbacks  
meetings  
delegations 
Despite several setbacks the mission succeeded in its attempt to resolve the conflict.
Question 58 
Which one of the following options is the closest in meaning to the word given below?
MitigateDiminish  
Divulge  
Dedicate  
Denote 
Synonyms = Diminish, alleviate, reduce etc.
Question 59 
Choose the grammatically INCORRECT sentence:
They gave us the money back less the service charges of Three Hundred rupees.  
This country’s expenditure is not less than that of Bangladesh.  
The committee initially asked for a funding of Fifty Lakh rupees, but later settled for a lesser sum.  
This country’s expenditure on educational reforms is very less. 
In the sentence "very less" is incorrect instead of this we use "much less" or else "very little".
Question 60 
Choose the most appropriate alternative from the options given below to complete the following sentence:
Suresh’s dog is the one ––––––––– was hurt in the stampede.
that  
which  
who  
whom 
that can refer groups of things.
who can refer to people.
which can introduces a nonessential clause.
whom can refer to object of a verb (or) preposition.
Question 61 
Wanted Temporary, Parttime persons for the post of Field Interviewer to conduct personal interviews to collect and collate economic data. Requirements: High Schoolpass, must be available for Day, Evening and Saturday work. Transportation paid, expenses reimbursed.
Which one of the following is the best inference from the above advertisement?
Genderdiscriminatory  
Xenophobic  
Not designed to make the post attractive  
Not genderdiscriminatory 
Question 62 
A political party orders an arch for the entrance to the ground in which the annual convention is being held. The profile of the arch follows the equation y = 2x  0.1x^{2} where y is the height of the arch in meters. The maximum possible height of the arch is
8 meters  
10 meters  
12 meters  
14 meters 
y = 2x  0.1x^{2}
Differentiating both sides,
dy/dx = 2  0.2x
For maximum, dy/dx = 0
2  0.2x = 0
0.2x = 2
x = 10
Question 63 
An automobile plant contracted to buy shock absorbers from two suppliers X and Y. X supplies 60% and Y supplies 40% of the shock absorbers. All shock absorbers are subjected to a quality test. The ones that pass the quality test are considered reliable. Of X’s shock absorbers, 96% are reliable. Of Y’s shock absorbers, 72% are reliable. The probability that a randomly chosen shock absorber, which is found to be reliable, is made by Y is
0.288  
0.334  
0.667  
0.720 
Probability that a shock absorber from Y is reliable = 0.4×0.72 = 0.288
Probability that a randomly selected reliable absorber is from Y is = 0.288/(0.576+0.288) = 0.334
Question 64 
Which of the following assertions are CORRECT?
 P: Adding 7 to each entry in a list adds 7 to the mean of the list
Q: Adding 7 to each entry in a list adds 7 to the standard deviation of the list
R: Doubling each entry in a list doubles the mean of the list
S: Doubling each entry in a list leaves the standard deviation of the list unchanged
P, Q  
Q, R  
P, R  
R, S 
⇒ P, R are correct