Question 1 |

We __________ our friend’s birthday and we ________ how to make it up to him.

Completely forgot --- don’t just know | |

Forgot completely --- don’t just know | |

Completely forgot --- just don’t know | |

Forgot completely --- just don’t know |

**English**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 1 Explanation:

We

__Completely forgot__our friend’s birthday and we__just don’t know__how to make it up to him.Question 2 |

Choose the statement where underlined word is used correctly.

The industrialist had a personnel jet | |

I write my experience in my personnel diary | |

All personnel are being given the day off | |

Being religious is a personnel aspect |

**English**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 2 Explanation:

personnel mean a body of persons employed in an organization or place of work.

Question 3 |

Based on the given statements, select the most appropriate option to solve the given question.
What will be the total weight of 10 poles each of same weight?

Statements:(I) One fourth of the weight of a pole is 5 kg (II) The total weight of these poles is 160 kg more than the total weight of two poles.

Statement II alone is not sufficient | |

Statement II alone is not sufficient | |

Either I or II alone is sufficient | |

Both statements I and II together are not sufficient. |

**General Aptitude**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 3 Explanation:

(I) is sufficient. We can determine total weight of 1o poles as 10 * 4 * 5 = 200 Kg (II) is also sufficient, we can determine the weight. Let x be the weight of 1 pole. 10*x - 2*x = 160 Kg x = 20 Kg 10x = 200 Kg

Question 4 |

Consider a function f(x) = 1 – |x| on –1 ≤ x ≤ 1. The value of x at which the function attains a maximum and the maximum value of the function are:

0, –1 | |

–1, 0 | |

0, 1 | |

–1, 2 |

**Numerical Methods and Calculus**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 4 Explanation:

f(x) = 1 – |x| f(0) = 1 f(1) = f(-1) = 0 f(0.5) = f(-0.5) = 0.5The maximum is attained at x = 0, and the maximum value is 1.

Question 5 |

A generic term that includes various items of clothing such as a skirt, a pair of trousers and a shirt is

fabric | |

textile | |

fibre | |

apparel |

**English**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 5 Explanation:

apparel means clothing.

Question 6 |

If the list of letters, P, R, S, T, U is an arithmetic sequence, which of the following are also in arithmetic sequence?

1. 2P, 2R, 2S, 2T, 2U 2. P–3, R–3, S–3, T–3, U–3 3. P^{2}, R2, S2, T2, U2

1 only | |

1 and 2 | |

2 and 3 | |

1 and 3 |

**General Aptitude**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 6 Explanation:

1 is AP with common difference as double of that of original series.
2 is AP with common difference as same as original series.

Question 7 |

Four branches of a company are located at M, N, O and P. M is north of N at a distance of 4 km; P is south of O at a distance of 2 km; N is southeast of O by 1 km. What is the distance between M and P in km?

5.34 | |

6.74 | |

28.5 | |

45.49 |

**General Aptitude**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 8 |

a | |

b | |

c | |

d |

**General Aptitude**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 8 Explanation:

Area of a Δ = 1/2 * ac sinB = 1/2 * bc sinA = 1/2 ab sinC Here area (ΔPQR) = area (ΔPQS) + area (ΔPRS) 1/2 rq sin120 = 1/2 PS * r sin60 + 1/2 PS * q sin60 => PS = rq/(r+q)

Question 9 |

If p, q, r, s are distinct integers such that: f(p, q, r, s) = max (p, q, r, s) g(p, q, r, s) = min (p, q, r, s) h(p, q, r, s) = remainder of (p × q) / (r × s) if (p × q) > (r × s) OR remainder of (r × s) / (p × q) if (r × s) > (p × q) Also a function fgh (p, q, r, s) = f(p, q, r, s) × g(p, q, r, s) × h(p, q, r, s). Also the same operation are valid with two variable functions of the form f(p, q). What is the value of fg(h(2, 5, 7, 3), 4, 6, 8)?

6 | |

7 | |

8 | |

9 |

**General Aptitude**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 9 Explanation:

The question asks value of fg (h(2, 5, 7, 3), 4, 6, 8) We need to first find value of h(2, 5, 7, 3) h is defined as h(p, q, r, s) = remainder of (p × q) / (r × s) if (p × q) > (r × s) remainder of (r × s) / (r × q) if (r × s) > (p × q) h(2, 5, 7, 3) = remainder of (7 * 3) / (2 * 5) since 7*3 > 2*5 = 1 fg(1, 4, 6, 8) = f(1, 4, 6, 8) * g(1, 4, 6, 8) = max(1, 4, 6, 8) * min(1, 4, 6, 8) = 8 * 1 = 8

Question 10 |

Out of the following four sentences, select the most suitable sentence with respect to grammar and usage:

Since the report lacked needed information, it was of no use to them | |

The report was useless to them because there were no needed information in it | |

Since the report did not contain the needed information, it was not real useful to them | |

Since the report lacked needed information, it would not had been useful to them |

**English**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 10 Explanation:

Question 11 |

Consider the following transaction involving two bank accounts x and y.

read(x); x := x – 50; write(x); read(y); y := y + 50; write(y)The constraint that the sum of the accounts x and y should remain constant is that of

Atomicity | |

Consistency | |

Isolation | |

Durability |

**Transactions and concurrency control**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 11 Explanation:

Consistency in database systems refers to the requirement that any given database transaction must only change affected data in allowed ways, that is sum of x and y must not change.

Question 12 |

Consider two decision problems Q1, Q2 such that Q1 reduces in polynomial time to 3-SAT and 3-SAT reduces in polynomial time to Q2. Then which one of the following is consistent with the above statement?

Q1 is in NP, Q2 is NP hard | |

Q2 is in NP, Q1 is NP hard | |

Both Q1 and Q2 are in NP | |

Both Q1 and Q2 are in NP hard |

**NP Complete**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 12 Explanation:

Q1 reduces in polynomial time to 3-SAT ==> Q1 is in NP 3-SAT reduces in polynomial time to Q2 ==> Q2 is NP Hard. If Q2 can be solved in P, then 3-SAT can be solved in P, but 3-SAT is NP-Complete, that makes Q2 NP Hard

Question 13 |

Consider the following two statements.

S1: If a candidate is known to be corrupt, then he will not be elected. S2: If a candidate is kind, he will be elected.Which one of the following statements follows from S1 and S2 as per sound inference rules of logic?

