Recent Post

GATE (CS/IT) Question and Answer 2016

Q. 26 - Q. 55 carry two marks each.
Q.26 A binary relation R on N×N is defined as follows: (a,b)R(c,d) if a ≤ c or b ≤ d. Consider
the following propositions:
P: R is reflexive
Q: R is transitive
Which one of the following statements is TRUE?
(A) Both P and Q are true.
(B) P is true and Q is false.
(C) P is false and Q is true.
(D) Both P and Q are false.



Answer :- (B) 

 Q.27 Which one of the following well-formed formulae in predicate calculus is NOT valid?

(A) (∀x p(x) ⇒ ∀x q(x)) ⇒ (∃x¬p(x) ∨ ∀x q(x))
(B) (∃x p(x) ∨ ∃x q(x)) ⇒ ∃x (p(x) ∨ q(x))
(C) ∃x (p(x) ∧ q(x)) ⇒ (∃x p(x) ∧ ∃x q(x))
(D) ∀x (p(x) ∨ q(x)) ⇒ (∀x p(x) ∨ ∀x q(x))


Answer :- (D) 

Q.28 Consider a set U of 23 different compounds in a Chemistry lab. There is a subset S of U of
9 compounds, each of which reacts with exactly 3 compounds of U. Consider the following
statements:
I. Each compound in U \ S reacts with an odd number of compounds.
II. At least one compound in U \ S reacts with an odd number of compounds.
III. Each compound in U \ S reacts with an even number of compounds.
Which one of the above statements is ALWAYS TRUE?
(A) Only I
(B) Only II
(C) Only III
(D) None

Answer :- (B) 

Q.29 The value of the expression 1399(mod 17), in the range 0 to 16, is ____________.
Answer :- 4.0 : 4.0

 Q.30 Suppose the functions F and G can be computed in 5 and 3 nanoseconds by functional units
UF and UG, respectively. Given two instances of UF and two instances of UG, it is required to
implement the computation F(G(Xi)) for 1 ≤ i ≤ 10. Ignoring all other delays, the minimum
time required to complete this computation is_____________ nanoseconds.

Answer :- 28.0 : 28.0

 Q.31 Consider a processor with 64 registers and an instruction set of size twelve. Each instruction
has five distinct fields, namely, opcode, two source register identifiers, one destination register
identifier, and a twelve-bit immediate value. Each instruction must be stored in memory in
a byte-aligned fashion. If a program has 100 instructions, the amount of memory (in bytes)
consumed by the program text is ________________.

Answer :- 500.0 : 500.0

 Q.32 The width of the physical address on a machine is 40 bits. The width of the tag field in a 512
KB 8-way set associative cache is ___________bits.


Answer :- 24.0 : 24.0

Q.33 Consider a 3 GHz (gigahertz) processor with a three-stage pipeline and stage latencies Ï„1,
Ï„2, and Ï„3 such that Ï„1 = 3Ï„2/4 = 2Ï„3. If the longest pipeline stage is split into two pipeline
stages of equal latency, the new frequency is ________GHz, ignoring delays in the pipeline
registers.

Answer :- 3.9 : 4.1

 Q.34 A complete binary min-heap is made by including each integer in [1,1023] exactly once.
The depth of a node in the heap is the length of the path from the root of the heap to that
node. Thus, the root is at depth 0. The maximum depth at which integer 9 can appear is_____.

Answer :- 8.0 : 8.0 

Q.35 The following function computes XY for positive integers X and Y.
int exp(int X, int Y) {
int res = 1, a = X, b = Y;
while ( b != 0 ){
if ( b%2 == 0) { a = a*a; b = b/2; }
else { res = res*a; b = b-1; }
}
return res;
}
Which one of the following conditions is TRUE before every iteration of the loop?
(A) XY = ab
(B) (res ∗ a)Y = (res ∗ X)b

(C) XY = res ∗ ab

(D) XY = (res ∗ a)b


Answer :- (C)
 

