## GATE CS 2013

Question 1 |

^{2}+ y

^{2}. Which one of the following statements is TRUE about ?

Commutative but not associative | |

Both commutative and associative | |

Associative but not commutative | |

Neither commutative nor associative |

**GATE CS 2013**

**Set Theory & Algebra**

**Discuss it**

**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 :**[Tex]\oplus[/Tex] commutative as x[Tex]\oplus[/Tex]y is always same as y[Tex]\oplus[/Tex]x. [Tex]\oplus[/Tex] is not associative as (x[Tex]\oplus[/Tex]y)[Tex]\oplus[/Tex]z is (x^2 + y^2)^2 + z^2, but x[Tex]\oplus[/Tex](y[Tex]\oplus[/Tex]z) is x^2 + (y^2 + z^2)^2.

Question 2 |

8 / (2e ^{3}) | |

9 / (2e ^{3}) | |

17 / (2e ^{3}) | |

26 / (2e ^{3}) |

**GATE CS 2013**

**Probability**

**Discuss it**

PR(X < 3) = Pr(x = 0) + Pr(x = 1) + Pr(x = 2) = f(0, 3) + f(1, 3) + f(2, 3) Put [Tex]\lambda[/Tex] = 3 and k = 0, 1, 2 in the formula given at http://en.wikipedia.org/wiki/Poisson_distribution#Definition = 17 / (2e

^{3})

Question 3 |

A | |

B | |

C | |

D |

**GATE CS 2013**

**Linear Algebra**

**Discuss it**

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 |

This solution is contributed by **Anil Saikrishna Devarasetty** .

Question 4 |

-256 | |

-128 | |

-127 | |

0 |

**GATE CS 2013**

**Number Representation**

**Discuss it**

^{(n-1)}) to +(2

^{(n-1)}-1)

Question 5 |

Priority encoder | |

Decoder | |

Multiplexer | |

Demultiplexer |

**GATE CS 2013**

**Digital Logic & Number representation**

**Discuss it**

Question 6 |

O(log n) | |

O(n) | |

O(nLogn) | |

O(n^2) |

**GATE CS 2013**

**Discuss it**

Question 7 |

O(1) | |

O(Logn) | |

O(n) | |

O(nLogn) |

**GATE CS 2013**

**Discuss it**

To insert 50, we will have to traverse all nodes. 10 \ 20 \ 30 \ 40

Question 8 |

A | |

B | |

C | |

D |

**GATE CS 2013**

**Regular languages and finite automata**

**Discuss it**

Question 9 |

n/2 | |

n-1 | |

2n-1 | |

2 ^{n} |

**GATE CS 2013**

**Parsing and Syntax directed translation**

**Discuss it**

S->aB B->bC C->cdThe 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 does't produce unit or epsilon productions,

S->abA A-> cdThe 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 as maximum, which is ( n - 1) as n = 4 here. Thus, Option B.

Question 10 |

This algorithm is equivalent to the first-come-first-serve algorithm | |

This algorithm is equivalent to the round-robin algorithm. | |

This algorithm is equivalent to the shortest-job-first algorithm.. | |

This algorithm is equivalent to the shortest-remaining-time-first algorithm |

**GATE CS 2013**

**CPU Scheduling**

**Discuss it**

Question 11 |

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

P-1, Q-2, R-3, S-4 | |

P-3, Q-4, R-2, S-1 | |

P-3, Q-1, R-4, S-2 | |

P-4, Q-3, R-2, S-1 |

**GATE CS 2013**

**Software Engineering**

**Discuss it**

Question 12 |

TCP, UDP, UDP and TCP | |

UDP, TCP, TCP and UDP | |

UDP, TCP, UDP and TCP | |

TCP, UDP, TCP and UDP |

**GATE CS 2013**

**Transport Layer**

**Discuss it**

Question 13 |

Encryption: X’s private key followed by Y’s private key; Decryption: X’s public key followed by Y’s public key | |

Encryption: X’s private key followed by Y’s public key; Decryption: X’s public key followed by Y’s private key | |

Encryption: X’s public key followed by Y’s private key; Decryption: Y’s public key followed by X’s private key | |

Encryption: X’s private key followed by Y’s public key; Decryption: Y’s private key followed by X’s public key |

