Javatpoint Logo
Javatpoint Logo

GATE || GATE-CS-2014 (Set 1)

1) Which of the following options is the closest in meaning to the phrase underlined in the sentence below?

It is fascinating to see life forms cope with varied environmental conditions.

  1. adopt to
  2. adapt to
  3. adept in
  4. accept with

Answer: B

Explanation: In the above phrase, underlined part is *cope with*.

"Cope" - It's a verb.
Meaning - deal effectively with some difficulty.
Example Sentence - "his ability to cope with stress"

"adopt" - verb.
Meaning - choose to take up or follow (an idea, method, or course of action).
Sentence - "this approach has been adopted by many big banks"

"adapt" - verb.
Meaning - become adjusted to new conditions.
sentence -"a large organization can be slow to adapt to change"

"adept" - adjective
Meaning - very skilled or proficient at something.
Sentence - "she is adept at cutting through red tape"

"accept" - verb
Meaning - consent to receive or undertake (something offered).
Sentence - "he accepted a pen as a present"

Hence, only "adapt" goes right with the phrase described in the question.


2) Choose the most appropriate word from the options given below to complete the following sentence.

He could not understand the judges awarding her the first prize, because he thought that her performance was quite. . . . . . . . . . . .

  1. superb
  2. medium
  3. mediocre
  4. exhilarating

Answer: C

Explanation: Here, superb and exhilarating would imply that the performance was brilliant. But, the fact that he could not understand why she got awarded the first prize indicates that her performance was not that amazing in his opinion. So, A and D are incorrect.

Medium is more used as a noun, and denoted intermediate in quality, value, etc. So, B is incorrect

Mediocre is used as an adjective (to represent quality) and means low in performance, i.e., normal and not extraordinary and C is the correct choice.


3) In a press meet on the recent scam, the minister said, "The buck stops here". What did the minister convey by the statement?

  1. He wants all the money
  2. He will return the money
  3. He will assume final responsibility
  4. He will resist all enquiries

Answer: C

Explanation: 'The buck stops here' means - Responsibility is not passed on beyond this point.

Option (C) is correct.


4) IF (z + 1 / z)2 = 98, compute (z2 + 1 / z2)

  1. 96
  2. 99
  3. 100
  4. 94

Answer: A

Explanation: (z + 1 / z)2 = (z2 + 1 / z2) + 2 * z * 1 / z

(z2 + 1 / z2) = (z + 1 / z)2 - 2 = 98 - 2 = 96


5) The roots of ax2 + bx + c are real and positive. a, b and c are real. Then ax2 + b|x| + c

has

  1. no roots
  2. 2 real roots
  3. 3 real roots
  4. 4 real roots

Answer: D

Explanation: The second equation has both +vs and -ve values of roots of first equation as root.


6) The Palghat Gap (or Palakkad Gap), a region about 30 km wide in the southern part of the Western Ghats in India, is lower than the hilly terrain to its north and south. The exact reasons for the formation of this gap are not clear. It results in the neighbouring regions of Tamil Nadu getting more rainfall from the South West monsoon and the neighbouring regions of Kerala having higher summer temperatures. What can be inferred from this passage?

  1. The Palghat gap is caused by high rainfall and high temperatures in southern Tamil Nadu and Kerala.
  2. The regions in Tamil Nadu and Kerala that are near the Palghat Gap are low-lying
  3. The low terrain of the Palghat Gap has a significant impact on weather patterns in neighbouring parts of Tamil Nadu and Kerala
  4. Higher summer temperatures result in higher rainfall near the Palghat Gap area.

Answer: C

Explanation: Here the passage is asking, " what can be inferred ? ", i.e. it's asking about the hidden conclusion of the passage.

Why not Option A ? - because it is clearly given in the passage : "The exact reasons for the formation of this gap are not clear ".

Why not Option B ? - because the passage does not talk about the low-lying regions of Kerala and Tamil Nadu near the Palghat Gap.

Why not option D ? - Because the passage only says : "neighbouring regions of Kerala having higher summer temperatures", it doesn't say that this high temperature results in rainfall.

Note: We have to think and conclude only from what is given in the passage. We can't make our own conclusions.

Why Option C ? - because the passage says : " It results in the neighbouring regions of Tamil Nadu getting more rainfall from the South West monsoon and the neighbouring regions of Kerala having higher summer temperatures",
hence we can conclude here that the weather is getting affected due to the Gap.

Therefore, option C is correct.


7) Geneticists say that they are very close to confirming the genetic roots of psychiatric illnesses such as depression and schizophrenia, and consequently, that doctors will be able to eradicate these diseases through early identification and gene therapy.

On which of the following assumptions does the statement above rely?

  1. Strategies are now available for eliminating psychiatric illnesses
  2. Certain psychiatric illnesses have a genetic basis
  3. All human diseases can be traced back to genes and how they are expressed
  4. In the future, genetics will become the only relevant field for identifying psychiatric illnesses

Answer: B

Explanation:

  • A says that strategies are nowavailable for eliminating psychiatric illnesses but it is mentioned in the very first line that the geneticists are very close but the strategy is not available till now. So, A is incorrect.
  • The given data says that the geneticists are working on the genetic roots of psychiatric illnesses such as depression and schizophrenia, which implies that these two diseases have genetic basis. Thus, B is the correct option.
  • C says that allhuman diseases can be traced back to genes and how they are expressed, but the data given in the question talks about psychiatric illnesses such as depression and schizophrenia only. So, C is also incorrect.
  • D says that in future, genetics will be the onlyrelevant field for identifying psychiatric illnesses, which cannot be inferred from the given data. So, D is also incorrect.

So, B is the correct option


8) Round-trip tickets to a tourist destination are eligible for a discount of 10% on the total fare. In addition, groups of 4 or more get a discount of 5% on the total fare. If the one way single person fare is Rs 100, a group of 5 tourists purchasing round-trip tickets will be charged Rs. . . . . . . . . . . . . . . .

  1. 850
  2. 900
  3. 800
  4. 1000

Answer: a

Explanation: One way single person fare is 100. Therefore, 2 way is 200.

For 5 persons it is 200 x 5 = 1000

Now 1st discount is of 10 % on total fare, which is

100( 10 % of 1000). And as the group is of more than 4, an additional discount of 5 % on total fare, which is

50( 5 % of 1000).

Hence total discount is equal to 100 + 50 = 150.

Therefore tickets are charged at Rs 1000 - 150 = 850.


9) In a survey, 300 respondents were asked whether they own a vehicle or not. If yes, they were further asked to mention whether they own a car or scooter or both. The irresponses are tabulated below.

GATE-CS-2014 Set 1

What percent of respondents do not own a scooter?

  1. 48
  2. 40
  3. 50
  4. 45

Answer: a

Explanation: No. of respondents do not own scooter = No. of persons who have car alone + No. of persons who don't have both.

In men, 40 + 20 = 60 and In women 34 + 50 = 84.

Total 60 + 84 = 144 .

Now the percentage is, (144 / 300) *100 = 48


10) When a point inside of a tetrahedron (a solid with four triangular surfaces) is connected by straight lines to its corners, how many (new) internal planes are created with these lines? . . . . . . . . . . . . . . . . . . . .

  1. 6
  2. 8
  3. 4
  4. 10

Answer: a

Explanation: The Tetrahedron has 4 triangular surfaces with 4 vertices/corners ( say A,B,C and D). Now if you take a point inside a tetrahedron (suppose O) and connect it with any two of its corners which are nothing but vertices (suppose A and B), you will get 1 internal plane as OAB.

