## GATE-CS-2014-(Set-3)

Please wait while the activity loads.

If this activity does not load, try refreshing your browser. Also, this page requires javascript. Please visit using a browser with javascript enabled.

If this activity does not load, try refreshing your browser. Also, this page requires javascript. Please visit using a browser with javascript enabled.

Question 1 |

While trying to collect(I) an envelope from under the table (II), Mr. X fell down (III) and was losing consciousness (IV)
Which one of the above underlined parts of the sentence is NOT appropriate?

I | |

II | |

III | |

IV |

**English**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 1 Explanation:

Here, part IV is incorrect. "was losing consciousness" shows continuous process of losing consciousness, but he was not in the process, rather he just lost consciousness.
So, the correction is " was losing consciousness " → " lost consciousness ".

Thus, IV is the correct choice.

Please comment below if you find anything wrong in the above post.

Thus, IV is the correct choice.

Please comment below if you find anything wrong in the above post.

Question 2 |

If she _______________ how to calibrate the instrument, she _______________ done the experiment.

knows, will have | |

knew, had | |

had known, could have | |

should have known, would have |

**English**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 2 Explanation:

A)knows, will have //Present ,future
B)knew, had //past past
c)had known, could have//

source: http://www.edufind.com/english-grammar/type-3-conditional/

**past perfect,perfect conditional**D)should have known, would have //present,future In a Type 3 conditional sentence, the tense in the 'if' clause is the past perfect, and the tense in the main clause is the perfect conditional or the perfect continuous conditional.If clause (condition) | Main clause (result) |
---|---|

If + past perfect |
perfect conditional or perfect continuous conditional |

If this thing had happened | that thing would have happened. |

Question 3 |

Choose the word that is opposite in meaning to the word “coherent”.

sticky | |

well-connected | |

rambling | |

friendly |

**English**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 3 Explanation:

Coherent - Adj.
Meaning - (of an argument, theory, or policy) logical and consistent.
Rambling - Adj.
Meaning - (of writing or speech) lengthy and confused or inconsequential.
Hence both are opposite to each other.
For synonyms and more example sentences visit :
http://www.oxforddictionaries....

Question 4 |

Which number does not belong in the series below?
2, 5, 10, 17, 26, 37, 50, 64

17 | |

37 | |

64 | |

26 |

**General Aptitude**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 4 Explanation:

Given series is 2,5,10,17,26,37,50,64. Here total number of terms are 8..i.e. A(1) to A(8). For the 1st 7 terms, you can observe the relationship between the terms which is A(n) = [ A(n-1) - {A(n-1) + A(n-2)} + 2 ] where n >= 3 Now for the 8th term i.e. A(8), this relationship violates. According to the relationship, A(8) = [A(7) + {A(7) - A(6)} + 2 ] = [50 + {50 - 37} + 2 ] = 50 + 13 + 2 = 65. But in the series it is 64. Hence 64 doesn't belong to the series.

Question 5 |

The table below has question-wise data on the performance of students in an examination. The marks for each question are also listed. There is no negative or partial marking in the examination.
What is the average of the marks obtained by the class in the examination

1.34 | |

1.74 | |

3.02 | |

3.91 |

**General Aptitude**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 5 Explanation:

As you can see from each row that the total number of students in the class are 44. Now we have to find the total number of marks obtained by the class. Marks are given for correct answers only. No negative or partial marking. For 1st question total marks obtained are : 2*21 = 42 For 2nd question total marks obtained are : 3*15 = 45 For 3rd question total marks obtained are : 2*23 = 46 hence total marks obtained by the class are = 42+45+46 = 133 Now, Average marks obtained = Total Marks/Total no of students = 133/44 = 3.02 Hence C is the answer.

Question 6 |

A dance programme is scheduled for 10.00 a.m. Some students are participating in the programme and they need to come an hour earlier than the start of the event. These students should be accompanied by a parent. Other students and parents should come in time for the programme. The instruction you think that is appropriate for this is

Students should come at 9.00 a.m. and parents should come at 10.00 a.m. | |

Participating students should come at 9.00 a.m. accompanied by a parent, and other parents and students should come by 10.00 a.m. | |

Students who are not participating should come by 10.00 a.m. and they should not bring their parents. Participating students should come at 9.00 a.m. | |

Participating students should come before 9.00 a.m. Parents who accompany them should come at 9.00 a.m. All others should come at 10.00 a.m. |

**General Aptitude**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 6 Explanation:

- A is not the appropriate instruction as only the participating students and their parents have to come at 9.00 a.m. and other students along with their parents have to come at 10.00 a.m., while the statement in A says that all students should come at 9.00 a.m. and all the parents should come at 10.00 a.m.
**B is the appropriate instruction and covers all the aspects of the information to be conveyed.**- C is not the appropriate instruction as the non participating students have to come at 10.00 a.m. with their parents, while the statement in B says that these students have to come without their parents.
- D is not the appropriate instruction as it states that the participating students have to come before 9.00 a.m. whereas they have to come at 9.00 a.m.

**So B is Correct option.**

Question 7 |

By the beginning of the 20th century, several hypotheses were being proposed, suggesting a paradigm shift in our understanding of the universe. However, the clinching evidence was provided by experimental measurements of the position of a star which was directly behind our sun. Which of the following inference(s) may be drawn from the above passage?

(i) Our understanding of the universe changes based on the positions of stars (ii) Paradigm shifts usually occur at the beginning of centuries (iii) Stars are important objects in the universe (iv) Experimental evidence was important in confirming this paradigm shift

(i), (ii) and (iv) | |

(iii) only | |

(i) and (iv) | |

(iv) only |

**General Aptitude**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 7 Explanation:

Paradigm shift means a fundamental change in approach to something or change in the underlying assumptions in relation to something. This change, as per the question, was verified with the experimental measurements of the position of a star that was behind the sun.
(i) is incorrect as it generalizes the experimental evidence of the star and assumes it to be always true, which may not be the case every time.
(ii) is also incorrect. If there was a paradigm shift at the beginning of the 20th century, it does not necessarily means that all paradigm shifts usually occur at the beginning of centuries.
(iii) is incorrect as it again generalizes an experimental statement. Stars proved to be important in the given case does not necessarily imply that they would be important every time.
(iv) is correct as it is clearly understood from the given case conditions that this experimental measurements provided a clinching (solid/concrete) evidence to our understanding of the universe.
So, D is the correct choice as only (iv) is the correct statement.
Please comment below if you find anything wrong in the above post.

Question 8 |

The Gross Domestic Product (GDP) in Rupees grew at 7% during 2012-2013. For international comparison, the GDP is compared in US Dollars (USD) after conversion based on the market exchange rate. During the period 2012-2013 the exchange rate for the USD increased from Rs. 50/ USD to Rs. 60/ USD. India’s GDP in USD during the period 2012-2013