**GATE CS 2013**

**Network Security**

**Discuss it**

Question 14 |

Network layer – 4 times and Data link layer – 4 times | |

Network layer – 4 times and Data link layer – 3 times | |

Network layer – 4 times and Data link layer – 6 times | |

Network layer – 2 times and Data link layer – 6 times |

**GATE CS 2013**

**Network Layer**

**Discuss it**

Question 15 |

it is on a set of fields that form a candidate key. | |

it is on a set of fields that include the primary key. | |

the data records of the file are organized in the same order as the data entries of the index. | |

the data records of the file are organized not in the same order as the data entries of the index. |

**GATE CS 2013**

**File structures (sequential files, indexing, B and B+ trees)**

**Discuss it**

Question 16 |

X: P(a)P(b)P(c) Y: P(b)P(c)P(d) Z: P(c)P(d)P(a) | |

X: P(b)P(a)P(c) Y: P(b)P(c)P(d) Z: P(a)P(c)P(d) | |

X: P(b)P(a)P(c) Y: P(c)P(b)P(d) Z: P(a)P(c)P(d) | |

X: P(a)P(b)P(c) Y: P(c)P(b)P(d) Z: P(c)P(d)P(a) |

**Process Management**

**GATE CS 2013**

**Discuss it**

Question 17 |

1. For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine. 2. Turing recognizable languages are closed under union and complementation. 3. Turing decidable languages are closed under intersection and complementation. 4. Turing recognizable languages are closed under union and intersection.

1 and 4 only | |

1 and 3 only | |

2 only | |

3 only |

**GATE CS 2013**

**Recursively enumerable sets and Turing machines**

**Discuss it**

Question 18 |

1. The problem of determining whether there exists a cycle in an undirected graph is in P. 2. The problem of determining whether there exists a cycle in an undirected graph is in NP. 3. If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A.

1, 2 and 3 | |

1 and 2 only | |

2 and 3 only | |

1 and 3 only |

**NP Complete**

**GATE CS 2013**

**Discuss it**

Question 19 |

A | |

B | |

C | |

D |

**GATE CS 2013**

**Discuss it**

Question 20 |

(j mod v) * k to (j mod v) * k + (k-1) | |

(j mod v) to (j mod v) + (k-1) | |

(j mod k) to (j mod k) + (v-1) | |

(j mod k) * v to (j mod k) * v + (v-1) |

**GATE CS 2013**

**Computer Organization and Architecture**

**Discuss it**

Question 21 |

xy + x' y' | |

x ^ y' where ^ is XOR | |

x' ^ y where ^ is XOR | |

x' ^ y' where ^ is XOR |

**GATE CS 2013**

**Digital Logic & Number representation**

**Discuss it**

Question 22 |

A | |

B | |

C | |

D |

**GATE CS 2013**

**Numerical Methods and Calculus**

**Discuss it**

Question 23 |

8.983 | |

9.003 | |

9.017 | |

9.045 |

**GATE CS 2013**

**Numerical Methods and Calculus**

**Discuss it**

**Anil Saikrishna Devarasetty**

Question 24 |

1/8 | |

1 | |

7 | |

8 |

**GATE CS 2013**

**Graph Theory**

**Discuss it**

Question 25 |

P: Number of odd degree vertices is even. Q: Sum of degrees of all vertices is even.

P only | |

Q only | |

Both P and Q | |

Neither P nor Q |

**GATE CS 2013**

**Graph Theory**

**Discuss it**

Question 26 |

(P) The line graph of a cycle is a cycle. (Q) The line graph of a clique is a clique. (R) The line graph of a planar graph is planar. (S) The line graph of a tree is a tree.

P only | |

P and R only | |

R only | |

P, Q and S only |

**GATE CS 2013**

**Graph Theory**

**Discuss it**

Question 27 |

A | |

B | |

C | |

D |

**GATE CS 2013**

**Propositional and First Order Logic.**

**Discuss it**

F(x) ==> x is my friend P(x) ==> x is perfect D is the correct answer. A. There exist some friends which are not perfect B. There are some people who are not my friend and are perfect C. There exist some people who are not my friend and are not perfect. D. There doesn't exist any person who is my friend and perfect

Question 28 |