So we can see from here that, no of new internal planes = no of different pair of corners or vertices.

Similarly you can take any other 2 corners like (A, C) or (A, D) or (B, C) or (B, D) or (C, D).
Hence total possible pair of corners is 6. Therefore, 6 new internal planes are possible.

We could also calculate the possible corners by using combinations formula,
which is nCr, i.e. no of ways to select a combination of r things from a given set of n things.
here n = 4 ( as total 4 vertices, A, B, C and D)
and r = 2 ( as we need two corners at a time)
Thus, 4C2 = 6.


11) Consider the statement

Not all that glitters is gold

Predicate glitters(x) is true if x glitters and predicate gold(x) is true if x is gold. Which one of the following logical formulae represents the above statement?

GATE-CS-2014 Set 1
  1. A
  2. B
  3. C
  4. D

Answer: d

Explanation: The statement "Not all that glitters is gold" can be expressed as follows:

¬(∀x(glitters(x)⇒gold(x)). . . . . . . . . . . . . . . . . . (1)

Where ∀x(glitters(x)⇒gold(x) refers that all glitters is gold. Now,

∃x¬(glitters(x)⇒gold(x)) . . . . . . . . . . . . . . . . . . . . . . .(2) ,

Since we know ¬∀x() = ∃x¬()

(Where ∀ refers to -> All and ∃x refers to -> There exists some).

As we know, A⇒B is true only in the case that either A is false or B is true. It can also defined in the other way :

A⇒B=¬A∨B (negationA or B ) . . . . . . . . . . . . . . . . . . . . . . .(3)

From equation (2) and (3) , we have
∃x(¬(¬glitters(x)∨gold(x))

⇒∃x(glitters(x)∧¬gold(x)) . . . . . . . . . . . . . . . . . . . . (4) ,

Negation cancellation ¬(¬) = () : and ¬(()∨()) = (¬()∧¬()) .

So Answer is (D).


12) Suppose you break a stick of unit length at a point chosen uniformly at random. Then the expected length of the shorter stick is . . . . . . . . . . . .

  1. 0.24 to 0.27
  2. 0.15 to 0.30
  3. 0.20 to 0.30
  4. 0.10 to 0.15

Answer: a

Explanation: The smaller sticks will range in length from almost 0 unit up to a maximum of 0.5 unit, with each length equally possible.

Therefore, the average length will be about (0 + 0.5) / 2 = 0.25 unit, which is answer.


13) Let G=(V,E) be a directed graph where V is the set of vertices and E the set of edges. Then which one of the following graphs has the same strongly connected components as G?

GATE-CS-2014 Set 1
  1. A
  2. B
  3. C
  4. D

Answer: b

Explanation: If we reverse directions of all arcs in a graph, the new graph has same set of strongly connected components as the original graph.


14) Consider the following system of equations:

3x + 2y = 1

4x + 7z = 1

x + y + z = 3

x - 2y + 7z = 0

The number of solutions for this system is . . . . . . . . . . . . . . .

  1. 1
  2. 0
  3. 2
  4. 3

Answer: a

Explanation: rank(Augmented Matrix) = rank(Matrix) = no of unknowns.

Hence it has a unique solution.


15) The value of the dot product of the eigenvectors corresponding to any pair of different eigenvalues of a 4-by-4 symmetric positive definite matrix is . . . . . . . . . . . . . . .

  1. 0
  2. 1
  3. -1
  4. 2

Answer: a

Explanation: The eigen vectors corresponding to different eigen values of a real symmetric matrix are orthogonal to each other. And dot product of orthogonal vectors is 0.


16)

GATE-CS-2014 Set 1
  1. I only
  2. II only
  3. Both I and II
  4. Neither I nor II

Answer: c

Explanation: In the given question, ⊝ranges fromπ / 6 to π/ 3.

When ⊝=π / 6 , the value of the function is 0, since Rows 1 and 2 are the same.

When ⊝ = / 3 , the value of the function is 0, since Rows 1 and 3 are the same.

GATE-CS-2014 Set 1

The given function is continuous and differentiable in the given range since it is a trigonometric function.

Then According to the Mean Value Theorem,

There exists a value c of such that f'(c) = 0. So the first statement is true.

Also there may also exist a value c, such that f'(c) ? 0. This is because the function is not a constant function, i.e. all values in the range are not equal to c.

So the second statement is also true.

Therefore the correct option is C.


17) Consider the following Boolean expression for F:

F(P, Q, R, S) = PQ + P'QR + P'QR'S

The minimal sum-of-products form of F is

  1. PQ + QR + QS
  2. P + Q + R + S
  3. P' + Q' + R' + S'
  4. P'R + P'R'S + P

Answer: a

Explanation: Given,

F(P, Q, R, S) = PQ + P'QR + P'QR'S

= Q(P + P'R + P'R'S)

= Q(P + R + R'S)

= Q(P + R + S)

= PQ + QR + QS

Note that A + AB = A and A + A'B = A + B.

So, option (A) is correct.


18) The base (or radix) of the number system such that the following equation holds is. . . . . . .

312/20 = 13.1

  1. 3
  2. 4
  3. 5
  4. 6

Answer: c

Explanation: Let x (≠ 0) be the base of the given equation.

We have,

LHS = ( 3x2 + x + 2 ) / ( 2x) = ( 3x / 2 ) + ( 1 / 2 ) + ( 1 / x )

RHS = x + 3 + ( 1 / x )

Now, for the equation to hold true, LHS = RHS

( 3x / 2 ) + ( 1 / 2 ) + ( 1 / x ) = x + 3 + ( 1 / x )

⇒ 3x + 1 = 2x + 6

⇒ x = 5

So, the base is 5.


19) Consider the following program in C language:

Which one of the following statements is TRUE?

  1. Compilation fails.
  2. Execution results in a run-time error.
  3. On execution, the value printed is 5 more than the address of variable i.
  4. On execution, the value printed is 5 more than the integer value entered.

Answer: d

Explanation: There is no problem in the program as pi points to a valid location.

Also, in scanf() we pass address of a variable and pi is an address.


20) Let G be a graph with n vertices and m edges. What is the tightest upper bound on the running time on Depth First Search of G? Assume that the graph is represented using adjacency matrix.

  1. O(n)
  2. O(m+n)
  3. O(n2)
  4. O(mn)

Answer: c

Explanation: Depth First Search of a graph takes O(m + n) time when the graph is represented using adjacency list.

In adjacency matrix representation, graph is represented as an "n x n" matrix. To do DFS, for every vertex, we traverse the row corresponding to that vertex to find all adjacent vertices (In adjacency list representation we traverse only the adjacent vertices of the vertex). Therefore time complexity becomes O(n2)


21) Consider a rooted Binary tree represented using pointers. The best upper bound on the time required to determine the number of subtrees having exactly 4 nodes O(na Logn b). Then the value of a + 10b is . . . . . . . .

  1. 1
  2. 11
  3. 12
  4. 21

Answer: a

Explanation: We can find the subtree with 4 nodes in O(n) time. Following can be a simple approach.

1) Traverse the tree in bottom up manner and find size of subtree rooted with current node

2) If size becomes 4, then print the current node.

Following is C implementation


22) Consider the directed graph given below. Which one of the following is TRUE?