increased by 5 % | |

decreased by 13% | |

decreased by 20% | |

decreased by 11% |

**General Aptitude**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 8 Explanation:

Suppose original GDP was x then its international value is x/50. Now GDP becomes 107*x/100 and its international value becomes (107x/100)/60= 107x/6000. The value has decreased by (x/50)-(107x/6000). Percentage approx 10.8% = 11%

Question 9 |

The ratio of male to female students in a college for five years is plotted in the following line graph. If the number of female students in 2011 and 2012 is equal, what is the ratio of male students in 2012 to male students in 2011?

1:1 | |

2:1 | |

1.5:1 | |

2.5:1 |

**General Aptitude**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 9 Explanation:

Number of female students in 2011 and 2012 are equal. Suppose they are x. Now, Males students in 2011 = Female students in 2011 = x (as the ratio is 1) And in 2012, Male students / Female students = 1.5(Given) Hence Male students in 2012 = 1.5 * Female students = 1.5 * x Now ratio of Male students in 2012 to Male students in 2011 = ( 1.5 * x ) / x = 1.5 / 1 i.e. 1.5 : 1 Hence C is the answer.

Question 10 |

Consider the equation: (7526)8 − (Y)8 = (4364)8 , where (X)N stands for X to the base N. Find Y.

1634 | |

1737 | |

3142 | |

3162 |

**General Aptitude**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 10 Explanation:

(X)N stands for X to the base N.
7526(8) - Y(8) = 4364(Y)
Base 8(Octal) uses digits 0 to 7.
Now Y(8) = 7526(8) - 4364(8)
The subtraction of octal numbers follows the same rules as the subtraction of numbers in any other number system. The only variation is in borrowed number. In the decimal system, you borrow a group of 10(10). In the binary system, you borrow a group of 2(10). In the octal system you borrow a group of 8(10).
Reference: http://www.tpub.com/neets/book13/53f.htm

Question 11 |

Consider the following statements:

P: Good mobile phones are not cheap Q: Cheap mobile phones are not good L: P implies Q M: Q implies P N: P is equivalent to QWhich one of the following about L, M, and N is CORRECT?

Only L is TRUE. | |

Only M is TRUE. | |

Only N is TRUE. | |

L, M and N are TRUE |

**General Aptitude**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 11 Explanation:

Let a and b be two proposition a: Good Mobile phones. b: Cheap Mobile Phones. P and Q can be written in logic as P: a-->~b Q: b-->~a. Truth Table a b ~a ~b P Q T T F F F F T F F T T T F T T F T T F F T T T T it clearly shows P and Q are equivalent. so option D is Correct

Question 12 |

Let X and Y be finite sets and f: X -> Y be a function. Which one of the following statements is TRUE?

A | |

B | |

C | |

D |

**Set Theory & Algebra**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 12 Explanation:

Let x = {a, b, c} and y = {1, 2} A Function f maps each element of x to 1 in y. f(a)=1 , f(b)=1 , f(c) =1 A = {a, b} B = {b, c} ---------------------------------------------- A ] | f(A u B) | = |f({a, b, c})| = 3 | f(A)|+|f(B)| = 2 + 2 = 4 , LHS != RHS. ---------------------------------------------- B ] f(A ∩ B) = f({b}) = { 1 } f(A) ∩ f(B) = {1, 1} ∩ {1, 1} = {1, 1} LHS != RHS ----------------------------------------------- C ] |f(A ∩ B)| = |f({b})| = |{ 1 }| = 1 min{|f(A)|,|f(B)|} = min(2,2) = 2 LHS != RHS ----------------------------------------------- D ] In a function a value can be mapped only to one value.

Question 13 |

Let G be a group with 15 elements. Let L be a subgroup of G. It is known that L != G and that the size of L is at least 4. The size of L is __________.

3 | |

5 | |

7 | |

9 |

**Set Theory & Algebra**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 13 Explanation:

This is according to Lagrange's theorem that states that the order of subgroup should divide the order of group. Subgroups of G can be of order 1,3,5 or 15 and according to the conditions and choices, B is the right answer.

Question 14 |

Which one of the following statements is TRUE about every

If the trace of the matrix is positive and the determinant of the matrix is negative, at least one of its eigenvalues is negative. | |

If the trace of the matrix is positive, all its eigenvalues are positive.
| |

If the determinant of the matrix is positive, all its eigenvalues are positive. | |

If the product of the trace and determinant of the matrix is positive, all its eigenvalues are positive. |

**Linear Algebra**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 15 |

If V1 and V2 are 4-dimensional subspaces of a 6-dimensional vector space V, then the smallest possible dimension of V1 ∩ V2 is ______.

1 | |

2 | |

3 | |

4 |

**Set Theory & Algebra**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 15 Explanation:

First, note that V1+V2 is still in V, so dim(V1+V2)≤ 6.
We know that
dim(V1+V2)=dimV1+dimV2−dim(V1∩V2).
So
6≥dim(V1+V2)=dimV1+dimV2−dim(V1∩V2)
dim(V1∩V2)≥4+4−6=2.
The answer is B.

Question 18 |

Consider the following combinational function block involving four Boolean variables x, y, a, b where x, a, b are inputs and y is the output.

f (x, y, a, b) { if (x is 1) y = a; else y = b; }Which one of the following digital logic blocks is the most suitable for implementing this function?

Full adder | |

Priority encoder | |

Multiplexer | |

Flip-flop |

**Digital Logic & Number representation**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 19 |

Consider the following processors (ns stands for nanoseconds). Assume that the pipeline registers have zero latency.

P1: Four-stage pipeline with stage latencies 1 ns, 2 ns, 2 ns, 1 ns. P2: Four-stage pipeline with stage latencies 1 ns, 1.5 ns, 1.5 ns, 1.5 ns. P3: Five-stage pipeline with stage latencies 0.5 ns, 1 ns, 1 ns, 0.6 ns, 1 ns. P4: Five-stage pipeline with stage latencies 0.5 ns, 0.5 ns, 1 ns, 1 ns, 1.1 ns.Which processor has the highest peak clock frequency?

P1 | |

P2 | |

P3 | |

P4 |

**Computer Organization and Architecture**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 19 Explanation:

Peak clock frequency = 1 / Maximum latency Maximum of latencies is minimum in P3 i.e. P1 : f= 1/2 = 0.5 GHz P2: f=1/1.5 = 0.67 GHz P4: f=1/1.1 GHz P3 : f=1/1 GHz =1 Thus P3 is be the right answerThis explanation has been contributed by

**Abhishek Kumar.**

Question 20 |

Let A be a square matrix of size n x n. Consider the following program. What is the expected output?