MBR ← PC MAR ← X PC ← Y Memory ← MBRWhich one of the following is a possible operation performed by this sequence?

Instruction fetch | |

Operand fetch | |

Conditional branch | |

Initiation of interrupt service |

**GATE CS 2013**

**Computer Organization and Architecture**

**Discuss it**

Question 29 |

1281 | |

1282 | |

1283 | |

1284 |

**Input Output Systems**

**GATE CS 2013**

**Discuss it**

42797KB will take 85512 sectors (42797*1024 bytes / 512 bytes) Since there are 64 sectors per surface, 85512/64 = 1337.406 sectors are required, so we take 1338 sectors these sectors are distributed among 16 surfaces, so 1338/16 = 83.58 cylinders will be required. So the final ans will be 84+1200 = 1284. one more fact to be noted is that the file occupies 83.58 cylinders, but the 0.58 cannot be accommodated in the first one (the file storage starts from <1200,9,40>). Hence, the file will be extended to 194 (85594-85400) more bytes of cylinder 1284.

Question 31 |

int unknown(int n) { int i, j, k = 0; for (i = n/2; i <= n; i++) for (j = 2; j <= n; j = j * 2) k = k + n/2; return k; }

(A)

(B)

(C)

(D)

A | |

B | |

C | |

D |

**GATE CS 2013**

**Discuss it**

for (i = n/2; i <= n; i++) for (j = 2; j <= n; j = j * 2) k = k + n/2; return k;The outer loop runs n/2 times The inner loop runs logn times.(2^k = n => k = logn). Now looking at the value of k in inner loop, n is added to k, logn times as the inner loop is running logn times. Therefore the value of k after running the inner loop one time is n*logn. Therefore total time complexity is inner multiplied with outer loop complexity which (n for outer and nlogn for inner) n^2logn. See http://geeksquiz.com/algorithms-analysis-of-algorithms-question-5/ This solution is contributed by

**Parul Sharma.**

Question 32 |

L2 is context-free. | |

L1 intersection L2 is context-free. | |

Complement of L2 is recursive. | |

Complement of L1 is context-free but not regular. |

**GATE CS 2013**

**Context free languages and Push-down automata**

**Discuss it**

**(A)**L2 is context free, which is true [CORRECT]

**(B)**L1 intersection L2 is context free, which is again true because L1 is a regular language and L2 is a CFL. RL union CFL is always a CFL. Hence [CORRECT]

**(C)**Complement of L2 is recursive, which is true due to the fact that complement of a CFL is CSL for sure (Context sensitive language), which in turn (CSL) is a subset of recursive languages. Hence [CORRECT]

**(D)**Complement of L1 is context free but not regular, which is false due to closure laws of regular languages. Complement of a RL is always a RL. Hence [INCORRECT] This solution is contributed by

**Vineet Purswani**.

Question 33 |

1. Complement of L(A) is context-free. 2. L(A) = L((11*0+0)(0 + 1)*0*1*) 3. For the language accepted by A, A is the minimal DFA. 4. A accepts all strings over {0, 1} of length at least 2.

1 and 3 only | |

2 and 4 only | |

2 and 3 only | |

3 and 4 only |

**GATE CS 2013**

**Regular languages and finite automata**

**Discuss it**

Question 34 |

-2 | |

-1 | |

1 | |

2 |

**Process Management**

**GATE CS 2013**

**Discuss it**

**Background Explanation:**A critical section in which the process may be changing common variables, updating table, writing a file and perform another function. The important problem is that if one process is executing in its critical section, no other process is to be allowed to execute in its critical section. Each process much request permission to enter its critical section. A semaphore is a tool for synchronization and it is used to remove the critical section problem which is that no two processes can run simultaneously together so to remove this two signal operations are used named as wait and signal which is used to remove the mutual exclusion of the critical section. as an unsigned one of the most important synchronization primitives, because you can build many other Decrementing the semaphore is called acquiring or locking it, incrementing is called releasing or unlocking.