GATE-CS-2014 Set 1
  1. The graph doesn't have any topological ordering
  2. Both PQRS and SRPQ are topological ordering
  3. Both PSRQ and SPRQ are topological ordering
  4. PSRQ is the only topological ordering

Answer: c

Explanation: The graph doesn't contain any cycle, so there exist topological ordering.

P and S must appear before R and Q because there are edges from P to R and Q, and from S to R and Q.


23) Let P be a QuickSort Program to sort numbers in ascending order using the first element as pivot. Let t1 and t2 be the number of comparisons made by P for the inputs {1, 2, 3, 4, 5} and {4, 1, 5, 3, 2} respectively. Which one of the following holds?

  1. t1 = 5
  2. t1 < t2
  3. t1 > t2
  4. t1 = t2

Answer: c

Explanation: When first element or last element is chosen as pivot, Quick Sort's worst case occurs for the sorted arrays.

In every step of quick sort, numbers are divided as per the following recurrence.

T(n) = T(n - 1) + O(n)


24) Which one of the following is TRUE?

GATE-CS-2014 Set 1
  1. A
  2. B
  3. C
  4. D

Answer: c

Explanation: (A) L = {a n b n |n >= 0} is not regular because there does not exists a finite automaton that can derive this grammar. Intuitively, finite automaton has finite memory, hence it can't track number of states. It is a standard Context Free Language though.

(B) L = {a n b n |n is prime} is again not regular because there is no way to remember/check if current n is prime or not. Hence, no finite automaton exists to derive this grammar, thus it
is not regular.

(C) L = {w|w has 3k+1 bs} is a regular language because k is a fixed constant and we can easily emulate L as a ∗ba∗ . . . . . . . . . ba∗ such that there are exactly 3k + 1 bs and a ∗ s surrounding each b in
the grammar.

D) L = {ww | w ∈ Σ ∗ } is again not a regular grammar, in fact it is not even a CFG. There is no way to remember and derive double word using finite automaton.

Hence, correct answer would be (C).


25)

GATE-CS-2014 Set 1
  1. {q0, q1, q2}
  2. {q0, q1}
  3. {q0, q1, q2, q3}
  4. {q3}

Answer: a

Explanation:

GATE-CS-2014 Set 1

So, q0, q1 and q2 are reachable states for the input string 0011, but q3 is not.

So, option (A) is answer.


26) A machine has a 32-bit architecture, with 1-word long instructions. It has 64 registers, each of which is 32 bits long. It needs to support 45 instructions, which has an immediate operand in addition to two register operands. Assuming that the immediate operand is an unsigned integer, the maximum value of the immediate operand is . . . . . . . .

  1. 16383

Answer: a

Explanation: 1 Word = 32 bits

Each instruction has 32 bits. To support 45 instructions, opcode must contain 6-bits.

Register operand1 requires 6 bits, since the total registers is 64. Register operand 2 also requires 6 bits. So total 18 bits for all 45 instructions and two register operands. So,

32-18 = 14

14-bits are left over for immediate Operand, now

2^14 - 1 = 16383

We can give maximum 16383.


27) Which one of the following is FALSE?

  1. A basic block is a sequence of instructions where control enters the sequence at the beginning and exits at the end.
  2. Available expression analysis can be used for common subexpression elimination.
  3. Live variable analysis can be used for dead code elimination.
  4. x = 4 ? 5 => x = 20 is an example of common subexpression elimination.

Answer: d

Explanation: (A) A basic block is a sequence of instructions where control enters the sequence at the beginning and exits at the end is TRUE.

(B) Available expression analysis can be used for common subexpression elimination is TRUE. Available expressions are an analysis algorithm+ that determines for each point in the program about the set of expressions that need not be recomputed. Available expression analysis is used to do global common subexpression elimination (CSE). If an expression is available at a point, there is no need to re-evaluate it.

(C) Live variable analysis can be used for dead code elimination is TRUE.

(D) x = 4 ∗ 5 => x = 20 is an example of common subexpression elimination is FALSE.

Common subexpression elimination (CSE) refers to compiler optimization replaces identical expressions (i.e., they all evaluate to the same value) with a single variable holding the computed value when it is worthwhile to do so.

Below is an example

In the following code:

a = b * c + g;

d = b * c * e;

It may be worth transforming the code to:

tmp = b * c;

a = tmp + g;

d = tmp * e;


28) Match the following:

GATE-CS-2014 Set 1
  1. 1 -> a, 2 -> b, 3 -> c, 4 -> d
  2. 1 -> d, 2 -> a, 3 -> b, 4 -> c
  3. 1 -> d, 2 -> b, 3 -> a, 4 -> c
  4. 1->c, 2->a, 3->b, 4->d

Answer: b

Explanation:

  • Waterfall Model: We cannot go back in previous project phase as soon as we proceed to next phase ,So inflexible

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  • Evolutionary:It keeps changing with evolution so incremental in nature

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  • Component based:Reuse-based approach to defining, implementing and composing loosely coupled independent components into systems.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  • Spiral: Spiral model is the most advanced .It includes four faces one of which is Risk.
    • Phases: Planning, Risk Analysis, Engineering and Evaluation

29) Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 90 is serviced after servicing. . . . . . . . . . . . . . . . . . . 2 number of requests.

  1. 1
  2. 2
  3. 3
  4. 4

Answer: c

Explanation: In Shortest-Seek-First algorithm, request closest to the current position of the disk arm and head is handled first.

In this question, the arm is currently at cylinder number 100. Now the requests come in the queue order for cylinder numbers 30, 85, 90, 100, 105, 110, 135 and 145.

The disk will service that request first whose cylinder number is closest to its arm. Hence 1st serviced request is for cylinder no 100 ( as the arm is itself pointing to it ), then 105, then 110, and then the arm comes to service request for cylinder 90. Hence before servicing request for cylinder 90, the disk would have serviced 3 requests.

Hence option C.


30) Which one of the following is FALSE?

  1. User level threads are not scheduled by the kernel.
  2. When a user level thread is blocked, all other threads of its process are blocked.
  3. Context switching between user level threads is faster than context switching between kernel level threads.
  4. Kernel level threads cannot share the code segment

Answer: d

Explanation:

User level thread Kernel level thread
User thread is implemented by user processes. Kernel threads are implemented by OS.
OS doesn't recognize user level threads. Kernel threads are recognized by OS.
Implementation of User threads is easy. Implementation of Kernel thread is complicated.
Context switch time is less. Context switch time is more.
Context switch requires no hardware support. Hardware support is needed.
If one user level thread performs blocking operation then entire process will be blocked. If one kernel thread performs blocking operation then another thread can continue execution.
Example: Java thread, POSIX threads. Example: Window Solaris.

31) Consider the relation scheme R = {E, F, G, H, I, J, K, L, M, M} and the set of functional dependencies {{E, F} -> {G}, {F} -> {I, J}, {E, H} -> {K, L}, K -> {M}, L -> {N} on R. What is the key for R?

  1. {E, F}
  2. {E, F, H}
  3. {E, F, H, K, L}
  4. {E}

Answer: b

Explanation:

All attributes can be derived from {E, F, H}

To solve these kinds of questions that are frequently asked in GATE paper, try to solve it by using shortcuts so that enough amount of time can be saved.

Fist Method:

Using the given options, try to obtain closure of each options. The solution is the one that contains R and also minimal Super Key, i.e. Candidate Key.

A) {E, F}+ = {E, F, G, I, J} ≠ R(The given relation) B) {E, F, H}+ = {E, F, G, H, I, J, K, L, M, N} = R (Correct since each member of the given relation is determined)C) {E, F, H, K, L}+ = {E, F, G, H, I, J, K, L, M, N} = R (Not correct although each member of the given relation can be determined but it is not minimal, since by the definition of Candidate key it should be minimal Super Key)D) {E}+ = {E} ≠ R