If a person is known to be corrupt, he is kind | |

If a person is not known to be corrupt, he is not kind | |

If a person is kind, he is not known to be corrupt | |

If a person is not kind, he is not known to be corrupt |

**Propositional and First Order Logic.**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 13 Explanation:

S1: If a candidate is known to be corrupt, then he will not be elected. S2: If a candidate is kind, he will be elected.If p → q, then ¬q → ¬pSo from S1,elected → not corruptand S2 is,kind → electedTherefore,kind → not corrupt

Question 14 |

A Software Requirements Specification (SRS) document should avoid discussing which one of the following?

User interface issues | |

Non-functional requirements | |

Design specification | |

Interfaces with third party software |

**Software Engineering**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 14 Explanation:

A software requirements specification (SRS) is a description of a software system to be developed, laying out functional and non-functional requirements, and may include a set of use cases that describe interactions the users will have with the software. (Source Wiki)
Design Specification should not be part of SRS.

Question 15 |

The larger of the two eigenvalues of the matrix

⎡ 4 5 ⎤ ⎣ 2 1 ⎦is ____

5 | |

6 | |

7 | |

8 |

**Linear Algebra**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 15 Explanation:

The character equation for given matrix is | 4-λ 5 | = 0 | 2 1-λ| (4-λ)*(1-λ) - 10 = 0 λ^{2}- 5λ - 6 = 0 (λ+1)*(λ-6) = 0 λ = -1, 6 Greater of two Eigenvalues is 6.

Question 16 |

With reference to the B+ tree index of order 1 shown below, the minimum number of nodes (including the root node) that must be fetched in order to satisfy the following query: “Get all records with a search key greater than or equal to 7 and less than 15” is ________

4 | |

5 | |

6 | |

7 |

**B and B+ Trees**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 17 |

The minimum number of JK flip-flops required to construct a synchronous counter with the count sequence (0, 0, 1, 1, 2, 2, 3, 3, 0, 0,...) is ________

0 | |

1 | |

2 | |

3 |

**Digital Logic & Number representation**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 17 Explanation:

Ans = 3, mod 8 up counter using 3 JK flip flops. Ignore the output of LSB

Question 18 |

A link has a transmission speed of 10

^{6}bits/sec. It uses data packets of size 1000 bytes each. Assume that the acknowledgment has negligible transmission delay, and that its propagation delay is the same as the data propagation delay. Also assume that the processing delays at nodes are negligible. The efficiency of the stop-and-wait protocol in this setup is exactly 25%. The value of the one-way propagation delay (in milliseconds) is ___________.4 | |

8 | |

12 | |

16 |

**Transport Layer**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 18 Explanation:

In stop and wait, protocol next packet is sent only when acknowledgement of previous packet is received. This causes poor link utilization. Tansmission speed = 10^{6}Time to send a packet = (1000 * 8) bits / 10^{6}= 8 miliseconds Since link utilization or efficiency is 25%, total time taken for 1 packet is 8 * 100/25 = 32 miliseconds. Total time is twice the one way propagation delay plus transmission delay. Propagation delay has to be considered for packet and ack both. Transmission delay is considered only for packet as the question says that trans. time for ack is negligible. Let propagation delay be x. 2x + 8 = 32. x = 12.

Question 19 |

The number of divisors of 2100 is _________.

42 | |

36 | |

78 | |

72 |

**General Aptitude**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 19 Explanation:

2100 = 2^{2}* 3^{1}* 5^{2}* 7^{1}There are 3 choices for powers of 2, the choices are 0, 1, 2 Similarly, there are 2 choices for powers of 3, 3 choices for power of 5 and 2 choices for power of 7. So total number of divisors is 3 * 2 * 3 * 2 = 36

Question 20 |

A binary tree T has 20 leaves. The number of nodes in T having two children is

18 | |

19 | |

17 | |

Any number between 10 and 20 |

**Binary Trees**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 20 Explanation:

Sum of all degrees = 2 * |E|.
Here considering tree as a k-ary tree :

Sum of degrees of leaves + Sum of degrees for Internal Node except root + Root's degree = 2 * (No. of nodes - 1). Putting values of above terms, L + (I-1)*(k+1) + k = 2 * (L + I - 1) L + k*I - k + I -1 + k = 2*L + 2I - 2 L + K*I + I - 1 = 2*L + 2*I - 2 K*I + 1 - I = L (K-1)*I + 1 = L Given k = 2, L=20 ==> (2-1)*I + 1 = 20 ==> I = 19 ==> T has 19 internal nodes which are having two children.See Handshaking Lemma and Interesting Tree Properties for proof. This solution is contributed by

**Anil Saikrishna Devarasetty**Question 21 |

Consider the following C function.

int fun (int n) { int x=1, k; if (n==1) return x; for (k=1; k<n; ++k) x = x + fun(k) * fun(n – k); return x; }The return value of fun(5) is __________.

0 | |

26 | |

51 | |

71 |

**Recursion**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 21 Explanation:

fun(5) = 1 + fun(1) * fun(4) + fun(2) * fun(3) + fun(3) * fun(2) + fun(4) * fun(1) = 1 + 2*[fun(1)*fun(4) + fun(2)*fun(3)] Substituting fun(1) = 1 = 1 + 2*[fun(4) + fun(2)*fun(3)] Calculating fun(2), fun(3) and fun(4) fun(2) = 1 + fun(1)*fun(1) = 1 + 1*1 = 2 fun(3) = 1 + 2*fun(1)*fun(2) = 1 + 2*1*2 = 5 fun(4) = 1 + 2*fun(1)*fun(3) + fun(2)*fun(2) = 1 + 2*1*5 + 2*2 = 15 Substituting values of fun(2), fun(3) and fun(4) fun(5) = 1 + 2*[15 + 2*5] = 51

Question 22 |

Consider the basic COCOMO model where E is the effort applied in person-months, D is the development time in chronological months, KLOC is the estimated number of delivered lines of code (in thousands) and a

_{b}, b_{b}, c_{b}, d_{b}have their usual meanings. The basic COCOMO equations are of the form.E = a _{b}(KLOC) exp(b_{b}), D = c_{b}(E) exp(d_{b}) | |

D = a _{b}(KLOC) exp(b_{b}), E = c_{b}(D) exp(d_{b}) | |

