Computer Science (GATE Exam) 2012 - Previous Question Paper Solution

GATE Exam Previous Year Question Paper Solution Computer Science(CS) - 2012

64 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Register renaming is done is pipelined processors

  1. as an alternative to register allocation at compile time
  2. for efficient access to function parameters and local variables
  3. to handle certain kinds of hazards
  4. as part of address translation
Question 2 Multiple Choice (Single Answer)

Given the language L = {ab, aa, baa}, which of the following strings are in L*?

  1. abaabaaabaa
  2. aaaabaaaa
  3. baaaaabaaaab
  4. baaaaabaa
  1. 1, 2 and 3
  2. 2, 3 and 4
  3. 1, 2 and 4
  4. 1, 3 and 4
Question 3 Multiple Choice (Single Answer)

In the IPv4 addressing format, the number of networks allowed under Class C addresses is

  1. 214
  2. 2
  3. 221
  4. 224
Question 4 Multiple Choice (Single Answer)

The amount of ROM needed to implement a 4 bit multiplier is

  1. 64 bits
  2. 128 bits
  3. 1 Kbit
  4. 2 Kbits
Question 5 Multiple Choice (Single Answer)

Which of the following transport layer protocols is used to support electronic mail?

  1. SMTP
  2. IP
  3. TCP
  4. UDP
Question 6 Multiple Choice (Single Answer)

Which of the following problems are decidable?

  1. Does a given program ever produce an output?
  2. If L is context-free language, then, is L also context-free?
  3. If L is regular language, then, is L also regular?
  4. If L is recursive language, then, is L also recursive?
  1. 1,2,3,4
  2. 1, 2
  3. 2, 3, 4
  4. 3, 4
Question 7 Multiple Choice (Single Answer)

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?

  1. A(n) = $\Omega$(W (n))
  2. A(n) =$\odot$(W(n))
  3. A(n) = O(W(n))
  4. None of these
Question 8 Multiple Choice (Single Answer)

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

  1. 0 and 0.5
  2. 0 and 1
  3. 0.5 and 1
  4. 0.25 and 0.75
Question 9 Multiple Choice (Single Answer)

Let G be a simple undirected planar graph on 10 vertices with l5 edges. If G is a connected graph, then the number of bounded faces in any embedding of G on the plane is equal to

  1. 3
  2. 4
  3. 5
  4. 6
Question 10 Multiple Choice (Single Answer)

The recurrence relation capturing the optimal execution time of the Towers of Hanoi problem with n discs is

  1. T(n) = 2T(n - 2) + 2
  2. T(n) = 2T(n - 1) + n
  3. T(n) = 2T(n/2) + 1
  4. T(n) = 2T(n -1) + 1
Question 11 Multiple Choice (Single Answer)

Given the basic ER and relational models, which of the following is INCORRECT?

  1. An attribute of an entity can have more than one value.
  2. An attribute of an entity can be composite.
  3. In a row of a relational table, an attribute can have more than one value.
  4. In a row of a relational table, an attribute can have exactly one value or a NULL value.
Question 12 Multiple Choice (Single Answer)

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 clauseQ: An SQL query can contain a HAVING clause only if it has GROUP BY clause
R: All attributes used in the GROUP BY clause must appear in the SELECT clauseS: Not all attributes used in the GROUP BY clause need to appear in the SELECT clause

  1. P and R
  2. P and S
  3. Q and R
  4. Q and S
Question 13 Multiple Choice (Single Answer)

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

  1. $1024$ and $−1024$
  2. $1024\sqrt{2}$ and $−1024 \sqrt{2}$
  3. $4 \sqrt{2}$ and $−4 \sqrt{2}$
  4. $512 \sqrt{2}$ and $−512 \sqrt{2}$
Question 14 Multiple Choice (Single Answer)

What is the complement of the language accepted by the NFA shown below?
Assume $\Sigma = {a}$ and $\epsilon$ is the empty string.

  1. $\phi$
  2. $\\\{\epsilon\\\}$
  3. $a^*$
  4. $\\\{a , \epsilon\\\}$
Question 15 Multiple Choice (Single Answer)

The decimal value 0.5 in IEEE single precision floating point representation has

  1. fraction bits of 000...000 and exponent value of 0
  2. fraction bits of 000...000 and exponent value of -i
  3. fraction bits of 100.000 and exponent value of 0
  4. no exact representation
Question 16 Multiple Choice (Single Answer)

The protocol data unit (PDU) for the application layer in the Internet stack is

  1. Segment
  2. Datagram
  3. Message
  4. Frame
Question 17 Multiple Choice (Single Answer)

What is the correct translation of the following statement into mathematical logic?

“Some real numbers are rational”

  1. $\exists x (real(x) \lor rational(x))$
  2. $\forall x (real(x) \to rational(x))$
  3. $\exists x (real(x) \wedge rational(x))$
  4. $\exists x (rational(x) \to real(x))$
Question 18 Multiple Choice (Single Answer)

Which of the following is TRUE?

  1. Every relation is 3NF is also in BCNF.
  2. A relation R is in 3NF if every non-prime attribute of R is fully functionally dependent on every key of R.
  3. Every relation in BCNF is also in 3NF.
  4. No relation can be in both BCNF and 3NF.
Question 19 Multiple Choice (Single Answer)

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?

  1. Both I1 and I2 are correct inferences.
  2. I1 is correct but I2is not a correct inference.
  3. I1 is not correct but I2 is a correct inference.
  4. Both I1 and I2 are not correct inferences.
Question 20 Multiple Choice (Single Answer)

A process executes the code
fork ( );
fork ( );
fork ( );
The total number of child processes created is

  1. 3
  2. 4
  3. 7
  4. 8
Question 21 Multiple Choice (Single Answer)

The below given truth table represents the Boolean function

X Y f(X, Y)
0 0 0
0 1 0
1 0 1
1 1 1
  1. X
  2. X + Y
  3. X $\oplus$ Y
  4. Y
Question 22 Multiple Choice (Single Answer)

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.

  1. 8MSS
  2. 14MSS
  3. 7MSS
  4. 12MSS
Question 23 Multiple Choice (Single Answer)

Consider the function f(x) = sin(x) in the interval x $\in$[$\pi$/4, 7$\pi$/4]. The number and location(s) of the local minima of this function are

  1. One; at $\pi$/2
  2. One; at 3$\pi$/2
  3. Two; at $\pi$/2 and 3$\pi$/2
  4. Two; at $\pi$/4 and 3$\pi$/2
Question 24 Multiple Choice (Single Answer)

The worst case running time to search for an element in a balanced binary search tree with n2n elements is

  1. $\theta$(n log n)
  2. $\theta$(n2n)
  3. $\theta$(n)
  4. $\theta$(log n)
Question 25 Multiple Choice (Single Answer)

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 compelled DFA that accepts this language is shown below.

Question 26 Multiple Choice (Single Answer)

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 has main memory size of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacement policy. Then

  1. OPTIMAL < LRU < FIFO
  2. OPTIMAL < FIFO < LRU
  3. OPTIMAL = LRU
  4. OPTIMAL = FIFO
Question 27 Multiple Choice (Single Answer)

What will be the output of the following C program segment?

Char inChar = ‘A’
switch (inChar ) {
case ‘A’ : printf (“Choice A n”);
case ‘B’
case ‘C’ : print f(”Choice B”);
case ‘D’
case ‘E’
default : printf (“No Choice”) ; }

  1. No choice
  2. Choice A
  3. Choice A, Choice B No choice
  4. Program gives no output as it is erroneous
Question 28 Multiple Choice (Single Answer)

How many onto (or subjective) functions are there from an n-element (n $\ge$ 2) set to a 2-element set?

  1. 2n
  2. 2n – 1
  3. 2n – 2
  4. 2(2n-2)
Question 29 Multiple Choice (Single Answer)

Consider a source computer (S) transmitting a file of size 106 bits to a destination computer (D) over a network of two routers (R1 and R2) and three links (L1, L2, and L3). L1 connects S to R1 L2 connects R1 to R2 and L3 connects R2 to D. Let each link be of length 100 km. Assume signals travel over each line at a speed of 108 meters per second. Assume that the link bandwidth on each link is 1 Mbps. 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.

  1. 1005 ms
  2. 1010 ms
  3. 3000 ms
  4. 3003 ms
Question 30 Multiple Choice (Single Answer)

Consider the program given below, in a block-structured pseudo-language with lexical scoping and nesting of procedures permitted.

Question 31 Multiple Choice (Single Answer)

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.

  1. SDT
  2. SBDT
  3. SACDT
  4. SACET
Question 32 Multiple Choice (Single Answer)

Suppose a fair six-sided 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?

  1. 10/21
  2. 5/12
  3. 2/3
  4. 1/6
Question 33 Multiple Choice (Single Answer)

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

  1. full: (REAR+l) mod n == FRONT
    empty: REAR ==FRONT
  2. full:(REAR+l)mod n == FRONT
    empty: (FRONT+l)mod n==REAR
  3. full: REAR == FRONT
    empty: (REAR+l) mod n == FRONT
  4. full:(FRONT+ l)mod n == REAR
    empty: REAR == FRONT
Question 34 Multiple Choice (Single Answer)