C = 100 for i = 1 to n do for j = 1 to n do { Temp = A[i][j] + C A[i][j] = A[j][i] A[j][i] = Temp - C } for i = 1 to n do for j = 1 to n do Output(A[i][j]);

The matrix A itself | |

Transpose of matrix A | |

Adding 100 to the upper diagonal elements and subtracting 100 from diagonal elements of A | |

None of the above |

**Array**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 20 Explanation:

If we take look at the inner statements of first loops, we can notice that the statements swap A[i][j] and A[j][i] for all i and j. Since the loop runs for all elements, every element A[l][m] would be swapped twice, once for i = l and j = m and then for i = m and j = l. Swapping twice means the matrix doesn’t change.
Source: http://www.geeksforgeeks.org/data-structures-algorithms-set-34/

Question 21 |

The minimum number of arithmetic operations required to evaluate the polynomial P(X) = X

^{5}+ 4X^{3}+ 6X + 5 for a given value of X using only one temporary variable.6 | |

7 | |

8 | |

9 |

**Misc**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 21 Explanation:

P(X) = xPlease comment below if you find anything wrong in the above post.^{5}+ 4x^{3}+ 6x + 5 =x ( x^{4}+ 4x^{2}+ 6 ) +5 =x ( x ( x^{3}+ 4x ) + 6 ) + 5 =x ( x ( x ( x^{2}+ 4 ) ) + 6 ) + 5 =x ( x ( x (x (x) + 4 ) ) + 6 ) + 5 Let T be a temporary variable to store intermediate results. 1. T = (x) * (x) 2. T = T + 4 3. T = (x) * (T) 4. T = (x) * (T) 5. T = T + 6 6. T = (x) * T 7. T = T + 5 Thus, we need 7 operations if we are to use only one temporary variable.

Question 22 |

Consider the following rooted tree with the vertex P labeled as root
The order in which the nodes are visited during in-order traversal is

SQPTRWUV | |

SQPTURWV | |

SQPTWUVR | |

SQPTRUWV |

**Tree Traversals**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 22 Explanation:

Algorithm Inorder(tree) - Use of Recursion Steps: 1. Traverse the left subtree, i.e., call Inorder(left-subtree) 2. Visit the root. 3. Traverse the right subtree, i.e., call Inorder(right-subtree) Understanding this algorithm requires the basic understanding of Recursion Therefore, We begin in the above tree with root as the starting point, which is P. # Step 1( for node P) : Traverse the left subtree of node or root P. So we have node Q on left of P. -> Step 1( for node Q) Traverse the left subtree of node Q. So we have node S on left of Q. * Step 1 (for node S) Now again traverse the left subtree of node S which is NULL here. * Step 2(for node S) Visit the node S, i.e print node S as the 1st element of inorder traversal. * Step 3(for node S) Traverse the right subtree of node S. Which is NULL here. Now move up in the tree to Q which is parent of S.( Recursion, function of Q called for function of S). Hence we go back to Q. -> Step 2( for node Q): Visit the node Q, i.e print node Q as the 2nd element of inorder traversal. -> Step 3 (for node Q) Traverse the right subtree of node Q. Which is NULL here. Now move up in the tree to P which is parent of Q.( Recursion, function of P called for function of Q). Hence we go back to P. # Step 2(for node P) Visit the node P, i.e print node S as the 3rd element of inorder traversal. # Step 3 (for node P) Traverse the right subtree of node P. Node R is at the right of P. Till now we have printed SQP as the inorder of the tree. Similarly other elements can be obtained by traversing the right subtree of P. The final correct order of Inorder traversal would be SQPTRWUV.

Question 23 |

Suppose depth first search is executed on the graph below starting at some unknown vertex. Assume that a recursive call to visit a vertex is made only after first checking that the vertex has not been visited earlier. Then the maximum possible recursion depth (including the initial call) is _________.

17 | |

18 | |

19 | |

20 |

**Graph Traversals**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 24 |

You have an array of n elements. Suppose you implement quicksort by always choosing the central element of the array as the pivot. Then the tightest upper bound for the worst case performance is

O(n ^{2}) | |

O(nLogn) | |

Theta(nLogn) | |

O(n ^{3}) |

**Analysis of Algorithms**

**Sorting**

**GATE-CS-2014-(Set-3)**

**QuickSort**

**Discuss it**

Question 24 Explanation:

The central element may always be an extreme element, therefore time complexity in worst case becomes O(n

^{2})Question 25 |

The length of the shortest string NOT in the language (over Σ = {a, b}) of the following regular
expression is ______________.

a*b*(ba)*a*

2 | |

3 | |

4 | |

5 |

**Regular languages and finite automata**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 25 Explanation:

The string "bab" is the shortest string not acceptable by regular expression.

Question 27 |

One of the purposes of using intermediate code in compilers is to

make parsing and semantic analysis simpler. | |

improve error recovery and error reporting. | |

increase the chances of reusing the machine-independent code optimizer in other compilers. | |

improve the register allocation. |

**Code Generation and Optimization**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 27 Explanation:

After semantic Analysis, the code is converted into intermediate code which is language independent, the advantage of converting into intermediate code is to improve the performance of code generation and to increase the chances of reusing the machine-independent code optimizer in other compilers.

Question 28 |

Which of the following statements are CORRECT?

1) Static allocation of all data areas by a compiler makes it impossible to implement recursion. 2) Automatic garbage collection is essential to implement recursion. 3) Dynamic allocation of activation records is essential to implement recursion. 4) Both heap and stack are essential to implement recursion.

1 and 2 only | |

2 and 3 only | |

3 and 4 only | |

1 and 3 only |

**Principles of Programming Languages**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 28 Explanation:

**1) Static allocation of all data areas by a compiler makes it impossible to implement recursion.**True, dynamic allocate of memory is required for function call stack as number of calls is not known advance for recursive functions.

**2) Automatic garbage collection is essential to implement recursion.**False, Automatic garbage collection is not essential.

**3) Dynamic allocation of activation records is essential to implement recursion.**True, as number of calls or number of activation records is not known advance for recursive functions.

**4) Both heap and stack are essential to implement recursion.**Heap is not needed for function calls. It is generally used for dynamic memory allocation by user (or programmer). See Memory Layout of C Programs for details.

Question 29 |

In the context of modular software design, which one of the following combinations is desirable?

High cohesion and high coupling
| |

High cohesion and low coupling | |

Low cohesion and high coupling | |

Low cohesion and low coupling |

**Software Engineering**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 29 Explanation:

Coupling is the manner and degree of interdependence between software modules.
Cohesion refers to the degree to which the elements of a module belong together.
In a good software design, it is always desirable to have less interaction among modules (Low coupling).
Advantages of high cohesion (or “strong cohesion”) are:
1) Reduced module complexity (they are simpler, having fewer operations).
2) Increased system maintainability, because logical changes in the domain affect fewer modules, and because changes in one module require fewer changes in other modules.
3) Increased module reusability,because application developers will find the component they need more easily among the cohesive set of operations provided by the module.
Source: https://en.wikipedia.org/wiki/Cohesion_%28computer_science%29