**Solution :**Since initial value of semaphore is 2, two processes can enter critical section at a time- this is bad and we can see why. Say, X and Y be the processes.X increments x by 1 and Z decrements x by 2. Now, Z stores back and after this X stores back. So, final value of x is 1 and not -1 and two Signal operations make the semaphore value 2 again. So, now W and Z can also execute like this and the value of x can be 2 which is the maximum possible in any order of execution of the processes. (If the semaphore is initialized to 1, processed would execute correctly and we get the final value of x as -2.) Option (D) is the correct answer.

**Another Solution:**Processes can run in many ways, below is one of the cases in which x attains max value Semaphore S is initialized to 2 Process W executes S=1, x=1 but it doesn't update the x variable. Then process Y executes S=0, it decrements x, now x= -2 and signal semaphore S=1 Now process Z executes s=0, x=-4, signal semaphore S=1 Now process W updates x=1, S=2 Then process X executes X=2 So correct option is D

**Another Solution:**S is a counting semaphore initialized to 2 i.e., Two process can go inside a critical section protected by S. W, X read the variable, increment by 1 and write it back. Y, Z can read the variable, decrement by 2 and write it back. Whenever Y or Z runs the count gets decreased by 2. So, to have the maximum sum, we should copy the variable into one of the processes which increases the count, and at the same time the decrementing processed should run parallel, so that whatever they write back into memory can be overridden by incrementing process. So, in effect decrement would never happen.

Related Links: http://quiz.geeksforgeeks.org/process-synchronization-set-1/ http://geeksquiz.com/operating-systems-process-management-question-11/ for explanation This solution is contributed by

**Nitika Bansal**

Question 35 |

Students(Which of the following queries are equivalent to this query in English?rollno: integer, sname: string) Courses(courseno: integer, cname: string) Registration(rollno: integer, courseno: integer, percent: real)

"Find the distinct names of all students who score more than 90% in the course numbered 107"

I, II, III and IV | |

I, II and III only | |

I, II and IV only | |

II, III and IV only |

**GATE CS 2013**

**ER and Relational Models**

**Discuss it**

Option A: This is a SQL query expression. It first perform a cross product of Students and Registration, then WHERE clause only keeps those rows in the cross product set where the student is registered for course no 107, and percentage is > 90. Then select distinct statement gives the distinct names of those students as the result set.

Option B: This is a relational algebra expression. It first perform a NATURAL JOIN of Students and Registration (NATURAL JOIN implicitly joins on the basis of common attribute, which here is rollno ), then the select operation( sigma) keeps only those rows where the student is registered for courseno 107, and percentage is > 90. And then the projection operation (pi) projects only distinct student names from the set. Note: Projection operation (pi) always gives the distinct result.

Option C: This is a Tuple Relational Calculus (TRC) language expression, It is not a procedural language (i.e. it only tells “what to do”, not “how to do”). It just represents a declarative mathematical expression. Here T is a Tuple variable. From left to right, it can be read like this, “It is a set of tuples T, where, there exists a tuple S in Relation Students, and there exist a tuple R in relation Registration, such that S.rollno = R.rollno AND R.couseno = 107 AND R.percent > 90 AND T.sname = S.sname”. And the schema of this result is (sname), i.e. each tuple T will contain only student name, because only T.sname has been defined in the expression. As TRC is a mathematical expression, hence it is expected to give only distinct result set.

Option D: This is a Domain Relational Calculus (DRC) language expression. This is also not procedural. Here SN is a Domain Variable. It can be read from left to right like this “The set of domain variable SN, where, there exist a domain variable SR , and a domain variable Rp, such that, SN and SR domain variables is in relation Students and SR,107,RP is a domain variables set in relation Registration, AND RP > 90 “ Above, SN represents sname domain attribute in Students relation, SR represents rollno domain attribute in Students relation, and RP represents percentage domain attribute in Registration relation. The schema for the result set is (SN), i.e. only student name. As DRC is a mathematical expression, hence it is expected to give only distinct result set.

Question 36 |

1 | |

2 | |

2.5 | |

5 |

**Data Link Layer**

**GATE CS 2013**

**Discuss it**

Data should be transmitted at the rate of 500 Mbps. Transmission Time >= 2*Propagation Time => 10000/(500*1000000) <= 2*length/200000 => lenght = 2km (max) so, answer will be: (B) 2km

Question 37 |

Last fragment, 2400 and 2789 | |

First fragment, 2400 and 2759 | |

Last fragment, 2400 and 2759 | |

