GATE CS 2013


Question 1
A binary operation \\oplus on a set of integers is defined as x \\oplus y = x2 + y2. Which one of the following statements is TRUE about \\oplus?
Tick
Commutative but not associative
Cross
Both commutative and associative
Cross
Associative but not commutative
Cross
Neither commutative nor associative


Question 1-Explanation: 
Associativity: A binary operation ∗ on a set S is said to be associative if it satisfies the associative law: a ∗ (b ∗c) = (a ∗b) ∗c for all a, b, c ∈S. Commutativity: A binary operation ∗ on a set S is said to be commutative if it satisfies the condition: a ∗b=b ∗a for all a, b, ∈S. In this case, the order in which elements are combined does not matter. Solution: Here a binary operation on a set of integers is defined as x⊕ y = x2 + y2. for Commutativity: x ⊕y= y ⊕x. LHS=> x ⊕y= x^2+ y^2 RHS=> y ⊕x= y^2+x^2 LHS = RHS. hence commutative. for Associativity: x ⊕ (y ⊕ z) =(x ⊕ y) ⊕ z LHS=> x ⊕ (y⊕ z) = x ⊕ ( y^2+z^2)= x^2+(y^2+z^2)^2 RHS=> (x ⊕y) ⊕z= ( x^2+y^2) ⊕z=(x^2+y^2)^2+z^2 So, LHS ≠ RHS, hence not associative. Reference: http://faculty.atu.edu/mfinan/4033/absalg3.pdf This solution is contributed by Nitika Bansal Another Solution : \\oplus commutative as x\\oplusy is always same as y\\oplusx. \\oplus is not associative as (x\\oplusy)\\oplusz is (x^2 + y^2)^2 + z^2, but x\\oplus(y\\oplusz) is x^2 + (y^2 + z^2)^2.
Question 2

Which one of the following does NOT equal to 

gatecs20132

gatecs2013

Cross

C
 

Cross

D
 

Cross

B
 

Tick

A
 



Question 2-Explanation: 

First of all, you should know the basic properties of determinants before approaching 
For these kind of problems. 
1) Applying any row or column transformation does not change the determinant 
2) If you interchange any two rows, sign of the determinant will change

A = | 1  x  x^2 | 
       | 1  y  y^2 | 
       | 1  z  z^2 |

To prove option (b)

=> Apply column transformation C2 -> C2+C1

C3 -> C3+C1

=> det(A) = | 1  x+1  x^2+1 | 
                     | 1  y+1  y^2+1 | 
                     | 1  z+1  z^2+1 |

To prove option (c),

=> Apply row transformations R1 -> R1-R2

R2 -> R2-R3

=> det(A) = | 0   x-y   x^2-y^2 | 
                     | 0   y-z   y^2-z^2 | 
                     | 1      z          z^2   |

To prove option (d), 

=> Apply row transformations R1 -> R1+R2

R2 -> R2+R3

=> det(A) = | 2  x+y   x^2+y^2 | 
                     | 2  y+z   y^2+z^2 | 
                     | 1     z        z^2     |

Question 3
The smallest integer that can be represented by an 8-bit number in 2’s complement form is
Cross
-256
Tick
-128
Cross
-127
Cross
0


Question 3-Explanation: 
See Two\'s complement For n bit 2\'s complement numbers, range of number is -(2(n-1)) to +(2(n-1)-1)
Question 4
In the following truth table, V = 1 if and only if the input is valid. gatecs20133 What function does the truth table represent?
Tick
Priority encoder
Cross
Decoder
Cross
Multiplexer
Cross
Demultiplexer


Question 4-Explanation: 
Since there are more than one outputs and number of outputs is less than inputs, it is a Priority encoder V=1 when input is valid and for priority encoder it checks first high bit encountered. Except all are having at least one bit high and ‘x’ represents the “don’t care” as we have found a high bit already. So answer is (A).
Question 5
Which one of the following is the tightest upper bound that represents the number of swaps required to sort n numbers using selection sort?
Cross
O(log n)
Tick
O(n)
Cross
O(nLogn)
Cross
O(n^2)