Question 30 |

A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below?
4, 7, 6, 1, 7, 6, 1, 2, 7, 2

4 | |

5 | |

6 | |

7 |

**Memory Management**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 30 Explanation:

What is a Page fault ? An interrupt that occurs when a program requests data that is not currently in real memory. The interrupt triggers the operating system to fetch the data from a virtual memory and load it into RAM.
Now, 4, 7, 6, 1, 7, 6, 1, 2, 7, 2 is the reference string, you can think of it as data requests made by a program.
Now the system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy.

[ ] - Initially page frames are empty.i.e. no process pages in main memory. [ 4 ] - Now 4 is brought into 1st frame (1st page fault)Explanation: Process page 4 was requested by the program, but it was not in the main memory(in form of page frames),which resulted in a page fault, after that process page 4 was brought in the main memory by the operating system.

[ 4 7 ] - Now 7 is brought into 2nd frame (2nd page fault) - Same explanation. [ 4 7 6 ] - Now 6 is brought into 3rd frame (3rd page fault) [ 1 7 6 ] - Now 1 is brought into 1st frame, as 1st frame was least recently used(4th page fault).After this 7, 6 and 1 are were already present in the frames hence no replacements in pages.

[ 1 2 6 ] - Now 2 is brought into 2nd frame, as 2nd frame was least recently used(5th page fault). [ 1 2 7 ] -Now 7 is brought into 3rd frame, as 3rd frame was least recently used(6th page fault).Hence, total number of page faults(also called pf) are 6. Therefore, C is the answer.

Question 31 |

A | |

B | |

C | |

D |

**ER and Relational Models**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 31 Explanation:

The Relational Algebra expression in the question above, does 4 operations, step by step ( innermost braces first ) .

1. Select those tuples from relation r which satisfies expression/condition F1, say the result of this operation is set A. 2. Select those tuples from set A which satisfies expression/condition F2, say the result of this operation is set B. 3. Select attrributes set A2 from set B, say the result of this operation is set C. 4. Select attrributes set A1 from set C, say the result is set D which is the final result.Now to optimize this expression, we can combine operations/steps 1 and 2 by AND operator between F1 and F2 condition, like F1 ^ F2, and instead of selecting first attribute set A2, we can directly select attribute set A1 from the result of the combined operation, which is represented by expression in Option A .

Question 32 |

A

*prime attribute*of a relation scheme R is an attribute that appears in all candidate keys of R. | |

in some candidate key of R. | |

in a foreign key of R. | |

only in the primary key of R. |

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 32 Explanation:

The constituent attributes of a Candidate key or simply the attributes of a candidate key are called the prime attributes.
Suppose ABC is one candidate key of a Relation R(ABCDEFGH). Then the attributes A, B and C all are prime attributes. Similarly if ABD is also another candidate key in the same relation R, then D is also the prime attribute. And conversely, an attribute that does not occur in ANY candidate key is called a non-prime attribute.

Question 33 |

In the following pairs of OSI protocol layer/sub-layer and its functionality, the INCORRECT pair is

Network layer and Routing | |

Data Link Layer and Bit synchronization | |

Transport layer and End-to-end process communication | |

Medium Access Control sub-layer and Channel sharing |

**Misc Topics in Computer Networks**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 33 Explanation:

1) Yes, Network layer does Rotuing 2) No, Bit synchronization is provided by Physical Layer 3) Yes, Transport layer provides End-to-end process communication 4) Yes, Medium Access Control sub-layer of Data Link Layer provides Channel sharing.

Question 34 |

A bit-stuffing based framing protocol uses an 8-bit delimiter pattern of 01111110. If the output bit-string after stuffing is 01111100101, then the input bit-string is

0111110100 | |

0111110101 | |

0111111101 | |

0111111111 |

**Data Link Layer**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 34 Explanation:

Bit Stuffing is used to create framing.

8-bit delimiter pattern is 01111110. The output bit-string after stuffing is 0111110Refer https://www.youtube.com/watch?v=FpyoALtvUTo&index=16&list=PLkHsKoi6eZnzJl1qTzmvBwTxrSJW4D2Jj for more details.0101. The above highlighted bit is stuffed bit. So input bit-string must be 0111110101.

Question 35 |

Host A (on TCP/IP v4 network A) sends an IP datagram D to host B (also on TCP/IP v4 network B). Assume that no error occurred during the transmission of D. When D reaches B, which of the following IP header field(s) may be different from that of the original datagram D?

(i) TTL (ii) Checksum (iii) Fragment Offset

(i) only | |

(i) and (ii) only | |

(ii) and (iii) only | |

(i), (ii) and (iii) |

**Network Layer**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 35 Explanation:

**All (i), (ii) and (iii) are changed:**(i) TTL is decremented at every hop. So TTL is different from orginal value (ii) Since TTL changes, the Checksum of the packet also changes. (iii) A packet is fragmented if it has a size greater than the Maximum Transmission Unit (MTU) of the network. There may be intermediate networks that may change fragment offset by fragmenting the packet.

Question 36 |

Classless Inter-domain Routing (CIDR) receives a packet with address 131.23.151.76. The router’s routing table has the following entries:

The identifier of the output interface on which this packet will be forwarded is ______.Prefix Output Interface Identifier131.16.0.0/12 3 131.28.0.0/14 5 131.19.0.0/16 2 131.22.0.0/15 1

1 | |

2 | |

3 | |

5 |

**Network Layer**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 36 Explanation:

In this question, we need to find out Netmask for each entry and BITWISE AND with given packet address, whichever equals the Netid, is the ans. Ex. 1st entry in table: 131.16.0.0/12. its MASK is first 12 bits of network(they are all 1) and remaining 20 bits of host(they are all 0). so MASK is 255.240.0.0 AND 131.23.151.76 = 131.16.0.0. Last entry is 131.22.0.0/15 MASK--->255.254.0.0 AND 131.23.151.76 = 131.22.0.0. Two ans coming interfaces 1,3.
Longest Prefix Matching is used to decide among two. When one destination address matches more than one forwarding table entry. The most specific of the matching table entries is used as the interface.
The interface 1 has the longest matching prefix with the input IP address. Therefore 1 is chosen.

Question 37 |

Every host in an IPv4 network has a 1-second resolution real-time clock with battery backup. Each host needs to generate up to 1000 unique identifiers per second. Assume that each host has a globally unique IPv4 address. Design a 50-bit globally unique ID for this purpose. After what period (in seconds) will the identifiers generated by a host wrap around?