Middle fragment, 300 and 689 |

**GATE CS 2013**

**Network Layer**

**Discuss it**

Question 38 |

There is no change. | |

Average cohesion goes up but coupling is reduced. | |

Average cohesion goes down and coupling also reduces. | |

Average cohesion and coupling increase. |

**GATE CS 2013**

**Software Engineering**

**Discuss it**

Coupling between M1 and M2 = (Number of external links) / (Number of modules) = 2/2 = 1 Cohesion of a module = (Number of internal links) / (Number of methods) Cohesion of M1 = 8/4 = 2 Cohesion of M2 = 6/3 = 2 After moving method m to M2, we get following Coupling = 2/2 = 1 Cohesion of M1 = 6/3 = 2 Cohesion of M2 = 8/4 = 2

Question 39 |

Which one of the following represents the CORRECT implementations of ExitX and EntryY?Process X:Process Y:private i; private i; for (i=0; i < n; i++) { for (i=0; i < n; i++) { a[i] = f(i); EntryY(R, S); ExitX(R, S); b[i]=g(a[i]); } }

**(A)**

ExitX(R, S) { P(R); V(S); } EntryY (R, S) { P(S); V(R); }

**(B)**

ExitX(R, S) { V(R); V(S); } EntryY(R, S) { P(R); P(S); }

**(C)**

ExitX(R, S) { P(S); V(R); } EntryY(R, S) { V(S); P(R); }

**(D)**

ExitX(R, S) { V(R); P(S); } EntryY(R, S) { V(S); P(R); }

A | |

B | |

C | |

D |

**Process Management**

**GATE CS 2013**

**Discuss it**

The purpose here is neither the deadlock should occur nor the binary semaphores be assigned value greater than one. A leads to deadlock B can increase value of semaphores b/w 1 to n D may increase the value of semaphore R and S to 2 in some casesSee http://geeksquiz.com/operating-systems-process-management-question-13/

Question 40 |

X -> c.X, c/d X -> .cX, c/d X -> .d, c/d X -> c.X, $ X -> .cX, $ X -> .d, $Which of the following statements related to merging of the two sets in the corresponding LALR parser is/are FALSE?

1. Cannot be merged since look aheads are different. 2. Can be merged but will result in S-R conflict. 3. Can be merged but will result in R-R conflict. 4. Cannot be merged since goto on c will lead to two different sets.

1 only | |

2 only | |

1 and 4 only | |

1, 2, 3, and 4 |

**GATE CS 2013**

**Parsing and Syntax directed translation**

**Discuss it**

X -> c.X, c/d X -> .cX, c/d X -> .d, c/d and X -> c.X, $ X -> .cX, $ X -> .d, $The symbols/terminals after the comma are Look-Ahead symbols. These are the sets of LR(1) ( LR(1) is also called CLR(1) ) items. The LALR(1) parser combines those set of LR(1) items which are identical with respect to their 1st component but different with respect to their 2nd component. In a production rule of a LR(1) set of items, ( A -> B , c ) , A->B is the 1st component , and the Look-Ahead set of symbols, which is c here, is the second component. Now we can see that in the sets given, 1st component of the corresponding production rule is identical in both sets, and they only differ in 2nd component ( i.e. their look-ahead symbols) hence we can combine these sets to make a a single set which would be :

X -> c.X, c/d/$ X -> .cX, c/d/$ X -> .d, c/d/$This is done to reduce the total number of parser states. Now we can check the statements given. Statement 1 : The statement is false, as merging has been done because 2nd components i.e. look-ahead were different. Statement 2 : In the merged set, we can't see any Shift-Reduce conflict ( because no reduction even possible, reduction would be possible when a production of form P -> q. is present) Statement 3 : In the merged set, we can't see any Reduce-Reduce conflict ( same reason as above, no reduction even possible, so no chances of R-R conflict ) Statement 4: This statement is also wrong, because goto is carried on Non-Terminals symbols, not on terminal symbols, and c is a terminal symbol. Thus, all statements are wrong, hence option D.

Question 41 |

3 only | |

3 and 4 only | |

1, 2 and 3 only | |

2 and 3 only |

**GATE CS 2013**

**Undecidability**

**Discuss it**