Second Method:

Since, {E, F, G, H, I, J, K, L, M, N}+ = {E, F, G, H, I, J, K, L, M, N}{E, F, G, H, I, J, K, L, M}+ = {E, F, G, H, I, J, K, L, M, N} ( Since L -> {N}, hence can replace N by L)In a similar way, K -> {M} hence replace M by K{E, F, G, H, I, J, K, L}+ = {E, F, G, H, I, J, K, L, M, N} Again {E, F, G, H, I, J}+ = {E, F, G, H, I, J, K, L, M, N} (Since {E, H} -> {K, L}, hence replace KL by EH){E, F, G, H}+ = {E, F, G, H, I, J, K, L, M, N} (Since {F} -> {I, J} ){E, F, H}+ = {E, F, G, H, I, J, K, L, M, N} (Since {E, F} -> {G} )


32) Given the following statements:

S1: A foreign key declaration can always be replaced by an equivalent Checkassertion in SQL.

S2: Given the table R(a,b,c) where a and b together form the primary key, the following is a valid table definition.

Which one of the following statements is CORRECT?

  1. S1 is TRUE and S2 is FALSE.
  2. Both S1 and S2 are TRUE.
  3. S1 is FALSE and S2 is TRUE.
  4. Both S1 and S2 are FALSE.

Answer: d

Explanation: Check assertions are not sufficient to replace foreign key. Foreign key declaration may have cascade delete which is not possible by just check insertion.

Using a check condition, we can have the same effect as Foreign key while adding elements to the child table. But when we delete an element from the parent table, the referential integrity constraint is no longer valid. So, a check constraint cannot replace a foreign key.

So, we cannot replace it with a single check.

S2: Given the table R(a, b, c) where a and b together form the primary key, the following is a valid table definition.

False:

Foreign key in one table should uniquely identify a row of another table. In above table definition, table S has a foreign key that refers to field 'a' of R. The field 'a' in table S doesn't uniquely identify a row in table R.


33) Consider the following three statements about link state and distance vector routing protocols, for a large network with 500 network nodes and 4000 links.

[S1] The computational overhead in link state protocols is higher than in distance vector protocols.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[S2] A distance vector protocol (with split horizon) avoids persistent routing loops, but not a linkstate protocol.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[S3] After a topology change, a link state protocol will converge faster than a distance vector protocol.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Which one of the following is correct about S1, S2, and S3 ?

  1. S1, S2, and S3 are all true.
  2. S1, S2, and S3 are all false.
  3. S1 and S2 are true, but S3 is false
  4. S1 and S3 are true, but S2 is false

Answer: d

Explanation:

Link-state:

Every node collects complete graph structureEach computes shortest paths from itEach generates own routing table

Distance-vectorNo one has copy of graphNodes construct their own tables iterativelyEach sends information about its table to neighbours [S1] The computational overhead in link state protocols is higher than in distance vector protocols.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[S2] A distance vector protocol (with split horizon) avoids persistent routing loops, but not a linkstate protocol.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[S3] After a topology change, a link state protocol will converge faster than a distance vectorprotocol.

S1 is clearly true as in Link State all nodes compute shortest path for whole network graph.

S3 is also true as Distance Vector protocol has count to infinity problem and converges slower.

S2 is false. In distance vector protocol, split horizon with poison reverse reduces the chance of forming loops and uses a maximum number of hops to counter the 'count-to-infinity' problem. These measures avoid the formation of routing loops in some, but not all, cases


34) Which of the following are used to generate a message digest by the network security protocols?

(P) RSA

(Q) SHA-1

(R) DES

(S) MD5

  1. P and R only
  2. Q and R only
  3. Q and S only
  4. R and S only

Answer: c

Explanation:

  • RSA - It is an algorithm used toencrypt and decrypt
  • SHA 1 - Secure Hash Algorithm 1, or SHA 1 is acryptographic hash function. It produces a 160 bit (20 byte) hash value (message digest).
  • DES - Data Encryption Standard, or DES is a symmetric key algorithm for encryptionof electronic data.
  • MD5 - Message Digest 5, or MD5 is a widely usedcryptographic hash function that produces a 128-bit hash value (message digest).

Q and S i.e. SHA 1 and MD5 are used to generate a message digest by the network security protocols.

So, C is the correct choice.


35) Identify the correct order in which the following actions take place in an interaction between a web browser and a web server.

1. The web browser requests a webpage using HTTP.

2. The web browser establishes a TCP connection with the web server.

3. The web server sends the requested webpage using HTTP.

4. The web browser resolves the domain name using DNS.

  1. 4, 2, 1, 3
  2. 1, 2, 3, 4
  3. 4, 1, 2, 3
  4. 2, 4, 1, 3

Answer: a

Explanation: The web browser first needs to figure out IP address of site from url using DNS, then establishes a TCP connection, typically at port 80. Once the TCP connection is established, the browser sends a HTTP request using GET. Finally web server responds with HTTP response.


36) Consider a token ring network with a length of 2 km having 10 stations including a monitoring station. The propagation speed of the signal is 2 × 108 m/s and the token transmission time is ignored. If each station is allowed to hold the token for 2 μsec, the minimum time for which the monitoring station should wait (in μsec) before assuming that the token is lost is. . . . . . . . . . .

  1. 28 to 30
  2. 20 to 22
  3. 0 to 2
  4. 31 to 33

Answer: a

Explanation:

Length = 2 km

Propagation Speed v = 2 * 10^8 m/s

Token Holding Time = 2 micro sec

Waiting time = length / speed + (#stations - 1) * (token holding time) to

length / speed + (#stations) * (token holding time)= 28 to 30


37) Let the size of congestion window of a TCP connection be 32 KB when a timeout occurs. The round trip time of the connection is 100 msec and the maximum segment size used is 2 KB. The time taken (in msec) by the TCP connection to get back to 32 KB congestion window is. . . . . . . . . . . ..

  1. 1100 to 1300
  2. 800 to 1000
  3. 1400 to 1600
  4. 1500 to 1700

Answer: a

Explanation:

Current size of congestion window in terms of number of segments= (Size in Bytes)/(Maximum Segment Size) = 32KB / 2KB = 16 MSS

When timeout occurs in TCP's Slow Start algorithm, threshold is

reduced to half which is 16KB or 8MSS. Also, slow start phase begins

where congestion window is increased twice.

So from 1MSS to 8 MSS, window size will grow exponentially.

Congestion window becomes 2MSS after one RTT and becomes 4MSS after

2 RTTs and 8MSS after 3 RTTs. At 8MSS, threshold is reached and

congestion avoidance phase begins. In congestion avoidance phase,

window is increased linearly. So to cover from 8MSS to 16MSS, it needs 8 RTTs.

Together, 11RTTs are needed (3 in slow start phase and 8 in congestionavoidance phase).


38) Consider a selective repeat sliding window protocol that uses a frame size of 1 KB to send data on a 1.5 Mbps link with a one-way latency of 50 msec. To achieve a link utilization of 60%, the minimum number of bits required to represent the sequence number field is. . . . . . . . . .

  1. 3
  2. 4
  3. 5
  4. 6