Question 5-Explanation: 
To sort elements in increasing order, selection sort always picks the maximum element from remaining unsorted array and swaps it with the last element in the remaining array. So the number of swaps, it makes in n-1 which is O(n)
Question 6
Which one of the following is the tightest upper bound that represents the time complexity of inserting an object into a binary search tree of n nodes?
Cross
O(1)
Cross
O(Logn)
Tick
O(n)
Cross
O(nLogn)


Question 6-Explanation: 
To insert an element, we need to search for its place first. The search operation may take O(n) for a skewed tree like following.
To insert 50, we will have to traverse all nodes.
        10
         \\
          20
            \\
             30
               \\
                40
Question 7

Consider the languages L1 = \\phi and L2 = {a}. Which one of the following represents L1 L2* U L1*

 
Tick

{\epsilon }

Cross

\phi

Cross

a*

Cross

{\epsilon ,a}



Question 7-Explanation: 

L1 L2* U L1* Result of L1 L2* is \\phi . {\\phi } indicates an empty language. Concatenation of \\phi with any other language is \\phi . It works as 0 in multiplication. L1* = \\phi * which is {\\epsilon }. Union of \\phi and {\\epsilon } is {\\epsilon }

Question 8

What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon- and unit-production (i.e., of type A -> є and A -> a) to parse a string with n tokens?

Cross

n/2

Tick

n-1

Cross

2n-1

Cross

2n



Question 8-Explanation: 

Given in the question, a grammar with no epsilon- and unit-production (i.e., of type A -> є and A -> a). 

To get maximum number of Reduce moves, we should make sure than in each sentential form only one terminal is reduced. Since there is no unit production, so last 2 tokens will take only 1 move. 

So To Reduce input string of n tokens, first Reduce n-2 tokens using n-2 reduce moves and then Reduce last 2 tokens using production which has . So total of n-2+1 = n-1 Reduce moves. 

Suppose the string is abcd. ( n = 4 ). 

We can write the grammar which accepts this string as follows:

S->aB
B->bC
C->cd 

The Right Most Derivation for the above is:

S -> aB ( Reduction 3 )
-> abC ( Reduction 2 )
-> abcd ( Reduction 1 )

We can see here that no production is for unit or epsilon. Hence 3 reductions here. We can get less number of reductions with some other grammar which also doesn't produce unit or epsilon productions,

S->abA
A-> cd

The Right Most Derivation for the above as:

S -> abA ( Reduction 2 )
-> abcd ( Reduction 1 )

Hence 2 reductions. 

But we are interested in knowing the maximum number of reductions which comes from the 1st grammar. Hence total 3 reductions is maximum, which is ( n - 1) as n = 4 here. 

Thus, Option B. 

Question 9
A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (the lowest priority). The scheduler re-evaluates the process priorities every T time units and decides the next process to schedule. Which one of the following is TRUE if the processes have no I/O operations and all arrive at time zero?
Cross
This algorithm is equivalent to the first-come-first-serve algorithm
Tick
This algorithm is equivalent to the round-robin algorithm.
Cross
This algorithm is equivalent to the shortest-job-first algorithm..
Cross
This algorithm is equivalent to the shortest-remaining-time-first algorithm


Question 9-Explanation: 
The scheduling algorithm works as round robin with quantum time equals to T. After a process\'s turn comes and it has executed for T units, its waiting time becomes least and its turn comes again after every other process has got the token for T units.
Question 10
Match the problem domains in GROUP I with the solution technologies in GROUP II
GROUP I                                         GROUP II
(P) Service oriented computing                 (1) Interoperability
(Q) Heterogeneous communicating systems        (2) BPMN
(R) Information representation                 (3) Publish-find-bind
(S) Process description                        (4) XML 
Cross
P-1, Q-2, R-3, S-4
Cross
P-3, Q-4, R-2, S-1
Tick
P-3, Q-1, R-4, S-2
Cross
P-4, Q-3, R-2, S-1


Question 10-Explanation: 
The answer can be easily guessed with XML. XML is used for information representation.
There are 59 questions to complete.

  • Last Updated : 11 Oct, 2021

Share your thoughts in the comments
Similar Reads