- First is Emptiness for CFG.
- Second is everything for CFG.
- Third is Regularity for REC
- Fourth is equivalence for regular.

Question 42 |

int f(int &x, int c) { c = c - 1; if (c==0) return 1; x = x + 1; return f(x,c) * x; }

3024 | |

6561 | |

55440 | |

161051 |

**GATE CS 2013**

**Discuss it**

Question 43 |

10, 20, 15, 23, 25, 35, 42, 39, 30 | |

15, 10, 25, 23, 20, 42, 35, 39, 30 | |

15, 20, 10, 23, 25, 42, 35, 39, 30 | |

15, 10, 23, 25, 20, 35, 42, 39, 30 |

**GATE CS 2013**

**Discuss it**

**Parul sharma.**

Question 44 |

MultiDequeue(Q){ m = k while (Q is not empty and m > 0) { Dequeue(Q) m = m - 1 } }What is the worst case time complexity of a sequence of n MultiDequeue() operations on an initially empty queue? (GATE CS 2013)

(A) (B) (C) (D)

A | |

B | |

C | |

D |

**Queue**

**GATE CS 2013**

**Discuss it**

Question 45 |

132 | |

165 | |

176 | |

328 |

**GATE CS 2013**

**Computer Organization and Architecture**

**Discuss it**

Pipeline will have to be stalled till Ei stage of l4 completes, as Ei stage will tell whether to take branch or not. After that l4(WO) and l9(Fi) can go in parallel and later the following instructions. So, till l4(Ei) completes : 7 cycles * (10 + 1 ) ns = 77ns From l4(WO) or l9(Fi) to l12(WO) : 8 cycles * (10 + 1)ns = 88ns Total = 77 + 88 = 165 ns

Question 46 |

4 | |

5 | |

6 | |

7 |

**GATE CS 2013**

**Computer Organization and Architecture**

**Discuss it**

RAM chip size = 1k ×8[1024 words of 8 bits each] RAM to construct =16k ×16 Number of chips required = (16k x 16)/ ( 1k x 8) = (16k x 2) [16 chips vertically with each having 2 chips horizontally] So to select one chip out of 16 vertical chips, we need 4 x 16 decoder. Available decoder is 2 x 4 decoder To be constructed is 4 x 16 decoder Hence 4 + 1 = 5 decoders are required.

Question 47 |

A | |

B | |

C | |

D |

**GATE CS 2013**

**Propositional and First Order Logic.**

**Discuss it**

**¬ ∃ x ( ∀y(α) ∧ ∀z(β) )**

where ¬ is a negation operator, ∃ is Existential Quantifier with the meaning ofNow we need to use these results as shown below:"there Exists", and ∀ is a Universal Quantifier with the meaning" for all ", and α, β can be treated as predicates. here we can apply some of the standard results of Propositional and 1st order logic on the given statement, which are as follows : [Result 1: ¬(∀x P(x)) <=> ∃ x¬P(x), i.e. negation of "for all" gives "there exists" and negation also gets applied to scope of quantifier, which is P(x) here. And also negation of "there exists" gives "for all", and negation also gets applied to scope of quantifier ] [Result 2: ¬ ( A ∧ B ) = ( ¬A ∨ ¬B ) ] [Result 3: ¬P ∨ Q <=> P -> Q ] [Result 4: If P ->Q, then by Result of Contrapositive, ¬Q -> ¬P ]

¬ ∃ x ( ∀y(α) ∧ ∀z(β) ) [ Given ] => ∀ x (¬∀y(α) ∨ ¬∀z(β) ) [ after applyingHence, the correct answer is Option A and Option D. But in GATE 2013, marks were given to all for this question.Result 1&Result 2] => ∀ x ( ∀y(α) -> ¬∀z(β) ) [after applyingResult 3] =>∀ x ( ∀y(α) -> ∃z(¬β) )[after applyingResult 1] which is same as the statement C. Hence the Given Statement is logically Equivalent to the statement C. Now, we can also prove that given statement is logically equivalent to the statement in option B. Let's see how ! The above derived statement is : ∀ x ( ∀y(α) -> ∃z(¬β) ) Now this statement can be written as (or equivalent to) :=> ∀ x ( ∀z(β) -> ∃y(¬α) )[after applyingResult 4] And this statement is same as statement B. Hence the Given statement is also logically equivalent to the statement B. So, we can conclude that the Given statement isNOTlogically equivalent to the statementsAandD.