Answer: c

Explanation:

Transmission delay = Frame Size/bandwidth= (1 * 8 * 1024) / (1.5 * 10^6) = 5.33ms

Propagation delay = 50ms

Efficiency = Window Size / (1 + 2a) = .6

a = Propagation delay/Transmission delay

So, window size = 11.856(approx.)

min sequence number = 2 * window size = 23.712

bits required in Min sequence number = log2(23.712)

Answer is 4.56 =>Ceil(4.56) = 5


39) Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item x, denoted by r(x) and w(x) respectively. Which one of them is conflict serializable.

GATE-CS-2014 Set 1
  1. A
  2. B
  3. C
  4. D

Answer: d

Explanation: In option D, there is no interleaving of operations. The option D has first all operations of transaction 2, then 3 and finally 1 There cannot be any conflict as it is a serial schedule with sequence 2 -> 3 ? > 1


40) Given the following two statements:

Which one of the following is CORRECT?

  1. S1 is TRUE and S2 is FALSE.
  2. Both S1 and S2 are TRUE.
  3. S1 is FALSE and S2 is TRUE.
  4. Both S1 and S2 are FALSE.

Answer: a

Explanation:

S1: Every table with two single-valued attributes is in 1NF, 2NF, 3NF and BCNF.

A relational schema R is in BCNF if in Every non-trivial Functional Dependency X->Y, X is Super Key. If we can prove the relation is in BCNF then by default it would be in 1NF, 2NF, 3NF also.

Let R(AB) be a two-attribute relation, then

  1. If {A -> B} exists then BCNF since {A}+ = AB = R
  2. If {B -> A} exists then BCNF since {B}+ = AB = R
  3. If {A -> B, B -> A} exists then BCNF since A and B both are Super Key now.
  4. If {No non trivial Functional Dependency} then default BCNF.

Hence, it's proved that a Relation with two single - valued attributes is in BCNF hence it's also in 1NF, 2NF, 3NF.

Hence S1 is true.

S2: AB -> C, D -> E, E -> C is a minimal cover for the set of functional dependencies

AB -> C, D -> E, AB -> E, E -> C.

As we know Minimal Cover is the process of eliminating redundant Functional Dependencies and Extraneous attributes in Functional Dependency Set.

So each dependency of F = {AB -> C, D -> E, AB -> E, E -> C} should be implied in minimal cover.

As we can see AB -> E is not covered in minimal cover since {AB}+ = ABC in the given cover {AB -> C, D -> E, E -> C}

Hence, S2 is false.


41) An operating system uses the Banker's algorithm for deadlock avoidance when managing the allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.

GATE-CS-2014 Set 1

There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is
currently in a safe state. Consider the following independent requests for additional resources in the current state:

REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z

REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of Z

Which one of the following is TRUE?

  1. Only REQ1 can be permitted.
  2. Only REQ2 can be permitted.
  3. Both REQ1 and REQ2 can be permitted.
  4. Neither REQ1 nor REQ2 can be permitted

Answer: b

Explanation: This is the current safe state.

AVAILABLE X=3, Y=2, Z=2

GATE-CS-2014 Set 1

Now, if the request REQ1 is permitted, the state would become:

AVAILABLE X=3, Y=2, Z=0

GATE-CS-2014 Set 1

Now, with the current availability, we can service the need of P1. The state would become:

AVAILABLE X = 6, Y = 4, Z = 0

GATE-CS-2014 Set 1

With the resulting availability, it would not be possible to service the need of either P0 or P2, owing to lack of Z resource.

Therefore, the system would be in a deadlock.

⇒ We cannot permit REQ1.

Now, at the given safe state, if we accept REQ2 :

AVAILABLE X = 1 , Y = 2, Z = 2

GATE-CS-2014 Set 1

With this availability, we service P1 (P2 can also be serviced). So, the state is :

GATE-CS-2014 Set 1

With the current availability, we service P2. The state becomes:

GATE-CS-2014 Set 1

Finally, we service P0. The state now becomes:

GATE-CS-2014 Set 1

The state so obtained is a safe state. ⇒ REQ2 can be permitted.

So, only REQ2 can be permitted.

Hence, B is the correct choice.


42) Consider the following set of processes that need to be scheduled on a single CPU. All the times are given in milliseconds.

GATE-CS-2014 Set 1

Using the shortest remaining time first scheduling algorithm, the average process turnaround time (in msec) is . . . . . . .

  1. 7.2
  2. 8
  3. 7
  4. 7.5

Answer: a

Explanation: Turnaround time of a process is total time between submission of the process and its completion. Shortest remaining time (SRT) scheduling algorithm selects the process for execution which has the smallest amount of time remaining until completion.

Solution:

Let the processes be A, C, D and E. These processes will be executed in following order. Gantt chart is as follows:

GATE-CS-2014 Set 1

First 3 sec, A will run, then remaining time A=3, B=2,C=4,D=6,E=3. Now B will get chance to run for 2 sec, then remaining time. A=3, B=0,C=4,D=6,E=3

Now A will get chance to run for 3 sec, then remaining time. A = 0, B = 0,C=4,D=6,E=3 By doing this way, you will get above gantt chart.

Scheduling table:

GATE-CS-2014 Set 1

AT = Arrival Time, BT = Burst Time, CT = Completion Time, TAT = Turn Around Time

As we know, turn-around time is total time between submission of the process and its completion. i.e. turn-around time=completion time-arrival time. i.e., TAT=CT-AT

Turn-around time of A = 8 (8 - 0)

Turn-around time of B = 2 (5 - 3)

Turn-around time of C = 7 (12 - 5)

Turn-around time of D = 14 (21 - 7)

Turnaround time of E = 5 (15 -10)

Average turnaround time is (8 + 2 + 7 + 14 + 5) / 5 = 7.2.

Answer is 7.2.

Alternate Explanation:

After drawing Gantt ChartCompletion Time for processes A, B, C, D and E are 8, 5, 12, 21 and 15 respectively.Turnaround Time = Completion Time - Arrival Time


43) Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is. . . . . . . . . . .

  1. 5
  2. 6
  3. 7
  4. 8

Answer: c

Explanation: In optimal page replacement policy, we replace the place which is not used for longest duration in future.

Given three page frames.

Reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6

Initially, there are three page faults and entries are 1 2 3

Page 4 causes a page fault and replaces 3 (3 is the longestdistant in future), entries become 1 2 4

Total page faults = 3+1 = 4

Pages 2 and 1 don't cause any fault.

5 causes a page fault and replaces 1, entries become 5 2 4

Total page faults = 4 + 1 = 5

3 causes a page fault and replaces 5, entries become 3 2 4

Total page faults = 5 + 1 = 6

3, 2 and 4 don't cause any page fault.

6 causes a page fault.

Total page faults = 6 + 1 = 7


44) A canonical set of items is given below

S --> L.> R

Q --> R.

On input symbol < the set has

  1. a shift-reduce conflict and a reduce-reduce conflict.
  2. a shift-reduce conflict but not a reduce-reduce conflict.
  3. a reduce-reduce conflict but not a shift-reduce conflict.
  4. neither a shift-reduce nor a reduce-reduce conflict.

Answer: d

Explanation: The question is asked with respect to the symbol ' < ' which is not present in the given canonical set of items. Hence it is neither a shift-reduce conflict nor a reduce-reduce conflict on symbol '<'.