128 | |

64 | |

256 | |

512 |

**Network Layer**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 37 Explanation:

Wrap-around time is nothing but in how many seconds will all the hosts generate all IDs possible. (i.e. TOTAL_IDS / NO. OF IDS PER SEC).
Total IDs possible with 50-bit is 2^50.
One host generating 1000 identifiers per sec. So all hosts will generate 2^32 * 1000 ----> 2^32 * 2^10-----> 2^42 unique IDs.
If we Divide them, we get answer (i.e. 2^50/2^42=2^8)

Question 38 |

An IP router with a Maximum Transmission Unit (MTU) of 1500 bytes has received an IP packet of size 4404 bytes with an IP header of length 20 bytes. The values of the relevant fields in the header of the third IP fragment generated by the router for this packet are

MF bit: 0, Datagram Length: 1444; Offset: 370 | |

MF bit: 1, Datagram Length: 1424; Offset: 185 | |

MF bit: 1, Datagram Length: 1500; Offset: 37 | |

MF bit: 0, Datagram Length: 1424; Offset: 2960 |

**Network Layer**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 38 Explanation:

Number of packet fragments = ⌈ (total size of packet)/(MTU) ⌉ = ⌈ 4404/1500 ⌉ = ⌈ 2.936 ⌉ = 3 So Datagram with data 4404 byte fragmented into 3 fragments.The first frame carries bytes 0 to 1479 (because MTU is 1500 bytes and HLEN is 20 byte so the total bytes in fragments is maximum 1500-20=1478). the offset for this datagram is 0/8 = 0. The second fragment carries byte 1480 to 2959. The offset for this datagram is 1480/8 = 185.finally the third fragment carries byte 2960 to 4404.the offset is 370.and for all fragments except last one the M bit is 1.so in the third bit M is 0..

Question 39 |

Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below.

T1: r1(X); r1(Z); w1(X); w1(Z) T2: r2(Y); r2(Z); w2(Z) T3: r3(Y); r3(X); w3(Y) S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z) S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z)Which one of the following statements about the schedules is TRUE?

Only S1 is conflict-serializable. | |

Only S2 is conflict-serializable. | |

Both S1 and S2 are conflict-serializable. | |

Neither S1 nor S2 is conflict-serializable. |

**Transactions and concurrency control**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 39 Explanation:

For conflict serializability of a schedule( which gives same effect as a serial schedule ) we should check for conflict operations, which are Read-Write, Write-Read and Write-Write between each pair of transactions, and based on those conflicts we make a precedence graph, if the graph contains a cycle, it's not a conflict serializable schedule.
To make a precedence graph: if Read(X) in Ti followed by Write(X) in Tj ( hence a conflict ), then we draw an edge from Ti to Tj ( Ti -> Tj)
If we make a precedence graph for S1 and S2 , we would get directed edges for S1 as T2->T1, T2->T3, T3->T1, and for S2 as T2->T1, T2->T3, T3->T1, T1->T2. In S1 there is no cycle, but S2 has a cycle. Hence only S1 is conflict serializable.
Note : The serial order for S1 is T2 -> T3 -> T1.

Question 40 |

Consider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of the relation employee. Assume that every employee has at least one associated dependent in the dependent relation.

employee (Consider the following relational algebra query: The above query evaluates to the set ofempId, empName, empAge) dependent(depId, eId, depName, depAge)

*empIds*of employees whose age is greater than that ofsome dependent. | |

all dependents. | |

some of his/her dependents | |

all of his/her dependents. |

**ER and Relational Models**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 40 Explanation:

Question 41 |

A system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system must have such that deadlocks never arise is _________.

6 | |

7 | |

8 | |

9 |

**GATE-CS-2014-(Set-3)**

**Deadlock**

**Discuss it**

Question 41 Explanation:

If 6 resources are there then it may be possible that all three process have 2 resources and waiting for 1 more resource. Therefore, all of them will have to wait indefinitely. If 7 resources are there, then atleast one must have 3 resources so deadlock can never occur.

Question 42 |

An operating system uses shortest remaining time first scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes with their arrival times and CPU burst times (in milliseconds):

Process Arrival Time Burst Time P1 0 12 P2 2 4 P3 3 6 P4 8 5The average waiting time (in milliseconds) of the processes is _________.

4.5 | |

5.0 | |

5.5 | |

6.5 |

**GATE-CS-2014-(Set-3)**

**CPU Scheduling**

**Discuss it**

Question 42 Explanation:

Process Arrival Time Burst Time P1 0 12 P2 2 4 P3 3 6 P4 8 5Burst Time - The total time needed by a process from the CPU for its complete execution. Waiting Time - How much time processes spend in the ready queue waiting their turn to get on the CPU Now, The Gantt chart for the above processes is :

P1 - 0 to 2 milliseconds P2 - 2 to 6 milliseconds P3 - 6 to 12 milliseconds P4 - 12 to 17 milliseconds P1 - 17 to 27 millisecondsProcess p1 arrived at time 0, hence cpu started executing it. After 2 units of time P2 arrives and burst time of P2 was 4 units, and the remaining time of the process p1 was 10 units,hence cpu started executing P2, putting P1 in waiting state(Pre-emptive and Shortest remaining time first scheduling). Due to P1's highest remaining time it was executed by the cpu in the end.

Now calculating the waiting time of each process: P1 -> 17 -2 = 15 P2 -> 0 P3 -> 6 - 3 = 3 P4 -> 12 - 8 = 4 Hence total waiting time of all the processes is = 15+0+3+4=22 Total no of processes = 4 Average waiting time = 22 / 4 = 5.5 Hence C is the answer.

Question 43 |

Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the effective memory access time (in milliseconds) is _________.

120 | |

122 | |

124 | |

118 |

**Memory Management**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 43 Explanation:

**TLB stands for Translation Lookaside Buffer**. In Virtual memory systems, the cpu generates virtual memory addresses. But, the data is stored in actual physical memory i.e. we need to place a physical memory address on the memory bus to fetch the data from the memory circuitry. So, a special table is maintained by the operating system called the Page table. This table contains a mapping between the virtual addresses and physical addresses. So, every time a cpu generates a virtual address, the operating system page table has to be looked up to find the corresponding physical address. To speed this up, there is hardware support called the TLB. The TLB is a high speed cache of the page table i.e. contains recently accessed virtual to physical translations. TLB hit ratio- A TLB hit is the no of times a virtual-to-physical address translation was already found in the TLB, instead of going all the way to the page table which is located in slower physical memory. TLB hit ratio is nothing but the ratio of TLB hits/Total no of queries into TLB. In the case that the page is found in the TLB (TLB hit) the total time would be the time of search in the TLB plus the time to access memory, so