Question 48 |

c = a + b; d = c * a; e = c + a; x = c * c; if (x > a) { y = a * a; } else { d = d * d; e = e * e; }Suppose the instruction set architecture of the processor has only two registers. The only allowed compiler optimization is code motion, which moves statements from one place to another while preserving correctness. What is the minimum number of spills to memory in the compiled code?

0 | |

1 | |

2 | |

3 |

**GATE CS 2013**

**Computer Organization and Architecture**

**Discuss it**

r1......r2 a.......b......c = a + b a.......c......x = c * c a.......x......but we will have to store c in mem as we don't know if x > a ................. or not y.......x......y = a * a choosing the best case of x > a , min spills = 1

Question 49 |

3 | |

4 | |

5 | |

6 |

**GATE CS 2013**

**Computer Organization and Architecture**

**Discuss it**

**Namita Singh.**

Question 50 |

void find_and_replace(char *A, char *oldc, char *newc) { for (int i = 0; i < 5; i++) for (int j = 0; j < 3; j++) if (A[i] == oldc[j]) A[i] = newc[j]; }The procedure is tested with the following four test cases (1) oldc = "abc", newc = "dab" (2) oldc = "cde", newc = "bcd" (3) oldc = "bca", newc = "cda" (4) oldc = "abc", newc = "bac" The tester now tests the program on all input strings of length five consisting of characters ‘a’, ‘b’, ‘c’, ‘d’ and ‘e’ with duplicates allowed. If the tester carries out this testing with the four test cases given above, how many test cases will be able to capture the flaw?

Only one | |

Only Two | |

Only Three | |

All Four |

**GATE CS 2013**

**Discuss it**

Question 51 |

None | |

2 Only | |

3 and 4 only | |

4 only |

**GATE CS 2013**

**Discuss it**

Question 52 |

2 | |

4 | |

8 | |

16 |

**GATE CS 2013**

**Discuss it**

Question 53 |

2 | |

4 | |

8 | |

16 |

**GATE CS 2013**

**Discuss it**

Question 54 |

3 | |

4 | |

5 | |

6 |

**GATE CS 2013**

**Database Design(Normal Forms)**

**Discuss it**

Question 55 |

in 1NF, but not in 2NF. | |

in 2NF, but not in 3NF. | |

in 3NF, but not in BCNF. | |

in BCNF |

**GATE CS 2013**

**Database Design(Normal Forms)**

**Discuss it**

Question 56 |

**Nadir**

Highest | |

Lowest | |

Medium | |

Integration |

**GATE CS 2013**

**English**

**Discuss it**

Question 57 |

specificity | |

neutrality | |

generality | |

adaptation |

**GATE CS 2013**

**English**

**Discuss it**

Question 58 |

502 | |

504 | |

506 | |

500 |

**GATE CS 2013**

**General Aptitude**

**Discuss it**

Question 59 |

would fly | |

shall fly | |

should fly | |

shall have flown |

**GATE CS 2013**

**English**

**Discuss it**

**would fly**in the sky. See http://grammar.ccc.commnet.edu/grammar/conditional2.htm

Question 60 |

He is of Asian origin. | |

They belonged to Africa. | |

She is an European. | |

They migrated from India to Australia. |

**GATE CS 2013**

**English**

**Discuss it**

Question 61 |

7 | |

8 | |

9 | |

10 |

**GATE CS 2013**

**General Aptitude**

**Discuss it**

Question 62 |

13/90 | |

12/90 | |

78/90 | |

77/90 |

**GATE CS 2013**

**Probability**

**Discuss it**

Question 63 |

Failure is the pillar of success. | |

Honesty is the best policy. | |

Life begins and ends with adventures. | |

No adversity justifies giving up hope. |

**GATE CS 2013**

**English**

**Discuss it**

Question 64 |

36 | |

30 | |

24 | |

18 |

**GATE CS 2013**

**General Aptitude**

**Discuss it**

Question 65 |

16,500 | |

15,180 | |

11,000 | |

10,120 |

**GATE CS 2013**

**Discuss it**