CS GATE 2012 - Online Test

Q1. 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.
Answer : Option A
Explaination / Solution:
No Explaination.


Q2. 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?
Answer : Option D
Explaination / Solution:


Graph G is counter example for options (B) and (C) and Graph G1 is counter example for option (A) 

Q3. 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.
Answer : Option B
Explaination / Solution:
No Explaination.


Q4.  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 non-serial interleaving of T1 and T2 for concurrent execution leads to
Answer : Option B
Explaination / Solution:

Let S be a non-serial schedule, without loss of generality assume that T1 has started earlier than T2. The first instruction of T1 is read(P) and the last instruction of T2 is write(P), so the precedence graph for S has an edge from T1 to T2, now since S is a non-serial schedule the first instruction of T2(read(Q)) should be executed before last instruction of T1(write(Q)) and since read and write are conflicting operations, the precedence graph for S also contains an edge from T2 to T1, So we will have a cycle in the precedence graph which implies that any non serial schedule with T1 as the earliest transaction will not be conflict serializable. In a similar way we can show that if T2 is the earliest transaction then also the schedule is not conflict serializable.

Q5. 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 maximized is
Answer : Option A
Explaination / Solution:


p is maximum at 50 - 10q = 0 or, q = 5
Else check with options 

Q6. 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
Answer : Option C
Explaination / Solution:

The cumulative distribution function F(x) = P(X ≤ x) F(-1) = P(X ≤ -1) = P(X = -1) = 0.5 F(+1) = P(X ≤ +1) = P(X = -1) + P(X = +1) = 0.5 + 0.5 = 1

Q7. Let A be the 2 x 2 matrix with elements a11 = a12 = a21= + 1 and a22 =-1. Then the eigen values of the matrix A19 are
Answer : Option D
Explaination / Solution:

Characteristic equation of A is |A - λI| = 0 where λ is the eigen value


Q8. 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
Answer : Option B
Explaination / Solution:

 Sin x has a maximum value of 1 at , π/2  and a minimum value of –1 at 3π/2  and at all angles conterminal with them. The graph of f(x) =  sin x is

In the int erval [π/4, 7π/4], it has one local minimum at x = 3π/2

Q9. How many onto (or surjective) functions are there from an n-element (n ≥ 2) set to a 2- element set?
Answer : Option C
Explaination / Solution:

Total number of functions is 2n , out of which there will be exactly two functions where all elements map to exactly one element, so total number of onto functions is 2n -2

Q10. 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?
Answer : Option B
Explaination / Solution:


Required probability = 1/6 × 2/6 + 1/6 × 3/6 + 1/6 × 4/6 + 1/6 = 15/36 = 5/12