Suppose $R_{1} (\underline{A}, B)$ and $R_{2} (\underline{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?

  1. $\prod_{B}(r_{1})- \prod_{C}(r_{2})= \varnothing$
  2. $\prod_{C}(r_{2})- \prod_{B}(r_{1})= \varnothing$
  3. $\prod_{B}(r_{1}) = \prod_{C}(r_{2})$
  4. $\prod_{B}(r_{1}) - \prod_{C}(r_{2}) \neq \varnothing$
Question 35 Multiple Choice (Single Answer)

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

  1. 3 Kbytes
  2. 35 Kbytes
  3. 280 Kbytes
  4. dependent on the size of the disk
Question 36 Multiple Choice (Single Answer)

An Internet Service Provider (ISP) has the following chunk of CIDR-based 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 address to A and B?

  1. 245.248.136.0/21 and 245.248.128.0/22
  2. 245.248.128.0/21 and 245.248.128.0/22
  3. 245.248.132.0/22 and 245.248.132.0/21
  4. 245.248.136.0/24 and 245.248.132.0/21
Question 37 Multiple Choice (Single Answer)

A list of n stings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is

  1. O(nlogn)
  2. O(n2 logn)
  3. O(n2 +logn)
  4. O(n2)
Question 38 Multiple Choice (Single Answer)

Assuming P$\ne$NP, which of the following is TRUE?

  1. NP-complete = NP
  2. NP-complete $\cap$P = $\phi$
  3. NP-hard = NP
  4. P = NP-complete
Question 39 Multiple Choice (Single Answer)

What is the minimal form of the Karnaugh map shown below? Assume that X denotes a don't care term.

  1. $\bar{b} \bar{d}$
  2. $ \bar { b } \bar { d } + \bar{b} \bar{c} $
  3. $ \bar{b} \bar{d} + {a} \bar{b} \bar{c} {d}$
  4. $ \bar{b} \bar{d} + \bar{b} \bar{c} + \bar{c} \bar{d} $
Question 40 Multiple Choice (Single Answer)

Fetch_And_Add (X, i) is an atomic Read-Modify-Write 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 busy-wait lock. L is an unsigned integer shared variable initialized to 0. The value of 0 corresponds to lock being available, while any non-zero value corresponds to the lock being not available.
AcquireLock(L){
While (Fetch_And_Add(L,1))
L = 1;
}
Release Lock (L){
L = 0;
}
This implementation

  1. fails as L can overflow
  2. fails as L can take on a non-zero value when the lock is actually available
  3. works correctly but may starve some processes
  4. works correctly without starvation
Question 41 Multiple Choice (Single Answer)

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?

  1. T' = T with total weight t' = t2
  2. T' = T with total weight t' < t2
  3. T'$\ne$ T but total weight t' = t2
  4. None of these
Question 42 Multiple Choice (Single Answer)

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.
int height (treeptr n)

The appropriate expressions for the two boxes B1 and B2 are

  1. B1: (1 + height (n$\rightarrow$right)) B2: (1 - max (h1, h2))
  2. B1: (height (n$\rightarrow$right)) B2: (1 - max (h1, h2))
  3. B1: height (n$\rightarrow$right) B2: max (h1, h2)
  4. B1: (1 + height (n$\rightarrow$right)) B2: max (h1, h2)
Question 43 Multiple Choice (Single Answer)

Which of the following graph is isomorphic to

Question 44 Multiple Choice (Single Answer)

The bisection method is applied to compute a zero of the function f(x) = x4 - x3 - x2 - 4 in the interval [1, 9]. The method converges to a solution after ________ iteration(s).

  1. 1
  2. 3
  3. 5
  4. 7
Question 45 Multiple Choice (Single Answer)

Consider the following transactions with data items P and Q initialized to zero:
T1: read (P);
read (Q);
if P = 0 them Q: = Q + 1;
write (Q).
T2: read (Q);
read (P)
if Q = 0 then P: = P + 1;
write (P).
Any non - serial interleaving of T1 and T2 for concurrent execution leads to

  1. a serializable schedule
  2. a schedule that is not conflict serializable
  3. a conflict seriallzable schedule
  4. a schedule for which precedence graph cannot be drawn
Question 46 Multiple Choice (Single Answer)

How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A$\cup$B is the same as that of A.
(A$\cup$5)$\bowtie$A.Id>40 v C.Id<15 C

  1. 7
  2. 4
  3. 5
  4. 9
Question 47 Multiple Choice (Single Answer)

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;

  1. 3 1
    4 1
    4 2
  2. 4 2
    6 1
    6 1
  3. 4 2
    6 2
    2 0
  4. 4 2
    4 2
    2 0
Question 48 Multiple Choice (Single Answer)

The cost function for a product in a firm is given by 5q2 where q is the amount of production. The firm can sell the product at a market price of Rs. 50 per unit. The number of units to be produced by the firm such that the profit is maximised is

  1. 5
  2. 10
  3. 15
  4. 25
Question 49 Multiple Choice (Single Answer)

Direction: A computer has a 256 KByte, 4-way 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

  1. 160 Kbits
  2. 136 Kbits
  3. 40 Kbits
  4. 32 Kbits
Question 50 Multiple Choice (Single Answer)

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.

  1. that
  2. which
  3. who
  4. whom
Question 51 Multiple Choice (Single Answer)

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.

  1. attempts
  2. setbacks
  3. meetings
  4. delegations
Question 52 Multiple Choice (Single Answer)

Choose the grammatically INCORRECT sentence.

  1. They gave us the money back less the service charges of three hundred rupees.
  2. This country's expenditure is not less than that of Bangladesh.
  3. This country’s expenditure on educational reforms is very less.
  4. The committee initially asked for a funding of Fifty Lakh rupees, but later settled for a lesser sum.
Question 53 Multiple Choice (Single Answer)

Which one of the following options is the closest in meaning to the word given below?
Mitigate

  1. Diminish
  2. Divulge
  3. Dedicate
  4. Denote
Question 54 Multiple Choice (Single Answer)

What output will be generated by the given code segment?

  1. 3 1
    4 1
    4 2
  2. 4 2
    6 1
    6 1
  3. 4 2
    6 2
    2 0
  4. 3 1
    5 2
    5 2
Question 55 Multiple Choice (Single Answer)

Wanted Temporary, Part-time persons for the post of Field Interviewer to conduct personal interviews to collect and collate economic data. Requirements:
High School-pass, 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?

  1. Gender-discriminatory
  2. Xenophobic
  3. Not designed to make the post attractive
  4. Not gender-discriminatory
Question 56 Multiple Choice (Single Answer)

Consider the 3 process, P1, P2 and P3 shown in the table.

Process Arrival Time Time units Requied
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

  1. FCFS: P1, P2, P3 RR2: P1, P2, P3
  2. FCFS: P1, P3, P2 RR2: P1, P3, P2
  3. FCFS: P1, P2, P3 RR2: P1, P3, P2
  4. FCFS: P1, P3, P2 RR2: P1, P2, P3
Question 57 Multiple Choice (Single Answer)

Direction: A computer has a 256 KByte, 4-way 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

  1. 11
  2. 14
  3. 16
  4. 27
Question 58 Multiple Choice (Single Answer)

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’)

  1. 4
  2. 3
  3. 0
  4. 1
Question 59 Multiple Choice (Single Answer)

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.

  1. P, Q
  2. Q, R
  3. P, R
  4. R, S
Question 60 Multiple Choice (Single Answer)

Direction: 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 El, E2, and E3. is the empty string, $ indicates end of input, and I separates alternate right hand sides of productions.

The First and Follow sets for the non-terminals A and B are

  1. FIRST(A) = {a, b,$\in$} = FIRST (B) FOLLOW(A) = {a, b} FOLLOW(B) = {a, b, \$}
  2. FIRST(A) = {a, b, \$} FIRST(B) = {a, b,$\in$} FOLLOW(A) = {a, b} FOLLOW(B) ={\$}
  3. FIRST(A) = {a, b,$\in$} = FIRST(B) FIRST(A) = {a, b} FOLLOW(B) = $\phi$
  4. FIRST(A) = {a, b,} = FIRST(B)
    FIRST(A) = {a, b}
    FOLLOW(B) = {a, b}
Question 61 Multiple Choice (Single Answer)

Given the sequence of terms, AD CG FK JP, the next term would be

  1. OV
  2. OW
  3. PV
  4. PW
Question 62 Multiple Choice (Single Answer)

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.1x2 where y is the height of the arch in meters. The maximum possible height of the arch is

  1. 8 meters
  2. 10 meters
  3. 12 meters
  4. 14 meters
Question 63 Multiple Choice (Single Answer)

Direction: 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 El, E2, and E3. 8 is the empty string, $ indicates end of input, and I separates alternate right hand sides of productions.

The appropriate entries for El, E2, and E3 are

  1. E1: S$\rightarrow$aAbB, A$\rightarrow$S E2: S $\rightarrow$ bAaB, B$\rightarrow$S E3: B $\rightarrow$ S
  2. E1: S $\rightarrow$ aAbB, S $\rightarrow$$\epsilon$ E2: S$\rightarrow$ bAaB, S $\rightarrow$$\epsilon$ E3: S $\rightarrow$$\epsilon$
  3. E1: S $\rightarrow$aAbB, S$\rightarrow$$\epsilon$ E2: S$\rightarrow$ bAaB, S $\rightarrow$$\epsilon$ E3: B $\rightarrow$S
  4. E1: A$\rightarrow$S, S$\rightarrow$$\epsilon$ E2: B$\rightarrow$S, S$\rightarrow$$\epsilon$ E3: B$\rightarrow$S