**TLB_hit_time := TLB_search_time + memory_access_time**In the case that the page is not found in the TLB (TLB miss) the total time would be the time to search the TLB (you don't find anything, but searched nontheless) plus the time to access memory to get the page table and frame, plus the time to access memory to get the data, so

**TLB_miss_time := TLB_search_time + memory_access_time + memory_access_time**But this is in individual cases, when you want to know an average measure of the TLB performance, you use the Effective Access Time, that is the weighted average of the previous measures EAT := TLB_miss_time * (1- hit_ratio) + TLB_hit_time * hit_ratio. EAT := (TLB_search_time + 2*memory_access_time) * (1- hit_ratio) + (TLB_search_time + memory_access_time)* hit_ratio. As both page table and page are in physical memory T(eff) = hit ratio * (TLB access time + Main memory access time) + (1 - hit ratio) * (TLB access time + 2 * main memory time) = 0.6*(10+80) + (1-0.6)*(10+2*80) = 0.6 * (90) + 0.4 * (170) = 122

This solution is contributed

**Nitika Bansal**

Question 44 |

Consider the basic block given below.

a = b + c c = a + d d = b + c e = d - b a = e + bThe minimum number of nodes and edges present in the DAG representation of the above basic block respectively are

6 and 6 | |

8 and 10 | |

9 and 12 | |

4 and 4 |

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 45 |

Which of the following problems is undecidable?

Deciding if a given context-free grammar is ambiguous. | |

Deciding if a given string is generated by a given context-free grammar. | |

Deciding if the language generated by a given context-free grammar is empty. | |

Deciding if the language generated by a given context-free grammar is finite. |

**Undecidability**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 45 Explanation:

Context free grammar is

**not closed under ambiguity**.*A set is closed under an operation means when we operate an element of that set with that operator we get an element from that set.*Here, context free grammar generates a context free language and set of all context free languages is also a set.**But, ambiguity is not an operation and hence we can never say that CFG is closed under ambiguity.****Thus, problem mentioned in option (A) is undecidable.**Please comment below if you find anything wrong in the above post.Question 46 |

Here, w

^{r}is the reverse of the string w. Which of these languages are deterministic Context-free languages? None of the languages | |

Only L1 | |

Only L1 and L2 | |

All the three languages |

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

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 47 |

Suppose you want to move from 0 to 100 on the number line. In each step, you either move right by a unit distance or you take a shortcut. A shortcut is simply a pre-specified pair of integers i, j with i < j. Given a shortcut i, j if you are at position i on the number line, you may directly move to j. Suppose T(k) denotes the smallest number of steps needed to move from k to 100. Suppose further that there is at most 1 shortcut involving any number, and in particular from 9 there is a shortcut to 15. Let y and z be such that T(9) = 1 + min(T(y), T(z)). Then the value of the product yz is _____.

50 | |

100 | |

150 | |

200 |

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 47 Explanation:

T(k) is the smallest number of steps needed to move from k to 100.
Now, it is given that ‘y’ and ‘z’ are two numbers such that T(9) = 1 + min (T(y), T(z)), i.e.,
T(9) = 1 + min (Steps from y to 100, Steps from z to 100), where ‘y’ and ‘z’ are two possible values that can be reached from 9.
One number that can be reached from 9 is 10, which is the number obtained if we simply move one position right on the number line. Another number is 15, the shortcut path from 9, as given in the question. So, we have two paths from 9, one is 10 and the other is 15.
Therefore, the value of y and z is 10 and 15 (either variable may take either of the values).
Thus, yz = 150.

Question 48 |

NP-Complete. | |

solvable in polynomial time by reduction to directed graph reachability. | |

solvable in constant time since any input instance is satisfiable. | |

NP-hard, but not NP-complete. |

**NP Complete**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 48 Explanation:

2CNF-SAT can be reduced to strongly connected components problem. And strongly connected component has a polynomial time solution. Therefore 2CNF-SAT is polynomial time solvable. See https://en.wikipedia.org/wiki/2-satisfiability#Strongly_connected_components for details.
As a side note, 3CNFSAT is NP Complete problem.

Question 49 |

Suppose we have a balanced binary search tree T holding n numbers. We are given two numbers L and H and wish to sum up all the numbers in T that lie between L and H. Suppose there are m such numbers in T. If the tightest upper bound on the time to
compute the sum is O(n

^{a}log^{b}n + m^{c}log^{d}n), the value of a + 10b + 100c + 1000d is ____.60 | |

110 | |

210 | |

50 |

**Binary Search Trees**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 49 Explanation:

int getSum(node *root, int L, int H) { // Base Case if (root == NULL) return 0; if (root->key < L) return getSum(root->right, L, H); if (root->key > H) return getSum(root->left, L, H) if (root->key >= L && root->key <=H) return getSum(root->left, L, H) + root->key + getSum(root->right, L, H); }The above always takes O(m + Logn) time. Note that the code first traverses across height to find the node which lies in range. Once such a node is found, it recurs for left and right children. Two recursive calls are made only if the node is in range. So for every node that is in range, we make at most one extra call (here extra call means calling for a node that is not in range).

Question 50 |

Consider a hash table with 100 slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the first 3 slots are unfilled after the first 3 insertions?

(97 × 97 × 97)/100 ^{3} | |

(99 × 98 × 97)/100 ^{3} | |

(97 × 96 × 95)/100 ^{3} | |

(97 × 96 × 95)/(3! × 100 ^{3}) |

**Hash**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 50 Explanation:

Simple Uniform hashing function is a hypothetical hashing function that evenly distributes items into the slots of a hash table. Moreover, each item to be hashed has an equal probability of being placed into a slot, regardless of the other elements already placed. (Source: https://en.wikipedia.org/wiki/SUHA_%28computer_science%29).

Probability that the first 3 slots are unfilled after the first 3 insertions = (probability that first item doesn't go in any of the first 3 slots)* (probability that second item doesn't go in any of the first 3 slots)* (probability that third item doesn't go in any of the first 3 slots) = (97/100) * (97/100) * (97/100)

Question 51 |

Consider the pseudocode given below. The function DoSomething() takes as argument a
pointer to the root of an arbitrary tree represented by the leftMostChild-rightSibling representation.
Each node of the tree is of type treeNode.

typedef struct treeNode* treeptr; struct treeNode { treeptr leftMostChild, rightSibling; }; int DoSomething (treeptr tree) { int value=0; if (tree != NULL) { if (tree->leftMostChild == NULL) value = 1; else value = DoSomething(tree->leftMostChild); value = value + DoSomething(tree->rightSibling); } return(value); }When the pointer to the root of a tree is passed as the argument to DoSomething, the value returned by the function corresponds to the

number of internal nodes in the tree.
| |

height of the tree. | |

number of nodes without a right sibling in the tree.
| |

number of leaf nodes in the tree. |

**Tree Traversals**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 51 Explanation:

The function counts leaf nodes for a tree represented using leftMostChild-rightSibling representation.
Below is function with comments added to demonstrate how function works.
1

Question 52 |

Consider the C function given below. Assume that the array listA contains n (> 0) elements, sorted in ascending order.

int ProcessArray(int *listA, int x, int n) { int i, j, k; i = 0; j = n-1; do { k = (i+j)/2; if (x <= listA[k]) j = k-1; if (listA[k] <= x) i = k+1; } while (i <= j); if (listA[k] == x) return(k); else return -1; }Which one of the following statements about the function ProcessArray is CORRECT?

It will run into an infinite loop when x is not in listA. | |

It is an implementation of binary search. | |

It will always find the maximum element in listA. | |

It will return −1 even when x is present in listA. |

**Searching**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 52 Explanation:

The function is iterative implementation of Binary Search. k keeps track of current middle element. i and j keep track of left and right corners of current subarray

Question 53 |

An instruction pipeline has five stages, namely, instruction fetch (IF), instruction decode and register fetch (ID/RF), instruction execution (EX), memory access (MEM), and register writeback (WB) with stage latencies 1 ns, 2.2 ns, 2 ns, 1 ns, and 0.75 ns, respectively (ns stands for nanoseconds). To gain in terms of frequency, the designers have decided to split the ID/RF stage into three stages (ID, RF1, RF2) each of latency 2.2/3 ns. Also, the EX stage is split into two stages (EX1, EX2) each of latency 1 ns. The new design has a total of eight pipeline stages. A program has 20% branch instructions which execute in the EX stage and produce the next instruction pointer at the end of the EX stage in the old design and at the end of the EX2 stage in the new design. The IF stage stalls after fetching a branch instruction until the next instruction pointer is computed. All instructions other than the branch instruction have an average CPI of one in both the designs. The execution times of this program on the old and the new design are P and Q nanoseconds, respectively. The value of P/Q is __________.

1.5 | |

1.4 | |

1.8 | |

2.5 |

**Computer Organization and Architecture**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 53 Explanation:

Each one takes average 1CPI. In 1st case 80% take 1 clock and 20% take 3 clocks so total time: p = (.8*1 + .2*3)*2.2=3.08. q = (.8*1 + 6*.2)*1=2 p/q = 1.54

Question 54 |

The memory access time is 1 nanosecond for a read operation with a hit in cache, 5 nanoseconds for a read operation with a miss in cache, 2 nanoseconds for a write operation with a hit in cache and 10 nanoseconds for a write operation with a miss in cache. Execution of a sequence of instructions involves 100 instruction fetch operations, 60 memory operand read operations and 40 memory operand write operations. The cache hit-ratio is 0.9. The average memory access time (in nanoseconds) in executing the sequence of instructions is __________.

1.26 | |

1.68 | |

2.46 | |

4.52 |

**Memory Management**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 54 Explanation:

The question is to find the time taken for, "100 fetch operation and 60 operand red operations and 40 memory operand write operations"/"total number of instructions". Total number of instructions= 100+60+40 =200 Time taken for 100 fetch operations(fetch =read) = 100*((0.9*1)+(0.1*5)) // 1 corresponds to time taken for read // when there is cache hit = 140 ns //0.9 is cache hit rate Time taken for 60 read operations = 60*((0.9*1)+(0.1*5)) = 84ns Time taken for 40 write operations = 40*((0.9*2)+(0.1*10)) = 112 ns // Here 2 and 10 the time taken for write when there is cache // hit and no cahce hit respectively So,the total time taken for 200 operations is = 140+84+112 = 336ns Average time taken = time taken per operation = 336/200 = 1.68 ns

Question 55 |

The above sequential circuit is built using JK flip-flops is initialized with Q2Q1Q0 = 000. The state sequence for this circuit for the next 3 clock cycle is

001, 010, 011 | |

111, 110, 101 | |

100, 110, 111 | |

100, 011, 001 |

**Digital Logic & Number representation**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 55 Explanation:

JK ff truth table---

Initially Q2Q1Q0=000
Present state FF input Next state

So ans is ( C) part.

j | k | Q |

0 | 0 | Q0 |

1 | 0 | 1 |

0 | 1 | 0 |

1 | 1 | Q0’ |

Q2 | Q1 | Q0 | J2 | K2 | J1 | K1 | J0 | K0 | Q2 | Q1 | Q0 |

0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |

1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 |

1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 |

Question 56 |

I Only | |

II Only | |

Both I and II | |

Neither I or II |

**Numerical Methods and Calculus**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 58 |

Let S be the sample space and two mutually exclusive events A and B be such that A U B = S. If P(.) denotes the probability of the event. The maximum value of P(A)P(B) is ______

0.5 | |

0.25 | |

0.225 | |

0.125 |

**Probability**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 58 Explanation:

Sample Space(S) - A set of all possible outcomes/events of a random experiment.
Mutually Exclusive Events - Those events which can't occur simultaneously.
P(A)+P(B)+P(A∩B)=1
Since the events are mutually exclusive, P(A∩B)=0.
Therefore, P(A)+P(B)=1
Now, we now that AM >= GM
So, (P(A)+P(B))/2 >= sqrt(P(A)*P(B))
P(A)*P(B) <= 1/4

Hence max(P(A)*P(B)) = 1/4.

We can think of this problem as flipping a coin, it has two mutually exclusive events ( head and tail , as both can't occur simultaneously). And sample space S = { head, tail } Now, lets say event A and B are getting a "head" and "tail" respectively. Hence, S = A U B. Therefore, P(A) = 1/2 and P(B) = 1/2. And, P(A).P(B) = 1 /4 = 0.25. Hence option B is the correct choice.

Hence max(P(A)*P(B)) = 1/4.

We can think of this problem as flipping a coin, it has two mutually exclusive events ( head and tail , as both can't occur simultaneously). And sample space S = { head, tail } Now, lets say event A and B are getting a "head" and "tail" respectively. Hence, S = A U B. Therefore, P(A) = 1/2 and P(B) = 1/2. And, P(A).P(B) = 1 /4 = 0.25. Hence option B is the correct choice.

Question 59 |

There are two elements x, y in a group (G,∗) such that every element in the group can be written as a product of some number of x's and y's in some order. It is known that

x ∗ x = y ∗ y = x ∗ y ∗ x ∗ y = y ∗ x ∗ y ∗ x = ewhere e is the identity element. The maximum number of elements in such a group is __________.

2 | |

3 | |

4 | |

5 |

**Set Theory & Algebra**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 59 Explanation:

x * x = e, x is its own inverse y * y = e, y is its own inverse (x*y) * (x* y) = e, x*y is its own inverse (y*x) * (y*x) = e, y*x is its own inverse also x*x*e = e*e can be rewritten as follows x*y*y*x = e*y*y*e = e, (Since y *y = e) (x*y) * (y*x) = e shows that (x *y) and (y *x) are each other’s inverse and we already know that (x*y) and (y*x) are inverse of its own. As per (G,*) to be group any element should have only one inverse element (unique) This implies x*y = y*x (is one element) So the elements of such group are 4 which are {x, y, e, x*y}.See following definition of group from wikipedia. A group is a set, G, together with an operation • (called the group law of G) that combines any two elements a and b to form another element, denoted a • b or ab. To qualify as a group, the set and operation, (G, •), must satisfy four requirements known as the group axioms:[5]

**Closure**For all a, b in G, the result of the operation, a • b, is also in G.b[›]

**Associativity**For all a, b and c in G, (a • b) • c = a • (b • c).

**Identity element**There exists an element e in G, such that for every element a in G, the equation e • a = a • e = a holds. Such an element is unique (see below), and thus one speaks of the identity element.

**Inverse element**For each a in G, there exists an element b in G such that a • b = b • a = e, where e is the identity element. Source: https://en.wikipedia.org/wiki/Group_%28mathematics%29

Question 60 |

If G is a forest with n vertices and k connected components, how many edges does G have?

floor(n/k) | |

ceil(n/k) | |

n-k | |

n-k+1 |

**Graph Theory**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 60 Explanation:

Each component will have n/k vertices (pigeonhole principle). Hence, for each component there will be (n/k)-1 edges.
Since there are k components, total number of edges= k*((n/k)-1) = n-k.

Question 61 |

Let d denote the minimum degree of a vertex in a graph. For all planar graphs on n vertices with d ≥ 3, which one of the following is TRUE?

In any planar embedding, the number of faces is at least n/2 + 2 | |

In any planar embedding, the number of faces is less than n/2 + 2 | |

There is a planar embedding in which the number of faces is less than n/2 + 2 | |

There is a planar embedding in which the number of faces is at most n/(d+1) |

**Graph Theory**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 61 Explanation:

Euler's formula for planar graphs: v − e + f = 2. v => Number of vertices e => Number of edges f => Number of faces Since degree of every vertex is at least 3, below is true from handshaking lemma (Sum of degrees is twice the number of edges) 3v >= 2e 3v/2 >= e Putting these values in Euler's formula. v - 3v/2 + f >= 2 f >= v/2 + 2

Question 62 |

Consider the set of all functions f: {0,1, … ,2014} → {0,1, … ,2014} such that f(f(i)) = i,
for all 0 ≤ i ≤ 2014. Consider the following statements:

P. For each such function it must be the case that for every i, f(i) = i. Q. For each such function it must be the case that for some i, f(i) = i. R. Each such function must be onto.Which one of the following is CORRECT?

P, Q and R are true | |

Only Q and R are true | |

Only P and Q are true | |

Only R is true |

**Set Theory & Algebra**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 62 Explanation:

This kind of functions are called identity functions.
We assume f(i) = k. So, f(k) = i. Now, since the values of ' i ' and ' j ' would be same for atleast some values if the domain and co - domain intersect, which is true for the given question, Q is definitely true. But this might not happen for all the values of ' i ', hence, P is not always true.
Now, ' i ' ranges from 0 to 2014, so, it takes 2015 possible values. From the definition of a function, we know that for each input to the function, we have a unique output. Also, in the given question, domain and co - domain are exactly same. Therefore, the function is onto and hence, R is definitely true.
Thus, the correct option is B.

Question 63 |

A | |

B | |

C | |

D |

**Propositional and First Order Logic.**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 63 Explanation:

**(A)**Note that (p ∧ ~q) ≡ ~(p -> q). So it means rainy day to cold implication is false for all days. Which means non-rainy days are cold.

**(B)**For all days, if day is not rainy, then it is cold [Non-Rainy days are cold]

**(C)**There exist some days for which not rainy implies cold. [Some non-rainy days are cold]

**(D)**Note that (p ∧ ~q) ≡ ~(p -> q). So it means rainy day to cold implication is false for some days. Which means not all rainy days are cold.

Question 64 |

Consider the following relational schema:

employee(salesRepId is a foreign key referring to empId of the employee relation. Assume that each employee makes a sale to at least one customer. What does the following query return?empId, empName, empDept) customer(custId, custName, salesRepId, rating)

SELECT empName FROM employee E WHERE NOT EXISTS (SELECT custId FROM customer C WHERE C.salesRepId = E.empId AND C.rating <> ’GOOD’);

Names of all the employees with at least one of their customers having a ‘GOOD’ rating. | |

Names of all the employees with at most one of their customers having a ‘GOOD’ rating. | |

Names of all the employees with none of their customers having a ‘GOOD’ rating. | |

Names of all the employees with all their customers having a ‘GOOD’ rating. |

**SQL**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 64 Explanation:

If any employee has received rating other than 'good' from some customer, then there will be some rows returned by the inner query. And not exists will return false so that employee won't be printed only those employees which have got rating good from all their customers will be printed.

Question 65 |

Let X denote the Exclusive OR (XOR) operation. Let ‘1’ and ‘0’ denote the binary constants. Consider the following Boolean expression for F over two variables P and Q:

F(P, Q) = ( ( 1 X P) X (P X Q) ) X ( (P X Q) X (Q X 0) )The equivalent expression for F is

P + Q | |

(P + Q)' | |

P X Q | |

(P X Q)' |

**Digital Logic & Number representation**

**GATE-CS-2014-(Set-3)**

**Discuss it**

Question 65 Explanation:

We need to simplify the above expression. As the given operation is XOR, we shall see property of XOR.
Let A and B be boolean variable.
In A XOR B, the result is 1 if both the bits/inputs are different, else 0.
Now,

( ( 1 X P) X (P X Q) ) X ( (P X Q) X (Q X 0) ) ( P' X P X Q ) X ( P X Q X Q ) ( as 1 X P = P' and Q X 0 = Q ) (1 X Q) X ( P X 0) ( as P' X P = 1 , and Q X Q = 0 ) Q' X P ( as 1 X Q = Q' and P X 0 = P ) PQ + P'Q' ( XOR Expansion, A X B = AB' + A'B ) This is the final simplified expression. Now we need to check for the options. If we simplify option D expression. ( P X Q )' = ( PQ' + P'Q )' ( XOR Expansion, A X B = AB' + A'B ) ((PQ')'.(P'Q)') ( De Morgan's law ) ( P'+ Q).(P + Q') ( De Morgan's law ) P'P + PQ + P'Q' + QQ' PQ + P'Q' ( as PP' = 0 and QQ' = 0 ) Hence both the equations are same. Therefore Option D.

There are 65 questions to complete.