Hence D is the correct option.

But if the question would have asked with respect to the symbol ' > ' then it would have been a shift-reduce conflict.


45) Let L be a language and L' be its complement. Which one of the following is NOT a viable possibility?

  1. Neither L nor L' is recursively enumerable (r.e.).
  2. One of L and L' is r.e. but not recursive; the other is not r.e.
  3. Both L and L' are r.e. but not recursive.
  4. Both L and L' are recursive

Answer: c

Explanation:

A) It is possible if L itself is NOT RE. Then L' will also not be RE.

B) Suppose there is a language such that turing machine halts on the input. The given language is RE but not recursive and its complement is NOT RE.

C) This is not possible because if we can write enumeration procedure for both languages and it's complement, then the language becomes recursive.

D) It is possible because L is closed under complement if it is recursive.

Thus, C is the correct choice.


46) Which of the regular expressions given below represent the following DFA?

GATE-CS-2014 Set 1

I) 0*1(1+00*1)*

II) 0*1*1+11*0*1

III) (0+1)*1

  1. I and II only
  2. I and III only
  3. II and III only
  4. I, II, and III

Answer: b

Explanation:

I) 0 * 1(1 + 00 * 1) *

II) 0 * 1 * 1 + 11 * 0 * 1

III) (0 + 1) * 1

(I) and (III) represent DFA.

(II) doesn't represent as the DFA accepts strings like 11011,but the regular expression doesn't accept.


47) There are 5 bags labelled 1 to 5. All the coins in a given bag have the same weight. Some bags have coins of weight 10 gm, others have coins of weight 11 gm. I pick 1, 2, 4, 8, 16 coins respectively from bags 1 to 5. Their total weight comes out to 323 gm. Then the product of the labels of the bags having 11 gm coins is. . . . . . . . . .

  1. 15
  2. 12
  3. 8
  4. 1

Answer: b

Explanation:

There are 5 bags numbered 1 to 5.

We don't know how many bags contain 10 gm and 11 gm coins.

We only know that the total weight of coins is 323.

Now the idea here is to get 3 in the place of total sum's unit digit.

Mark no 1 bag as having 11 gm coins.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Mark no 2 bag as having 10 gm coins.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Mark no 3 bag as having 11 gm coins.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Mark no 4 bag as having 11 gm coins.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Mark no 5 bag as having 10 gm coins.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Note: The above marking is done after getting false

results for some different permutations, the permutations which were giving 3 in the unit place of the total sum.

Now, we have picked 1, 2, 4, 8, 16 coins respectively from bags 1 to 5.

Hence total sum coming from each bag from 1 to 5 is 11,20, 44, 88, 160 gm respectively.

For the above combination we are getting 3 as unit digit in sum.

Let's find out the total sum, it's 11 + 20 + 44 + 88 + 160 = 323.

So it's coming right.

Now 11 gm coins containing bags are 1, 3 and 4.

Hence, the product is: 1 x 3 x 4 = 12.

Alternative solution:

There are bags with coins of weight 11g and 10g. The total weight of 1,2,4,8,16 coins picked from bags 1,2,3,4,5 is given as 323.

Now we need to find no.of coins of 10g and 11g that give a sum of 323g.

Let x be the no.of coins of weight 10g and y be the no.of coins of weight 11g

Therefore 10x + 11y = 323. . . . . . . . . . . . . .1

Now we know the total no.of coins picked i.e. 1+2+4+8+16=31.

Therefore x + y = 31. . . . . . . . . . . . . . . . .2

Solving equations 1 and 2 we get x=18, y=13.

Therefore bags 2 and 5(2+16=x=18) have 10g coins and bags 1, 3 and 4(1+4+8=y=13) have 11g coins.

Therefore the product of the labels of the bags having 11 gm coins is 1 x 3 x 4 = 12.


48) Suppose a polynomial time algorithm is discovered that correctly computes the largest clique in a given graph. In this scenario, which one of the following represents the correct Venn diagram of the complexity classes P, NP and NP Complete (NPC)?

GATE-CS-2014 Set 1
  1. A
  2. B
  3. C
  4. D

Answer: d

Explanation: Clique is an NP complete problem. If one NP complete problem can be solved in polynomial time, then all of them can be. So NPC set becomes equals to P.


49) The minimum number of comparisons required to find the minimum and the maximum of 100 numbers is. . . . . . . . . .

  1. 148
  2. 147
  3. 146
  4. 140

Answer: a

Explanation:

Steps to find minimum and maximum element out of n numbers:

  1. Pick 2 elements(a, b), compare them. (say a > b)
  2. Update min by comparing (min, b)
  3. Update max by comparing (max, a)

Therefore, we need 3 comparisons for each 2 elements, so total number of required comparisons will be (3n)/2 - 2, because we do not need to update min or max in the very first step.

Recurrence relation will be:

T(n) = T(⌈n/2⌉)+T(⌊n/2⌋)+2 = 2T(n/2)+2 = ⌈3n/2⌉-2

By putting the value n=100, (3*100/2)-2 = 148 which is answer.


50) Consider the following C function in which size is the number of elements in the array E:

The value returned by the function MyX is the

  1. maximum possible sum of elements in any sub-array of array E.
  2. maximum element in any sub-array of array E.
  3. sum of the maximum elements in all possible sub-arrays of array E
  4. the sum of all the elements in the array E.

Answer: a

Explanation:

The function does following Y is used to store maximum sum seen so far and Z is used to store current sum

1) Initialize Y as sum of all elements

2) For every element, calculate sum of all subarrays starting with arr[i]. Store the current sum in Z. If Z is greater than Y, then update Y.


51) Consider the following pseudo code. What is the total number of multiplications to be performed?

  1. Half of the product of the 3 consecutive integers.
  2. One-third of the product of the 3 consecutive integers.
  3. One-sixth of the product of the 3 consecutive integers.
  4. None of the above.

Answer: c

Explanation:

The statement "D = D * 3" is executed n*(n+1)*(n-1)/6 times.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Let us see how.

For i = 1, the multiplication statement is executed (n-1) + (n-2) + . . . . . . 2 + 1 times.

For i = 2, the statement is executed (n-2) + (n-3) + . . . . . . . . . . . 2 + 1 times

For i = n-1, the statement is executed once.

For i = n, the statement is not executed at all

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

So overall the statement is executed following times

[(n-1) + (n-2) + . . . . . . . . . . . 2 + 1] + [(n-2) + (n-3) + . . . . . . . . . . . 2 + 1] + . . . . . . . . . . . .+ 1 + 0

The above series can be written as

S = [n*(n-1)/2 + (n-1)*(n-2)/2 +. . . . . . . . . . . + 1]

The sum of above series can be obtained by trick of subtraction the series from standard Series S1 = n2 + (n-1)2 + . . . . . . . . . . 12. The sum of this standard series is n*(n+1)*(2n+1)/6.

S1 - 2S = n + (n-1) +. . . . . . . . . . . 1 = n*(n+1)/2

2S = n*(n+1)*(2n+1)/6 - n*(n+1)/2

S = n*(n+1)*(n-1)/6

The above solution

relies on a trick to obtain the sum of the series, but there is a much more straightforward way of obtaining the same result:

For i = 1, the multiplication statement is executed (n-1) + (n-2) + .. 2 + 1 times.

For i = 2, the statement is executed (n-2) + (n-3) + . . . . . . . . . ..2 + 1 times