Q.36 Consider the following New-order strategy for traversing a binary tree:
• Visit the root;
• Visit the right subtree using New-order;
• Visit the left subtree using New-order;
The New-order traversal of the expression tree corresponding to the reverse polish expression
3 4 * 5 - 2 ˆ 6 7 * 1 + - is given by:
(A) + - 1 6 7 * 2 ˆ 5 - 3 4 *
(B) - + 1 * 6 7 ˆ 2 - 5 * 3 4
(C) - + 1 * 7 6 ˆ 2 - 5 * 4 3
(D) 1 7 6 * + 2 5 4 3 * - ˆ -

Answer :- (C)
 
Q.37 Consider the following program:
int f(int *p, int n)
{
if (n <= 1) return 0;
else return max(f(p+1,n-1),p[0]-p[1]);
}
int main()
{
int a[] = {3,5,2,6,4};
printf("%d", f(a,5));
}
Note: max(x,y) returns the maximum of x and y.
The value printed by this program is _______.

Answer :- 3.0 : 3.0
 

Q.38 Let A1,A2,A3, and A4 be four matrices of dimensions 10 × 5,5 × 20,20 × 10, and 10 × 5,
respectively. The minimum number of scalar multiplications required to find the product
A1A2A3A4 using the basic matrix multiplication method is ________.


Answer :- 1500.0 : 1500.0
 

Q.39 The given diagram shows the flowchart for a recursive function A(n). Assume that all
statements, except for the recursive calls, have O(1) time complexity. If the worst case time
complexity of this function is O(nα), then the least possible value (accurate up to two decimal positions) of α is ___________.

Answer :- 2.2 : 2.4
 


Q.40 The number of ways in which the numbers 1, 2, 3, 4, 5, 6, 7 can be inserted in an empty binary
search tree, such that the resulting tree has height 6, is____________ .
Note: The height of a tree with a single node is 0.


Answer :- 64.0 : 64.0
 

Q.41 In an adjacency list representation of an undirected simple graph G = (V,E), each edge (u, v)
has two adjacency list entries: [v] in the adjacency list of u, and [u] in the adjacency list of
v. These are called twins of each other. A twin pointer is a pointer from an adjacency list
entry to its twin. If |E| = m and |V| = n, and the memory size is not a constraint, what is the
time complexity of the most efficient algorithm to set the twin pointer in each entry in each
adjacency list?
(A) Θ(n2)
(B) Θ(n+m)
(C) Θ(m2)
(D) Θ(n4)

Answer :- (B) 

Q.42 Consider the following two statements:
I. If all states of an NFA are accepting states then the language accepted by the NFA is Σ∗.
II. There exists a regular language A such that for all languages B, A∩B is regular.
Which one of the following is CORRECT?
(A) Only I is true
(B) Only II is true
(C) Both I and II are true
(D) Both I and II are false

Answer :- (B) 

Q.43 Consider the following languages:
L1 = {anbmcn+m : m,n ≥ 1}

L2 = {anbnc2n : n ≥ 1}
Which one of the following is TRUE?
(A) Both L1 and L2 are context-free.
(B) L1 is context-free while L2 is not context-free.
(C) L2 is context-free while L1 is not context-free.
(D) Neither L1 nor L2 is context-free.


Answer :- (B) 

Q.44 Consider the following languages.

L1 = {hMi | M takes at least 2016 steps on some input},
L2 = {hMi | M takes at least 2016 steps on all inputs} and
L3 = {hMi | M accepts ε},

where for each Turing machine M, hMi denotes a specific encoding of M. Which one of the
following is TRUE?
(A) L1 is recursive and L2,L3 are not recursive
(B) L2 is recursive and L1,L3 are not recursive
(C) L1,L2 are recursive and L3 is not recursive
(D) L1,L2,L3 are recursive

Answer :- (C)

Q.45 Which one of the following grammars is free from left recursion?

(A) S → AB
      A → Aa | b
      B → c
(B) S → Ab | Bb | c
      A → Bd | ε
      B → e
(C) S → Aa | B
      A → Bb | Sc | ε
      B → d
(D) S → Aa | Bb | c
       A → Bd | ε
       B → Ae | ε


