# GATE CS 2013

• Last Updated : 11 Oct, 2021

 Question 1
A binary operation on a set of integers is defined as x y = x2 + y2. Which one of the following statements is TRUE about ?
 A Commutative but not associative B Both commutative and associative C Associative but not commutative D Neither commutative nor associative
GATE CS 2013    Set Theory & Algebra
Discuss it

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 : commutative as x y is always same as y x. is not associative as (x y) z is (x^2 + y^2)^2 + z^2, but x (y z) is x^2 + (y^2 + z^2)^2.
 Question 2

Which one of the following does NOT equal to  A D B C C B D A
GATE CS 2013    Linear Algebra
Discuss it

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
 A -256 B -128 C -127 D 0
GATE CS 2013    Number Representation
Discuss it

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. What function does the truth table represent?
 A Priority encoder B Decoder C Multiplexer D Demultiplexer
GATE CS 2013    Digital Logic & Number representation    Combinational Circuits
Discuss it

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?
 A O(log n) B O(n) C O(nLogn) D O(n^2)
GATE CS 2013
Discuss it

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?
 A O(1) B O(Logn) C O(n) D O(nLogn)
GATE CS 2013
Discuss it

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 = and L2 = {a}. Which one of the following represents L1 L2* U L1*


 A {[Tex]epsilon [/Tex]} B [Tex]phi [/Tex] C a* D {[Tex]epsilon [/Tex],a}
GATE CS 2013    Regular languages and finite automata
Discuss it

Question 7 Explanation:

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

 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?

 A n/2 B n-1 C 2n-1 D 2n
GATE CS 2013    Parsing and Syntax directed translation
Discuss it

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?
 A This algorithm is equivalent to the first-come-first-serve algorithm B This algorithm is equivalent to the round-robin algorithm. C This algorithm is equivalent to the shortest-job-first algorithm.. D This algorithm is equivalent to the shortest-remaining-time-first algorithm
GATE CS 2013    OS CPU Scheduling
Discuss it

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 
 A P-1, Q-2, R-3, S-4 B P-3, Q-4, R-2, S-1 C P-3, Q-1, R-4, S-2 D P-4, Q-3, R-2, S-1
GATE CS 2013    Software Engineering
Discuss it

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