Therefore, for each i, the number of times the statement executed is:

GATE-CS-2014 Set 1

This is the sum of n natural numbers from 1 to n - i. Therefore, it can be simplified to:

GATE-CS-2014 Set 1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Multiplying, we will get the following:

GATE-CS-2014 Set 1

Now, this is the number of times the statement will be executed for each i. Therefore, in total, the number of times the statement will be executed is:

GATE-CS-2014 Set 1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ignore the half for the moment. Expanding the summation is simple. You can distribute it across the expression to get this:

GATE-CS-2014 Set 1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Using the formulae for sum of n natural numbers and the sum of squares of n natural numbers, we get:

GATE-CS-2014 Set 1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Simplifying further and taking n/6 as a common term will give you:

GATE-CS-2014 Set 1

Now, take 2 as the common term and use it to cancel out the half that we ignored before. This gives you:

GATE-CS-2014 Set 1

Finally, using a2-b2, you get the required answer:

GATE-CS-2014 Set 1

This should make the solution clear to you now!


52) Consider a hash table with 9 slots. The hash function is ?(k) = k mod 9. The collisions are resolved by chaining. The following 9 keys are inserted in the order: 5, 28, 19, 15, 20, 33, 12, 17, 10. The maximum, minimum, and average chain lengths in the hash table, respectively, are

  1. 3, 0, and 1
  2. 3, 3, and 3
  3. 4, 0, and 1
  4. 3, 0, and 2

Answer: a

Explanation:

Following are values of hash function for all keys

5 --> 5

28 --> 1

19 --> 1 [Chained with 28]

15 --> 6

20 --> 2

33 --> 6 [Chained with 15]

12 --> 3

17 --> 8

10 --> 1 [Chained with 28 and 19]

The maximum chain length is 3. The keys 28, 19


53) Consider a 6-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead of pipelining. When an application is executing on this 6-stage pipeline, the speedup achieved with respect to non-pipelined execution if 25% of the instructions incur 2 pipeline stall cycles is

  1. 4
  2. 8
  3. 6
  4. 7

Answer: a

Explanation:

It was a numerical digit type question so answer must be 4.

As for 6 stages, non-pipelining takes 6 cycles.

There were 2 stall cycles for pipelining for 25% of the instructions

So pipeline time = (1 + (25 / 100) * 2) = 1.5

Speed up = Non pipeline time/Pipeline time = 6 / 1.5 = 4


54) An access sequence of cache block address is of length N and contains n unique block addresses. The number of unique block addresses between two consecutive accesses to the same block address is bounded above by k. What is the miss ration is the access sequence is passed through a cache of associativity A >=k exercising least-recently used replacement policy.

  1. n/N
  2. 1/N
  3. 1/A
  4. k/n

Answer: a

Explanation:

There are N access request for the cache blocks out this n blocks are unique. In between two access of the same block, there are request of

(k-1) other block, And if their associativity >=k and use LRU, then there will be only one cache miss for every unique block i.e., n and it will be the time when the enter the cache for the first time. Therefore Miss ratio =(Cache miss) / (No. of request) = n / N


55) Consider a 4 - to-1 multiplexer with two select lines S1 and S0, given below

GATE-CS-2014 Set 1

The minimal sum-of-products form of the Boolean expression for the output F of the multiplexer is

  1. P'Q + QR' + PQ'R
  2. P'Q + P'QR' + PQR' + PQ'R
  3. P'QR + P'QR' + QR' + PQ'R
  4. PQR'

Answer: a

Explanation:

For 4 to 1 mux

=p'q'(0)+p'q(1)+pq'r+pqr'

=p'q+pq'r+pqr'

=q(p'+pr')+pq'r

=q(p'+r')+pq'r

=p'q+qr'+pq'r

Ans (a)


56) The function f(x) = x sinx satisfies the following equation f"(x) + f(x) + t cosx = 0. The value of t is

  1. -1
  2. -2
  3. 1
  4. 2

Answer: b

Explanation:

We have f(x) = x sin x

⇒ f'(x) = x cos x + sin x

⇒ f′′(x) = x (− sin x ) + cos x + cos x = (−x sin x ) + 2 cos x

Now, it is given that f(x)=x sin x satisfies the equation f′′(x) + f(x) + t cos x = 0

⇒ (−x sin x ) + 2 cos x + x sin x + t cos x = 0

⇒ 2 cos x + t cos x = 0

⇒ cos x ( t + 2 ) = 0

⇒ t + 2 = 0

⇒ t = −2

Thus, B is the correct option.


57) A function is continuous in the interval [0, 2]. It is known that f(0) = f(2) = -1 and f(1) = 1. Which one of the following statements must be true . . . . . . . . .?

  1. There exist a y in the interval (0, 1), such that f(y) = f(y+1)
  2. For every y in the interval (0, 1) , f(y) = f(2-y)
  3. The maximum value of the function in the interval (0, 2) is 1
  4. There exist a y in the interval (0, 1), such that f(y) = -f(2-y)

Answer: a

Explanation:

GATE-CS-2014 Set 1

Since the function is continuous, there must be point between 0 and 1 where it becomes 0 and there must also be a point between 1 and 2 where it becomes 0.


58) Four fair six-sided dice are rolled. The probability that the sum being 22 is X/1296. The value of X is. . . . . . . . . . . . . .

  1. 7
  2. 8
  3. 9
  4. 10

Answer: d

Explanation:

In general, Probability (of an event) = No of favourable outcomes to the event / Total number of possible outcomes in the random experiment.

Here, 4 six-faces dices are tossed, for one dice there can be 6 equally likely and mutually exclusive outcomes.

Taking 4 together, there can be total number of 6*6*6*6 = 1296 possible outcomes.

Now, Number of favourable cases to the event: here event is getting sum as 22.

So, there can be only 2 cases possible.

Case 1: Three 6's and one 4, for example: 6,6,6,4 (sum is 22)

Hence, No of ways we can obtain this = 4!/3! = 4 ways ( 3! is for removing those cases where all three 6 are swapping among themselves)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Case 2: Two 6's and two 5's, for example: 6,6,5,5 (sum is 22)

Hence, No of ways we can obtain this = 4!/( 2! * 2!) = 6 ways ( 2! is for removing those cases where both 6 are swapping between themselves, similarly for both 5 also)

Hence total no of favourable cases = 4 + 6 = 10.

Hence probability = 10/1296.

Therefore option D.


59) A pennant is a sequence of numbers, each number being 1 or 2. An n-pennant is a sequence of numbers with sum equal to n. For example, (1,1,2) is a 4-pennant. The set of all possible 1-pennants is {(1)}, the set of all possible 2-pennants is {(2), (1,1)} and the set of all 3-pennants is {(2,1), (1,1,1), (1,2)}. Note that the pennant (1,2) is not the same as the pennant (2,1). The number of 10-

pennants is - - - - - - - - - - - - -

  1. 88.9 to 89.1

Answer: a

Explanation:

1 - pennant {(1)} - - - - - - - - - - - - - -- - - - - #1

2 - pennant {(1, 1), (2)} - - - - - - - - - - - - - - -#2

3 - pennant {(1, 1, 1), (1, 2), (2, 1)} - - - - - - - - - - - #3

4 - pennant {(1, 1, 1, 1), (2, 2), (1, 1, 2), (1, 2, 1), (2, 1, 1)} - - - - - - - - - - - - - #5