Answer :- (B) 

Q.46 A student wrote two context-free grammars G1 and G2 for generating a single C-like array
declaration. The dimension of the array is at least one. For example,int a[10][3];

The grammars use D as the start symbol, and use six terminal symbols int ; id [ ] num.
Grammar G1 Grammar G2
D → intL; D → intL;
L → id[E L → idE
E → num] E → E[num]
E → num][E E → [num]
Which of the grammars correctly generate the declaration mentioned above?
(A) Both G1 and G2
(B) Only G1
(C) Only G2
(D) Neither G1 nor G2

Answer :- (A)

Q.47 Consider the following processes, with the arrival time and the length of the CPU burst given
in milliseconds. The scheduling algorithm used is preemptive shortest remaining-time first.

The average turn around time of these processes is __________milliseconds.
 Answer :- 8.2 : 8.2

Q.48 Consider the following two-process synchronization solution.
Process 0
---------
Entry: loop while (turn == 1);
(critical section)
Exit: turn = 1;

Process 1
----------
Entry: loop while (turn == 0);
(critical section)
Exit: turn = 0;

The shared variable turn is initialized to zero. Which one of the following is TRUE?
(A) This is a correct two-process synchronization solution.
(B) This solution violates mutual exclusion requirement.
(C) This solution violates progress requirement.
(D) This solution violates bounded wait requirement.

Answer :- (C) 

Q.49 Consider a non-negative counting semaphore S. The operation P(S) decrements S, and V(S)
increments S. During an execution, 20 P(S) operations and 12 V(S) operations are issued in
some order. The largest initial value of S for which at least one P(S) operation will remain
blocked is_________ .

 Answer :- 7.0 : 7.0

Q.50 A file system uses an in-memory cache to cache disk blocks. The miss rate of the cache is
shown in the figure. The latency to read a block from the cache is 1 ms and to read a block
from the disk is 10 ms. Assume that the cost of checking whether a block exists in the cache
is negligible. Available cache sizes are in multiples of 10 MB.

The smallest cache size required to ensure an average read latency of less than 6 ms is_______MB.
Answer :- 30.0 : 30.0

Q.51 Consider the following database schedule with two transactions, T1 and T2.
S = r2(X); r1(X); r2(Y); w1(X); r1(Y); w2(X); a1; a2

where ri(Z) denotes a read operation by transaction Ti on a variable Z, wi(Z) denotes a write
operation by Ti on a variable Z and ai denotes an abort by transaction Ti
.
Which one of the following statements about the above schedule is TRUE?
(A) S is non-recoverable
(B) S is recoverable, but has a cascading abort
(C) S does not have a cascading abort
(D) S is strict


Answer :- (C)

Q.52 Consider the following database table named water_schemes :
The number of tuples returned by the following SQL query is .
with total(name, capacity) as
select district_name, sum(capacity)
from water_schemes
group by district_name
with total_avg(capacity) as
select avg(capacity)
from total
select name
from total, total_avg
where total.capacity ≥ total_avg.capacity

Answer :- 2.0 : 2.0

Q.53 A network has a data transmission bandwidth of 20×106 bits per second. It uses CSMA/CD
in the MAC layer. The maximum signal propagation time from one node to another node is
40 microseconds. The minimum size of a frame in the network is bytes.

 Answer :- 200.0 : 200.0

Q.54 For the IEEE 802.11 MAC protocol for wireless communication, which of the following
statements is/are TRUE?
I. At least three non-overlapping channels are available for transmissions.
II. The RTS-CTS mechanism is used for collision detection.
III. Unicast frames are ACKed.
(A) All I, II, and III
(B) I and III only
(C) II and III only
(D) II only

Answer :- (B) 

Q.55 Consider a 128×103 bits/second satellite communication link with one way propagation delay
of 150 milliseconds. Selective retransmission (repeat) protocol is used on this link to send
data with a frame size of 1 kilobyte. Neglect the transmission time of acknowledgement. The
minimum number of bits required for the sequence number field to achieve 100% utilization______
is .


Answer :- 4.0 : 4.0

No comments