E = a _{b} exp(b_{b}), D = c_{b}(KLOC) exp(d_{b}) | |

E = a _{b} exp(d_{b}), D = c_{b}(KLOC) exp(b_{b}) |

**Software Engineering**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 22 Explanation:

In Basic COCOMO, following are true.

**Effort Applied (E)**= a_{b}(KLOC)^{bb}**[ person-months ]****Development Time (D)**= c_{b}(Effort Applied)^{db}**[months]****People required (P)**= Effort Applied / Development Time**[count]**

Question 23 |

Which one of the following statements is NOT correct about HTTP cookies?

A cookies is a piece of code that has the potential to compromise the security of an Internet user | |

A cookie gains entry to the user’s work area through an HTTP header | |

A cookie has an expiry date and time | |

Cookies can be used to track the browsing pattern of a user at a particular site |

**Application Layer**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 23 Explanation:

Cookies are not piece of code, they are just strings typically in the form of key value pairs.

Question 24 |

In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is True?

In both AST and CFG, let node N2 be the successor of node N1. In the input program, the code corresponding to N2 is present after the code corresponding to N1 | |

For any input program, neither AST nor CFG will contain a cycle | |

The maximum number of successors of a node in an AST and a CFG depends on the input program | |

Each node in AST and CFG corresponds to at most one statement in the input program |

**Parsing and Syntax directed translation**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 24 Explanation:

(A) is false, In CFG (Control Flow Graph), code of N2 may be present before N1 when there is a loop or goto. (B) is false, CFG (Control Flow Graph) contains cycle when input program has loop. (C) is true, successors in AST and CFG depedend on input program (D) is false, a single statement may belong to a block of statements.

Question 25 |

Consider the following function written in the C programming language.
The output of the above function on input “ABCD EFGH” is

void foo (char *a) { if (*a && *a != ` `) { foo(a+1); putchar(*a); } }

ABCD EFGH | |

ABCD | |

HGFE DCBA | |

DCBA |

**String**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 25 Explanation:

The program prints all characters before ' ' or '\0' (whichever comes first) in reverse order.
Let's assume that Base address of given Array is 1000. It can be represented as given below in the image
Below is the complete Recursion Stack of the Given Code
After calling foo(1004), recursion will return as character at 1004 is ‘ ’. foo(1004) will return to its caller which is foo(1003) and next line in foo(1003) will be executed which will print character at 1003 (‘D’). foo(1003) will then return to foo(1002) and character at 1002 (‘C’) will get printed and the process will continue till foo(1000).
This solution is contributed by

**Pranjul Ahuja**.Question 26 |

Let R be the relation on the set of positive integers such that aRb if and only if a and b are distinct and have a common divisor other than 1. Which one of the following statements about R is True?

R is symmetric and reflexive but not transitive | |

R is reflexive but not symmetric and not transitive | |

R is transitive but not reflexive and not symmetric | |

R is symmetric but not reflexive and not transitive |

**Set Theory & Algebra**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 26 Explanation:

R cannot be reflexive as 'a' and 'b' have to be distinct in aRb.
R is symmetric if a and b have a common divisor, then b and a also have.
R is not transitive as aRb and bRc doesn't mean aRc. For example 3 and 15 have common divisor, 15 and 5 have common divisor, but 3 and 5 don't have.

Question 27 |

Consider a complete binary tree where the left and the right subtrees of the root are max-heaps. The lower bound for the number of operations to convert the tree to a heap is

Ω(logn) | |

Ω(n) | |

Ω(nlogn) | |

Ω(n ^{2}) |

**Binary Trees**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 27 Explanation:

The answer to this question is simply max-heapify function. Time complexity of max-heapify is O(Log n) as it recurses at most through height of heap.

// A recursive method to heapify a subtree with root at given index // This method assumes that the subtrees are already heapified void MinHeap::MaxHeapify(int i) { int l = left(i); int r = right(i); int largest = i; if (l < heap_size && harr[l] < harr[i]) largest = l; if (r < heap_size && harr[r] < harr[smallest]) largest = r; if (largest != i) { swap(&harr[i], &harr[largest]); MinHeapify(largest); } }See Binary Heap for details.

Question 28 |

The cardinality of the power set of {0, 1, 2 . . ., 10} is _________.

1024 | |

1023 | |

2048 | |

2043 |

**Set Theory & Algebra**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 28 Explanation:

The power set has 2

^{n}elements. For n = 11, size of power set is 2048.Question 29 |

Match the following:

List-I List-II A. Lexical analysis 1. Graph coloring B. Parsing 2. DFA minimization C. Register allocation 3. Post-order traversal D. Expression evaluation 4. Production tree

Codes: A B C D (a) 2 3 1 4 (b) 2 1 4 3 (c) 2 4 1 3 (d) 2 3 4 1

a | |

b | |

c | |

d |

**Parsing and Syntax directed translation**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 29 Explanation:

Register allocation is a variation of Graph Coloring problem. Lexical Analysis uses DFA. Parsing makes production tree Expression evaluation is done using tree traversal

Question 30 |

Identify the correct order in which a server process must invoke the function calls accept, bind, listen, and recv according to UNIX socket API.

listen, accept, bind recv | |

bind, listen, accept, recv | |

bind, accept, listen, recv | |

accept, listen, bind, recv |

**Transport Layer**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 30 Explanation:

bind, listen, accept and recv are

**server side socket API functions**.A server must first do bind() to tell operating system the port number on which it would be listing, then it must listen to receive incoming connection requests on the bound port number. Once a connection comes, the server accepts using accept(), then starts receiving data using recv().bind()associates a socket with a socket address structure, i.e. a specified local port number and IP address.listen()causes a bound TCP socket to enter listening state.accept()accepts a received incoming attempt to create a new TCP connection from the remote client,recv()is used to receive data from a remote socket.

Question 31 |

Consider the following statements:

1. The complement of every Turning decidable language is Turning decidable 2. There exists some language which is in NP but is not Turing decidable 3. If L is a language in NP, L is Turing decidableWhich of the above statements is/are True?

Only 2 | |

Only 3 | |

Only 1 and 2 | |

Only 1 and 3 |

**Undecidability**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 31 Explanation:

1 is true: Complement of Turing decidable is Turing Decidable.3 is true. All NP problems are Turing decidable (See http://www.geeksforgeeks.org/np-completeness-set-1/)2 is false:The definition of NP itself says solvable in polynomial time using non-deterministic Turing machine.

Question 32 |

An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is

Θ(nlogn) | |

Θ(n) | |

Θ(logn) | |

Θ(1) |

**Analysis of Algorithms**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 32 Explanation:

We only need to consider any 3 elements and compare them. So the number of comparisons is constants, that makes time complexity as Θ(1)
The catch here is, we need to return any element that is neither maximum not minimum.
Let us take an array {10, 20, 15, 7, 90}. Output can be 10 or 15 or 20
Pick any three elements from given liar. Let the three elements be 10, 20 and 7.
Using 3 comparisons, we can find that the middle element is 10.

Question 33 |

A system has 6 identical resources and N processes competing for them. Each process can request atmost 2 resources. Which one of the following values of N could lead to a deadlock?

1 | |

2 | |

3 | |

4 |

**GATE-CS-2015 (Set 2)**

**Deadlock**

**Discuss it**

Question 33 Explanation:

It seems to be wrong question in GATE exam. Below seems to be the worst case situation. In below situation P1 and P2 can continue as they have 2 resources each

P1 --> 2 P2 --> 2 P3 --> 1 P4 --> 1

Question 34 |

Assume that for a certain processor, a read request takes 50 nanoseconds on a cache miss and 5 nanoseconds on a cache hit. Suppose while running a program, it was observed that 80% of the processor’s read requests result in a cache hit. The average read access time in nanoseconds is____________.

10 | |

12 | |

13 | |

14 |

**Computer Organization and Architecture**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 34 Explanation:

The average read access time in nanoseconds
= 0.8 * 5 + 0.2*50
= 14

Question 35 |

A computer system implements a 40 bit virtual address, page size of 8 kilobytes, and a 128-entry translation look-aside buffer (TLB) organized into 32 sets each having four ways. Assume that the TLB tag does not store any process id. The
minimum length of the TLB tag in bits is _________

20 | |

10 | |

11 | |

22 |

**Memory Management**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 35 Explanation:

Total virtual address size = 40 Since there are 32 sets, set offset = 5 Since page size is 8kilobytes, word offset = 13 Minimum tag size = 40 - 5- 13 = 22

Question 36 |

Let f(x) = x

^{–(1/3)}and A denote the area of the region bounded by f(x) and the X-axis, when x varies from –1 to 1. Which of the following statements is/are True?1. f is continuous in [–1, 1] 2. f is not bounded in [–1, 1] 3. A is nonzero and finite

2 only | |

3 only | |

2 and 3 only | |

1, 2 and 3 |

**Numerical Methods and Calculus**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 36 Explanation:

**1 is false:**function is not a Continuous function. As a change of 1 in x leads to ∞ change in f(x). For example when x is changed from -1 to 0. At x = 0, f(x) is ∞ and at x = 1, f(x) is finite.

**2 is True:**f(x) is not a bounded function as it becomes ∞ at x = 0.

**3 is true:**A denote the area of the region bounded by f(x) and the X-axis. This area is bounded, we can calculate it by doing integrating the function [See this]

Question 37 |

Perform the following operations on the matrix

⎡ 3 4 45⎤ ⎢ 7 8 105⎥ ⎣13 2 195⎦ 1. Add the third row to the second row. 2. Subtract the third column from the first column.The determinant of the resultant matrix is _____________.

0 | |

1 | |

50 | |

100 |

**Linear Algebra**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 37 Explanation:

The given matrix is singular matrix as its last column is a multiple of first column. If we multiply 15 with first column, we get the third column.

Question 38 |

A graph is self-complementary if it is isomorphic to its complement. For all self-complementary graphs on n vertices, n is

A multiple of 4 | |

Even | |

Odd | |

Congruent to 0 mod 4, or 1 mod 4 |

**Graph Theory**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 38 Explanation:

An n-vertex self-complementary graph has exactly half number of edges of the complete graph, i.e., n(n − 1)/4 edges, and (if there is more than one vertex) it must have diameter either 2 or 3. Since n(n −1) must be divisible by 4, n must be congruent to 0 or 1 mod 4; for instance, a 6-vertex graph cannot be self-complementary.
Source: http://en.wikipedia.org/wiki/Self-complementary_graph

Question 39 |

Consider the intermediate code given below:

1. i = 1 2. j = 1 3. t1 = 5 * i 4. t2 = t1 + j 5. t3 = 4 * t2 6. t4 = t3 7. a[t4] = –1 8. j = j + 1 9. if j <= 5 goto(3) 10. i = i + 1 11. if i < 5 goto(2)The number of nodes and edges in the control-flow-graph constructed for the above code, respectively, are

5 and 7 | |

6 and 7 | |

5 and 5 | |

7 and 8 |

**Code Generation and Optimization**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 39 Explanation:

Below is control flow graph of above code.

Question 40 |

Consider six memory partitions of size 200 KB, 400 KB, 600 KB, 500 KB, 300 KB, and 250 KB, where KB refers to kilobyte. These partitions need to be allotted to four processes of sizes 357 KB, 210 KB, 468 KB and 491 KB in that order. If the best fit algorithm is used, which partitions are NOT allotted to any process?

200 KB and 300 KB | |

200 KB and 250 KB | |

250 KB and 300 KB | |

300 KB and 400 KB |

**Memory Management**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 40 Explanation:

Best fit allocates the smallest block among those that are large enough for the new process. So the memory blocks are allocated in below order.

357 ---> 400 210 ---> 250 468 ---> 500 491 ---> 600Sot the remaining blocks are of 200 KB and 300 KB Refer http://courses.cs.vt.edu/~csonline/OS/Lessons/MemoryAllocation/index.html for details of all allocation strategies.

Question 41 |

A Young tableau is a 2D array of integers increasing from left to right and from top to bottom. Any unfilled entries are marked with ∞, and hence there cannot be any entry to the right of, or below a ∞. The following Young tableau consists of unique entries.

1 2 5 14 3 4 6 23 10 12 18 25 31 ∞ ∞ ∞When an element is removed from a Young tableau, other elements should be moved into its place so that the resulting table is still a Young tableau (unfilled entries may be filled in with a ∞). The minimum number of entries (other than 1) to be shifted, to remove 1 from the given Young tableau is ____________

2 | |

5 | |

6 | |

18 |

**Misc**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 41 Explanation:

Initially

When 1 is removed, it is replaced by the smallest adjacent which is 2.12 5 14 3 4 6 23 10 12 18 25 31 ∞ ∞ ∞

2When 2 is moved in place of 1, it is replaced by smallest adjacent which is 425 14 3 4 6 23 10 12 18 25 31 ∞ ∞ ∞

2 4 5 14 3When 4 is moved in place of 2, it is replaced by smallest adjacent which is 646 23 10 12 18 25 31 ∞ ∞ ∞

2 4 5 14 3 6When 6 is moved in place of 4, it is replaced by smallest adjacent which is 18.623 10 12 18 25 31 ∞ ∞ ∞

2 4 5 14 3 6 18 23 10 12When 18 is moved in place of 6, it is replaced by smallest adjacent which is 25.1825 31 ∞ ∞ ∞

2 4 5 14 3 6 18 23 10 12 25When 25 is moved in place of 18, it is replaced by smallest adjacent which is ∞.2531 ∞ ∞ ∞

2 4 5 14 3 6 18 23 10 12 25 ∞ 31 ∞ ∞ ∞Shifted numbers are 2, 4, 6, 18, 25

Question 42 |

Consider two relations R1(A, B) with the tuples (1, 5), (3, 7) and R1(A, C) = (1, 7), (4, 9). Assume that R(A,B,C) is the full natural outer join of R1 and R2. Consider the following tuples of the form (A,B,C)

a = (1, 5, null), b = (1, null, 7), c = (3, null, 9), d = (4, 7, null), e = (1, 5, 7), f = (3, 7, null), g = (4, null, 9).Which one of the following statements is correct?

R contains a, b, e, f, g but not c, d | |

R contains a, b, c, d, e, f, g | |

R contains e, f, g but not a, b | |

R contains e but not f, g |

**Set Theory & Algebra**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 42 Explanation:

Below is R1 A | B ----------- 1 | 5 3 | 7 Below is R2 A | C ----------- 1 | 7 4 | 9 Full outer join of above two is A | B | C ------------------- 1 | 5 | 7 3 | 7 | NULL 4 | NULL | 9So the full outer join contains e = (1, 5, 7), f = (3, 7, null), g = (4, null, 9).

Question 43 |

Which one of the following hash functions on integers will distribute keys most uniformly over 10 buckets numbered 0 to 9 for i ranging from 0 to 2020?

h(i) =i ^{2} mod 10 | |

h(i) =i ^{3} mod 10 | |

h(i) = (11 ∗ i ^{2}) mod 10 | |

h(i) = (12 ∗ i) mod 10 |

**Hash**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 43 Explanation:

Since mod 10 is used, the last digit matters.
If you do cube all numbers from 0 to 9, you get following

Number Cube Last Digit in Cube 0 0 0 1 1 1 2 8 8 3 27 7 4 64 4 5 125 5 6 216 6 7 343 3 8 512 2 9 729 9Therefore all numbers from 0 to 2020 are equally divided in 10 buckets. If we make a table for square, we don't get equal distribution. In the following table. 1, 4, 6 and 9 are repeated, so these buckets would have more entries and buckets 2, 3, 7 and 8 would be empty.

Number Square Last Digit in Cube 0 0 0 1 112 443 994 1665 25 5 6 3667 4998 6449 811

Question 44 |

Assume that the bandwidth for a TCP connection is 1048560 bits/sec. Let α be the value of RTT in milliseconds (rounded off to the nearest integer) after which the TCP window scale option is needed. Let β be the maximum possible window size with window scale option. Then the values of α and β are.

63 milliseconds 65535 × 2 ^{14} | |

63 milliseconds 65535 × 2 ^{16} | |

500 milliseconds 65535 × 2 ^{14} | |

500 milliseconds 65535 × 2 ^{16} |

**Transport Layer**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 44 Explanation:

Since sequence number in TCP header is limited to 16 bits, the maximum window size is limited. When bandwidth delay product of a link is high, scaling is required to efficiently use link. TCP allows scaling of windows when bandwidth delay product is greater than 65,535 (Refer this).
The bandwidth delay product for given link is 1048560 * α. Window scaling is needed when this value is more than 65535 bytes, i.e., when α is greater than 65535 * 8 / 1048560 or 0.5 seconds.
Scaling is done by specifying a one byte shift count in the header options field. The true receive window size is left shifted by the value in shift count. A maximum value of 14 may be used for the shift count value. Therefore maximum window size with scaling option is 65535 × 2

^{14}.Question 45 |

Consider alphabet ∑ = {0, 1}, the null/empty string λ and the sets of strings X

_{0}, X_{1}and X_{2}generated by the corresponding non-terminals of a regular grammar. X_{0}, X_{1}and X_{2}are related as follows:XWhich one of the following choices precisely represents the strings in X_{0}= 1 X_{1}X_{1}= 0 X_{1}+ 1 X_{2}X_{2}= 0 X_{1}+ {λ}

_{0}?10 (0* + (10)*)1 | |

10 (0* + (10)*)*1 | |

1(0* + 10)*1 | |

10 (0 + 10)*1 + 110 (0 + 10)*1 |

**Regular languages and finite automata**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 45 Explanation:

The smallest possible string by given grammar is "11". X0 = 1X1 = 11X2 [Replacing X1 with 1X2] = 11 [Replacing X2 with λ]The string "11" is only possible with option (C).

Question 46 |

Given below are some algorithms, and some algorithm design paradigms.

List-I A. Dijkstra’s Shortest Path B. Floyd-Warshall algorithm to compute all pairs shortest path C. Binary search on a sorted array D. Backtracking search on a graph List-II 1. Divide and Conquer 2. Dynamic Programming 3. Greedy design 4. Depth-first search 5. Breadth-first searchMatch the above algorithms on the left to the corresponding design paradigm they follow Codes:

A B C D (a) 1 3 1 5 (b) 3 3 1 5 (c) 3 2 1 4 (d) 3 2 1 5

a | |

b | |

c | |

d |

**Misc**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 46 Explanation:

Dijkstra’s Shortest Path is a Greedy Algorithm. Floyd-Warshall algorithm is Dynamic Programming. Binary search is a Divide and Conquer. Backtracking is Depth-first search

Question 47 |

The number of min-terms after minimizing the following Boolean expression is _________.

[D′ + AB′ + A′C + AC′D + A′C′D]′

1 | |

2 | |

3 | |

4 |

**Digital Logic & Number representation**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 47 Explanation:

Given Boolean expression is: [D′ + AB′ + A′C + AC′D + A′C′D]′ Step 1 : [D′ + AB′ + A′C + C′D ( A + A')]′ ( taking C'D as common ) Step 2 : [D′ + AB′ + A′C + C′D]′ ( as, A + A' = 1 ) : [D' + DC' + AB' + A'C]' (Rearrange) Step 3 : [D' + C' + AB' + A'C]' ( Rule of Duality, A + A'B = A + B ) : [D' + C' + CA' + AB']' (Rearrange) Step 4 : [D' + C' + A' + AB']' (Rule of Duality) : [D' + C' + A' + AB']' (Rearrange) Step 5 : [D' + C' + A' + B']' (Rule of Duality) :[( D' + C' )'.( A' + B')'] (Demorgan's law, (A + B)'=(A'. B')) :[(D''.C'').( A''.B'')] (Demorgan's law) :[(D.C).(A.B)] (Idempotent law, A'' = A) : ABCD Hence only 1 minterm after minimization.

Question 48 |

Consider the C program below.

#include <stdio.h> int *A, stkTop; int stkFunc (int opcode, int val) { static int size=0, stkTop=0; switch (opcode) { case -1: size = val; break; case 0: if (stkTop < size ) A[stkTop++]=val; break; default: if (stkTop) return A[--stkTop]; } return -1; } int main() { int B[20]; A=B; stkTop = -1; stkFunc (-1, 10); stkFunc (0, 5); stkFunc (0, 10); printf ("%d\n", stkFunc(1, 0)+ stkFunc(1, 0)); }The value printed by the above program is ___________

9 | |

10 | |

15 | |

17 |

**Loops & Control Structure**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 48 Explanation:

The code in main, basically initializes a stack of size 10, then pushes 5, then pushes 10.
Finally the printf statement prints sum of two pop operations which is 10 + 5 = 15.

stkFunc (-1, 10); // Initialize size as 10 stkFunc (0, 5); // push 5 stkFunc (0, 10); // push 10 // print sum of two pop printf ("%d\n", stkFunc(1, 0) + stkFunc(1, 0));

Question 49 |

The secant method is used to find the root of an equation f(x) = 0. It is started from two distinct estimates x

_{a}and x_{b}for the root. It is an iterative procedure involving linear interpolation to a root. The iteration stops if f(x_{b}) is very small and then x_{b}is the solution. The procedure is given below. Observe that there is an expression which is missing and is marked by? Which is the suitable expression that is to be put in place of? So that it follows all steps of the secant method?**Secant**Initialize: x_{a}, x_{b}, ε, N // ε = convergence indicator f_{b}= f(x_{b}) i = 0 while (i < N and |f_{b}| > ε) do i = i + 1 // update counter x_{t}= ? // missing expression for // intermediate value x_{a}= x_{b}// reset x_{a}x_{b}= x_{t}// reset x_{b}f_{b}= f(x_{b}) // function value at new x_{b}end while if |f_{b}| > ε then // loop is terminated with i = N write “Non-convergence” else write “return x_{b}” end if

x _{b} – (f_{b}– f(x_{a})) f_{b}/ (x_{b} – x_{a}) | |

x _{a}– (f_{a}– f(x_{a})) f_{a}/ (x_{b} – x_{a}) | |

x _{b} – (f_{b} – x_{a}) f_{b}/ (x_{b} – f_{b}(x_{a}) | |

x _{a} – (x_{b} – x_{a}) f_{a}/ (f_{b} – f(x_{a})) |

**Divide and Conquer**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 49 Explanation:

Question 50 |

The number of onto functions (surjective functions) from set X = {1, 2, 3, 4} to set Y = {a, b, c} is ________________

36 | |

64 | |

81 | |

72 |

**Set Theory & Algebra**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 50 Explanation:

A function f from X to Y is called onto if for all 'y' in Y there is an 'x' in X such that f(x) = y.
In onto functions, all elements in Y are used.
Source: http://www.regentsprep.org/regents/math/algtrig/atp5/OntoFunctions.htm
Every Surjective or Onto function sends two elements of {1, 2, 3, 4} to the same element of {a, b, c}. There are

^{4}C_{2}= 6 such pairs of elements. The pairs are {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}. For a given pair {i, j} ⊂ {1, 2, 3, 4}, there are 3! sujective functions such that f(i) = f(j). Hence there are total 6 * 6 = 36 surjective functions.Question 51 |

Consider the following routing table at an IP router
For each IP address in Group-I identify the correct choice of the next hop from Group-II using the entries from the routing table above.

List-I List-II A. 128.96.171.92 1. Interface 0 B. 128.96.167.151 2. Interface 1 C. 128.96.163.121 3. R2 D. 128.96.165.121 4. R3 5. R4 Codes: A B C D (a) 1 3 5 4 (b) 1 4 2 5 (c) 2 3 4 5 (d) 2 3 5 4

a | |

b | |

c | |

d |

**GATE-CS-2015 (Set 2)**

**IP Addressing**

**Discuss it**

Question 51 Explanation:

The next hop is decide according to the longest prefix matching. Refer following link for details.
https://www.youtube.com/watch?v=PSC5omE3pX8&list=PLkHsKoi6eZnzJl1qTzmvBwTxrSJW4D2Jj&index=32

Question 52 |

Consider a processor with byte-addressable memory. Assume that all registers, including Program Counter (PC) and Program Status Word (PSW), are of size 2 bytes. A stack in the main memory is implemented from memory location (0100)

_{16}and it grows upward. The stack pointer (SP) points to the top element of the stack. The current value of SP is (016E)_{16}. The CALL instruction is of two words, the first word is the op-code and the second word is the starting address of the subroutine (one word = 2 bytes). The CALL instruction is implemented as follows:• Store the current value of PC in the stack. • Store the value of PSW register in the stack. • Load the starting address of the subroutine in PC.The content of PC just before the fetch of a CALL instruction is (5FA0)

_{16}. After execution of the CALL instruction, the value of the stack pointer is(016A) _{16} | |

(016C) _{16} | |

(0170) _{16} | |

(0172) _{16} |

**Computer Organization and Architecture**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 52 Explanation:

The current value of SP is (016E)_{16}The value of SP after following operations is asked in question • Store the current value of PC in the stack. This operation increments SP by 2 bytes as size of PC is given 2 bytes in question. So becomes (016E)_{16}+ 2 = (0170)_{16}• Store the value of PSW register in the stack. This operation also increments SP by 2 bytes as size of PSW is also given 2 bytes. So becomes (0170)_{16}+ 2 = (0172)_{16}• Load the starting address of the subroutine in PC. The Load operation doesn't change SP. So new value of SP is (016E)_{16}

Question 53 |

Which one of the following assertions concerning code inspection and code walkthrough is True?

Code inspection is carried out once the code has been unit tested | |

Code inspection and code walkthrough are synonyms | |

Adherence to coding standards is checked during code inspection | |

Code walkthrough is usually carried out by an independent test team |

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 53 Explanation:

**A is False:**It is not necessary that code inspection is carried out once the code has been unit tested.

**B and D are false:**Code walkthrough or walk-through is a form of software peer review in which a designer or programmer leads members of the development team and other interested parties through a software product, and the participants ask questions and make comments about possible errors, violation of development standards, and other problems" Inspection in software engineering, refers to peer review of any work product by trained individuals who look for defects using a well defined process. Sources: https://en.wikipedia.org/wiki/Software_walkthrough https://en.wikipedia.org/wiki/Code_review

Question 54 |

Consider the sequence of machine instructions given below:

MUL R5, R0, R1 DIV R6, R2, R3 ADD R7, R5, R6 SUB R8, R7, R4In the above sequence, R0 to R8 are general purpose registers. In the instructions shown, the first register stores the result of the operation performed on the second and the third registers. This sequence of instructions is to be executed in a pipelined instruction processor with the following 4 stages: (1) Instruction Fetch and Decode (IF), (2) Operand Fetch (OF), (3) Perform Operation (PO) and (4) Write back the Result (WB). The IF, OF and WB stages take 1 clock cycle each for any instruction. The PO stage takes 1 clock cycle for ADD or SUB instruction, 3 clock cycles for MUL instruction and 5 clock cycles for DIV instruction. The pipelined processor uses operand forwarding from the PO stage to the OF stage. The number of clock cycles taken for the execution of the above sequence of instructions is ___________

11 | |

12 | |

13 | |

14 |

**Computer Organization and Architecture**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 54 Explanation:

1 2 3 4 5 6 7 8 9 10 11 12 13 IF OF PO PO PO WB IF OF PO PO PO PO PO WB IF OF PO WB IF OF PO WB

Question 55 |

Suppose you are provided with the following function declaration in the C programming language.

int partition (int a[], int n);The function treats the first element of a[] as a pivot, and rearranges the array so that all elements less than or equal to the pivot is in the left part of the array, and all elements greater than the pivot is in the right part. In addition, it moves the pivot so that the pivot is the last element of the left part. The return value is the number of elements in the left part. The following partially given function in the C programming language is used to find the kth smallest element in an array a[ ] of size n using the partition function. We assume k ≤ n

int kth_smallest (int a[], int n, int k) { int left_end = partition (a, n); if (left_end+1==k) { return a [left_end]; } if (left_end+1 > k) { return kth_smallest (____________________); } else { return kth_smallest (____________________); } }The missing argument lists are respectively

(a, left_end, k) and (a+left_end+1, n–left_end–1, k–left_end–1) | |

(a, left_end, k) and (a, n–left_end–1, k–left_end–1) | |

(a, left_end+1, N–left_end–1, K–left_end–1) and(a, left_end, k) | |

(a, n–left_end–1, k–left_end–1) and (a, left_end, k) |

**Divide and Conquer**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 55 Explanation:

Question 56 |

Consider a simple checkpointing protocol and the following set of operations in the log.

(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7); (checkpoint); (start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3); (write, T3, z, 7, 2);If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the undo list and the redo list

Undo: T3, T1; Redo: T2 | |

Undo: T3, T1; Redo: T2, T4 | |

Undo: none; Redo: T2, T4, T3; T1 | |

Undo: T3, T1, T4; Redo: T2 |

**Transactions and concurrency control**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 56 Explanation:

Since T1 and T3 are not committed yet, they must be undone. The transaction T2 must be redone because it is after the latest checkpoint.

Question 57 |

A Computer system implements 8 kilobyte pages and a 32-bit physical address space. Each page table entry contains a valid bit, a dirty bit three permission bits, and the translation. If the maximum size of the page table of a process is 24 megabytes, the length of the virtual address supported by the system is _______________ bits

36 | |

32 | |

28 | |

40 |

**Memory Management**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 57 Explanation:

Max size of virtual address can be calculated by calculating maximum number of page table entries. Maximum Number of page table entries can be calculated using given maximum page table size and size of a page table entry. Given maximum page table size = 24 MB Let us calculate size of a page table entry. A page table entry has following number of bits. 1 (valid bit) + 1 (dirty bit) + 3 (permission bits) + x bits to store physical address space of a page. Value of x = (Total bits in physical address) - (Total bits for addressing within a page) Since size of a page is 8 kilobytes, total bits needed within a page is 13. So value of x = 32 - 13 = 19 Putting value of x, we get size of a page table entry = 1 + 1 + 3 + 19 = 24bits. Number of page table entries = (Page Table Size) / (An entry size) = (24 megabytes / 24 bits) = 2^{23}Vrtual address Size = (Number of page table entries) * (Page Size) = 2^{23}* 8 kilobits = 2^{36}Therefore, length of virtual address space = 36

Question 58 |

A half adder is implemented with XOR and AND gates. A full adder is implemented with two half adders and one OR gate. The propagation delay of an XOR gate is twice that of an AND/OR gate. The propagation delay of an AND/OR gate is 1.2 microseconds. A 4-bit ripple-carry binary adder is implemented by using full adders. The total propagation time of this 4-bit binary adder in microseconds is

19.2 microseconds |

**Digital Logic & Number representation**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 58 Explanation:

A Ripple Carry Adder allows to add two n-bit numbers. It uses half and full adders. Following diagram shows a ripple adder using full adders.

Let us first calculate propagation delay of a single 1 bit full adder. Propagation Delay by n bit full adder is (2n + 2) gate delays. [See this for formula]. Here n = 1, so total delay of a 1 bit full adder is (2 + 2)*1.2 = 4.8 ms Delay of 4 full adders is = 4 * 4.8 = 19.2 ms

Question 59 |

Consider a typical disk that rotates at 15000 rotations per minute (RPM) and has a transfer rate of 50 × 10

^{6}bytes/sec. If the average seek time of the disk is twice the average rotational delay and the controller’s transfer time is 10 times the disk transfer time, the average time (in milliseconds) to read or write a 512 byte sector of the disk is _____________6.1 |

**Input Output Systems**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 59 Explanation:

Disk latency = Seek Time + Rotation Time + Transfer Time + Controller Overhead Seek Time? Depends no. tracks the arm moves and seek speed of disk Rotation Time? depends on rotational speed and how far the sector is from the head Transfer Time? depends on data rate (bandwidth) of disk (bit density) and the size of request Disk latency = Seek Time + Rotation Time + Transfer Time + Controller Overhead Average Rotational Time = (0.5)/(15000 / 60) = 2 miliseconds [On average half rotation is made] It is given that the average seek time is twice the average rotational delay So Avg. Seek Time = 2 * 2 = 4 miliseconds. Transfer Time = 512 / (50 × 10Refer http://cse.unl.edu/~jiang/cse430/Lecture%20Notes/reference-ppt-slides/Disk_Storage_Systems_2.ppt^{6}bytes/sec) = 10.24 microseconds Given that controller time is 10 times the average transfer time Controller Overhead = 10 * 10.24 microseconds = 0.1 miliseconds Disk latency = Seek Time + Rotation Time + Transfer Time + Controller Overhead = 4 + 2 + 10.24 * 10^{-3}+ 0.1 miliseconds = 6.1 miliseconds

Question 60 |

In a connected graph, a bridge is an edge whose removal disconnects a graph. Which one of the following statements is True?

A tree has no bridge
| |

A bridge cannot be part of a simple cycle | |

Every edge of a clique with size ≥ 3 is a bridge (A clique is any complete subgraph of a graph) | |

A graph with bridges cannot have a cycle |

**Graph Theory**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 60 Explanation:

A bridge in a graph cannot be a part of cycle as removing it will not create a disconnected graph if there is a cycle.

Question 61 |

Which of the following languages is/are regular?

L1: {wxw^{R}⎪ w, x ∈ {a, b}* and ⎪w⎪, ⎪x⎪ >0} w^{R}is the reverse of string w L2: {a^{n}b^{m}⎪m ≠ n and m, n≥0 L3: {a^{p}b^{q}c^{r}⎪ p, q, r ≥ 0}

L1 and L3 only | |

L2 only | |

L2 and L3 only | |

L3 only |

**Regular languages and finite automata**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 61 Explanation:

Question 62 |

Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet LAN. Ethernet frames may carry data up to 1500 bytes (i.e. MTU = 1500 bytes). Size of UDP header is 8 bytes and size of IP header is 20 bytes. There is no option field in IP header. How may total number of IP fragments will be transmitted and what will be the contents of offset field in the last fragment?

6 and 925 | |

6 and 7400 | |

7 and 1110 | |

7 and 8880 |

**Misc Topics in Computer Networks**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 62 Explanation:

UDP data = 8880 bytes UDP header = 8 bytes IP Header = 20 bytes Total Size excluding IP Header = 8888 bytes. Number of fragments = ⌈ 8888 / 1480 ⌉ = 7 Refer the Kurose book slides on IP (Offset is always scaled by 8) Offset of last segment = (1480 * 6) / 8 = 1110

Question 63 |

The number of states in the minimal deterministic finite automaton corresponding to the regular expression (0 + 1)*(10) is ____________

2 | |

3 | |

4 | |

5 |

**Regular languages and finite automata**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 64 |

Let X and Y denote the sets containing 2 and 20 distinct objects respectively and F denote the set of all possible functions defined from X and Y. Let f be randomly chosen from F. The probability of f being one-to-one is _________

0.95 | |

0.80 | |

0.75 | |

0.70 |

**Set Theory & Algebra**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 64 Explanation:

X has 2 elements
Y has 20 elements
Number of functions from X to Y is 20*20
[Every element can take any of the 20 values]
Number of one to one functions from X to Y is 20*19
[Every element takes a different value]
So probability of a function being one to one
= (20*19) / (20*20)
= 380 / 400
= 0.95

Question 65 |

A | |

B | |

C | |

D |

**Propositional and First Order Logic.**

**GATE-CS-2015 (Set 2)**

**Discuss it**

Question 65 Explanation:

In logic, a tautology is a formula that is true in every possible interpretation.
All options here are based on order of application of quantifier.
So, there are 2 rules:

- The positions of the same type of quantifiers can be switched
- The positions of different types of quantifiers cannot be switched.

**Option (a)**Sign <-> represents "not equivalent".∀x∃y R( x, y ) is not equivalent to ∃Y ∀X R( X, Y )Let R( X, Y ) represent X < Y for the set of numbers as the universe, for example. Then

**∀X ∃Y R( X, Y ) reads**"for every number x, there is a number y that is greater than x", which is true, while**∃Y ∀X R( X, Y )**reads "there is a number that is greater than every (any) number", which is not true. So this option is rejected.**Option (d)**Sign -> represents "euivalent"∀X ∀Y R( X, Y ) is equivalent to ∀X ∀Y R( Y, X )Let R( X, Y ) represent X < Y for the set of numbers as the universe, for example. Then

**∀X ∀Y R( X, Y )**reads "for every number X, there is every Y that is greater than x", while**∀X ∀Y R( Y, X )**reads "for every number Y, there is every X that is greater than Y". And both can’t be equivalent (because at one time, one will be true and other one will be false) So this option is rejected.**Option (b)**is clearly rejected as two predicate can’t be equivalent to one predicate only. So Option (c) is the correct one.**Explanation for Pption (c)**– as position of the quantifier is not changed and since LHS P -> R = ⌐P ᴠ R which is equal to RHS. Option c is tautology and correct answer too.**Note:**For solving proposition logic question, always remember not to try with rules only. Just take an example and see if options are satisfying it or not. Because for a particular example, three options will give same result and one will be different. And different one is your answer.**For basics to this question, you can refer to:**http://www.cs.odu.edu/~cs381/cs381content/logic/pred_logic/quantification/quantification.html This explanation has been contributed by**Nitika Bansal.**
There are 65 questions to complete.