5 - pennant {(1, 1, 1, 1, 1), (2, 1, 1, 1), (1, 2, 1, 1), (1, 1, 2, 1 ), (1, 1, 1, 2), (2, 2, 1), (2, 1, 2),(1, 2, 2)} - - - - - - - - - - - - - --#8

If one can observe carefully they are the terms (part of) a Fibonacci series. (0, 1, 1, 2, 3, 5, 8, 13 . . . . . . . . . . . . . Hence the # of 10-pennant is the 12th term of the series i.e. 89


60) Let S denote the set of all functions f: {0,1}4 -> {0,1}. Denote by N the number of functions from S to the set {0,1}. The value of Log2Log2N is . . . . . . . . . . . . . .

  1. 12
  2. 13
  3. 15
  4. 16

Answer: d

Explanation:

The given mapping S is defined by f:{0,1}^4 -> {0,1} .

So, number of functions from S will be 2^16.

Now N is defined by f: S-> {0,1}.

So, Number of functions from S to {0,1} will be 2^S.

Hence log2log2N = log2S = 16


61) Consider an undirected graph G where self-loops are not allowed. The vertex set of G is {(i,j): 1 <= i<= 12, 1 <= j <= 12}. There is an edge between (a, b) and (c, d) if |a - c| <= 1 and |b - d| <= 1.

The number of edges in this graph is. . . . . . . . . . . . . . . . . .

  1. 500
  2. 502
  3. 506
  4. 510

Answer: c

Explanation:

Given:

The vertex set of G is {(i, j): 1 <= i<= 12, 1 <= j <= 12}.

There is an edge between (a, b) and (c, d) if |a - c| <= 1 and |b - d| <= 1.

There can be total 12*12 possible vertices. The vertices are (1, 1), (1, 2) . . . .. . . .(1, 12) (2, 1), (2, 2), . . . . . . . . . . .

The number of edges in this graph?

Number of edges is equal to number of pairs of vertices that satisfy above conditions. For example, vertex pair {(1, 1), (1, 2)} satisfy above condition.

For (1, 1), there can be an edge to (1, 2), (2, 1), (2, 2). Note that there can be self-loop as mentioned in the question.

Same is count for (12, 12), (1, 12) and (12, 1)

For (1, 2), there can be an edge to (1, 1), (2, 1), (2, 2), (2, 3),(1, 3)

Same is count for (1, 3), (1, 4). . . . . . . . . . .(1, 11), (12, 2), . . . . . . . . . . .(12, 11)

For (2, 2), there can be an edge to (1, 1), (1, 2), (1, 3), (2, 1),(2, 3), (3, 1), (3, 2), (3, 3)

Same is count for remaining vertices.

For all pairs (i, j) there can total 8 vertices connected to them if i and j are not in {1, 12}

There are total 100 vertices without a 1 or 12. So total 800 edges.

For vertices with 1, total edges = (Edges where 1 is first part) +

(Edges where 1 is second part and not first part)

= (3 + 5 * 10 + 3) + (5 * 10) edges

Same is count for vertices with 12

Total number of edges:

= 800 + [(3 + 5 * 10 + 3) + 5 * 10] + [(3 + 5 * 10 + 3) + 5 * 10]

= 800 + 106 + 106 = 1012

Since graph is undirected, two edges from v1 to v2 and v2 to v1

should be counted as one.

So total number of undirected edges = 1012 / 2 = 506.


62) An ordered n-tuple (d1, d2,. . . . . , dn) with d1 >= d2 >=. . . . . . . . .>= dn is called graphic if there exists a simple undirected graph with n vertices having degrees d1, d2, . . . . . . . ., dn respectively. Which of the following 6-tuples is NOT graphic?

  1. (1, 1, 1, 1, 1, 1)
  2. (2, 2, 2, 2, 2, 2)
  3. (3, 3, 3, 1, 0, 0)
  4. (3, 2, 1, 1, 1, 0)

Answer: c

Explanation: The required graph is not possible with the given degree set of (3, 3, 3, 1, 0, 0). Using this 6-tuple, the graph formed will be a Disjoint undirected graph, where the two vertices of the graph should not be connected to any other vertex (i.e., degree will be 0 for both the vertices) of the graph. And for the remaining 4 vertices, the graph needs to satisfy the degrees of (3, 3, 3, 1).

Let's see this with the help of a logical structure of the graph:

Let's say vertices labelled should have their degree as <3, 3, 3, 1, 0, 0> respectively.

GATE-CS-2014 Set 1

Now E and F should not be connected to any vertex in the graph. And A, B, C and D should have their degree as <3, 3, 3, 1> respectively. Now to fulfil the requirement of A, B and C, the node D will never be able to get its degree as 1. Its degree will also become as 3. This is shown in the above diagram.

Hence tuple <3, 3, 3, 1, 0, 0> is not graphic.


63) Which one of the following propositional logic formulas is TRUE when exactly two of p, q, and r are TRUE?

GATE-CS-2014 Set 1
  1. A
  2. B
  3. C
  4. D

Answer: b

Explanation: Draw the truth table of three variables and output will be 1 (true) only when exactly two variables are 1 (true) else output will be 0 (false).

Therefore,

p    q     r   Output (f)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0    0    0    0
0    0    1    0
0    1    0    0
0    1    1    1
1    0    0    0
1    0    1    1
1    1    0    1
1    1    1    0    

f = ( ~p ∧ q ∧ r) ∨ (p ∧ ~q ∧ r) ∨ (p ∧ q ∧ ~r)

f = {( ~p ∧ q ) ∨ (p ∧ ~q )} ∧ r ∨ (p ∧ q ∧ ~r)

f = {(p ⊕ q )} ∧ r ∨ (p ∧ q ∧ ~r)

f = {~ (p ↔ q )} ∧ r ∨ (p ∧ q ∧ ~r)

Hence, option (b) is true.


64) Given the following schema:

employees(emp-id, first-name, last-name, hire-date, dept-id, salary)

departments(dept-id, dept-name, manager-id, location-id)

You want to display the last names and hire dates of all latest hires in their respective departments in the location ID 1700. You issue the following query:

What is the outcome?

  1. It executes but does not give the correct result.
  2. It executes and gives the correct result.
  3. It generates an error because of pairwise comparison.
  4. It generates an error because the GROUP BY clause cannot be used with table joins in a subquery

Answer: b

Explanation: The given query uses below inner query.

SELECT dept-id, MAX(hire-date)FROM employees JOIN departments USING(dept-id)WHERE location-id = 1700GROUP BY dept-id

The inner query produces last max hire-date in every department located at location id 1700.

The outer query simply picks all pairs of inner query. Therefore, the query produces correct result.

SELECT last-name, hire-date FROM employeesWHERE (dept-id, hire-date) IN(Inner-Query);


65) Consider two processors P1 and P2 executing the same instruction set. Assume that under identical conditions, for the same input, a program running on P2 takes 25% less time but incurs 20% more CPI (clock cycles per instruction) as compared to the program running on P1. If the clock frequency of P1 is 1GHz, then the clock frequency of P2 (in GHz) is . . . . . . . . . . . . . ..

  1. 1.6
  2. 3.2
  3. 1.2
  4. 0.8

Answer: a

Explanation:

For P1 clock period = 1ns

Let clock period for P2 bet.

Now consider following equation based on specification

7.5 ns = 12*t ns

We get t and inverse of t will be 1.6GHz


Next TopicGATE 2013





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA