Question 1 |

any paper | |

much paper | |

no paper | |

a few paper |

**English**

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

**Discuss it**

Question 2 |

She enjoyed herself immensely at the party.

She had a terrible time at the party | |

She had a horrible time at the party | |

She had a terrific time at the party | |

She had a terrifying time at the party |

**English**

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

**Discuss it**

**fearful**. Terrific means

**wonderful.**

Question 3 |

0.20 | |

0.25 | |

0.30 | |

0.33 |

**Probability**

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

**Discuss it**

(2, 14) (3, 13) (4, 12) (5, 11) Probability = Favorable Outcomes/Total Outcomes Probability = 4/20 = 0.20 Therefore option A is correct

Question 4 |

Statements: 1. Each step is 3/4 foot high. 2. Each step is 1 foot wide.

Statement 1 alone is sufficient, but statement 2 alone is not sufficient | |

Statement 2 alone is sufficient, but statement 1 alone is not sufficient | |

Both statement together are sufficient, but neither statement alone is sufficient | |

Statement 1 and 2 together are not sufficient |

**General Aptitude**

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

**Discuss it**

Question 5 |

Acquiescence - Submission | |

Wheedle - Roundabout | |

Flippancy - Lightness | |

Profligate - Extravagant |

**English**

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

**Discuss it**

Flippancy ---> lack of respect or seriousness. Acquiescence ---> the reluctant acceptance of something without protest. Wheedle ---> use endearments or flattery to persuade someone to do something or Profligate ---> recklessly extravagant

Question 6 |

Q.No. Marks Answered-Correctly Answered-Wrongly Not-Attempted 1 2 21 17 6 2 3 15 27 2 3 1 11 29 4 4 2 23 18 3 5 5 31 12 1What is the average of the marks obtained by the class in the examination?

2.290 | |

2.970 | |

6.795 | |

8.795 |

**General Aptitude**

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

**Discuss it**

Total marks = 2*21 + 3*15 + 1*11 + 2*23 + 5*31 = 299 Average marks = 299/44 = 6.795

Question 7 |

__took to their heels__when the police party arrived.

took shelter in a thick jungle | |

open indiscriminate fire | |

took to flight | |

unconditionally surrendered |

**English**

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

**Discuss it**

__and__

**took to flight**__mean__

**took to their heels**__run away__.

Question 8 |

Statement:There has been a significant drop in the water level in the lakes supplying water to the city.Course of action:1. The water supply authority should impose a partial cut in supply to tackle the situation. 2. The government should appeal to all the residents through mass media for minimal use of water. 3. The government should ban the water supply in lower areas

Statement 1 and 2 follow | |

Statement 1 and 3 follow | |

Statement 2 and 3 follow | |

All statements follow |

**General Aptitude**

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

**Discuss it**

Question 9 |

32 | |

16 | |

48 | |

8 |

**General Aptitude**

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

**Discuss it**

Question 10 |

1. p + m + c = 27/20 2. p + m + c = 13/20 3. (p) × (m) × (c) = 1/10

Only relation 1 is true | |

Only relation 2 is true | |

Relations 2 and 3 are true | |

Relations 1 and 3 are true |

**Probability**

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

**Discuss it**

1 - (1 - m) (1 - p) (1 - c) = 0.75 -------(1) (1 - m)pc + (1 - p)mc + (1 - c)mp + mpc = 0.5 -------(2) (1 - m)pc + (1 - p)mc + (1 - c)mp = 0.4 -------(3) From last 2 equations, we can derivempc = 0.1After simplifying equation 1, we get. p + c + m - (mp + mc + pc) + mpc = 0.75 p + c + m - (mp + mc + pc) = 0.65 -------(4) After simplifying equation 3, we get pc + mc + mp - 3mpc = 0.4 Putting value of mpc, we get pc + mc + mp = 0.7 After putting above value in equation 4, we get p + c + m - 0.7 = 0.65p + c + m = 1.35 = 27/20

Question 11 |

List-I List-II A. Condition coverage 1. Black-box testing B. Equivalence class partitioning 2. System testing C. Volume testing 3. White-box testing D. Alpha testing 4. Performance testing Codes: A B C D (a) 2 3 1 4 (b) 3 4 2 1 (c) 3 1 4 2 (d) 3 1 2 4

a | |

b | |

c | |

d |

**Software Engineering**

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

**Discuss it**

Question 12 |

T(n) = 2T (n/2) + cn | |

T(n) = T(n – 1) + T(0) + cn | |

T(n) = 2T (n – 2) + cn | |

T(n) = T(n/2) + cn |

**Analysis of Algorithms**

**Sorting**

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

**QuickSort**

**Discuss it**

Question 13 |

1. L1' (complement of L1) is recursive 2. L2' (complement of L2) is recursive 3. L1' is context-free 4. L1' ∪ L2 is recursively enumerable

1 only | |

3 only | |

3 and 4 only | |

1 and 4 only |

**Recursively enumerable sets and Turing machines**

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

**Discuss it**

**1. L1' (complement of L1) is recursive is true**L1 is context free. Every context free language is also recursive and recursive languages are closed under complement.

**4. L1' ∪ L2 is recursively enumerable is true**Since L1' is recursive, it is also recursively enumerable and recursively enumerable languages are closed under union. Recursively enumerable languages are known as type-0 languages in the Chomsky hierarchy of formal languages. All regular, context-free, context-sensitive and recursive languages are recursively enumerable. (Source: Wiki)

**3. L1' is context-free:**Context-free languages are not closed under complement, intersection, or difference.

**2. L2' (complement of L2) is recursive is false:**Recursively enumerable languages are not closed under set difference or complementation

Question 14 |

∞ | |

0 | |

1 | |

Not Defined |

**Numerical Methods and Calculus**

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

**Discuss it**

Alternate method : Using log lnm=lim x->infinity 1/x*lnx lim x->infinity lnx/x (numerator = finite value,denominator = infinity and finite/infinite=0 ) ln(m)=0 m=e

^{0}=1

Question 15 |

a | |

b | |

c | |

d |

**Numerical Methods and Calculus**

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

**Discuss it**

g(h(x)) = g(x/(x-1)) = 1 - x/(x-1) = -1/(x-1) h(g(x)) = h(1-x) = (1-x)/((1-x) - 1) = -(1-x)/x g(h(x)) / h(g(x)) = [-1/(x-1)] / [-(1-x)/x] = -x/(x-1)^{2}-x/(x-1)^{2}is same as h(x) / g(x)

Question 16 |

List-I A. Prim’s algorithm for minimum spanning tree B. Floyd-Warshall algorithm for all pairs shortest paths C. Mergesort D. Hamiltonian circuit List-II 1. Backtracking 2. Greed method 3. Dynamic programming 4. Divide and conquer Codes: A B C D (a) 3 2 4 1 (b) 1 2 4 3 (c) 2 3 4 1 (d) 2 1 3 4

a | |

b | |

c | |

d |

**Misc**

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

**Discuss it**

Question 17 |

the selection operation in relational algebra | |

the selection operation in relational algebra, except that select in SQL retains duplicates | |

the projection operation in relational algebra | |

the projection operation in relational algebra, except that select in SQL retains duplicates |

**SQL**

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

**Discuss it**

Question 18 |

S1: A memory operand S2: A processor register S3: An implied accumulator register

Either S1 or S2 | |

Either S2 or S3 | |

Only S2 and S3 | |

All of S1, S2 and S3 |

**Computer Organization and Architecture**

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

**Discuss it**

Question 19 |

P1() { C = B – 1; B = 2*C; } P2() { D = 2 * B; B = D - 1; }The number of distinct values that B can possibly take after the execution is

3 | |

2 | |

5 | |

4 |

**Process Management**

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

**Discuss it**

C = B – 1; // C = 1 B = 2*C; // B = 2 D = 2 * B; // D = 4 B = D - 1; // B = 3 C = B – 1; // C = 1 D = 2 * B; // D = 4 B = D - 1; // B = 3 B = 2*C; // B = 2 C = B – 1; // C = 1 D = 2 * B; // D = 4 B = 2*C; // B = 2 B = D - 1; // B = 3 D = 2 * B; // D = 4 C = B – 1; // C = 1 B = 2*C; // B = 2 B = D - 1; // B = 3 D = 2 * B; // D = 4 B = D - 1; // B = 3 C = B – 1; // C = 2 B = 2*C; // B = 4There are 3 different possible values of B: 2, 3 and 4.

Question 20 |

1. 3, 5, 7, 8, 15, 19, 25 2. 5, 8, 9, 12, 10, 15, 25 3. 2, 7, 10, 8, 14, 16, 20 4. 4, 6, 7, 9, 18, 20, 25

1 and 4 only | |

2 and 3 only | |

2 and 4 only | |

2 only |

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

**Discuss it**

Question 21 |

void f1 (int a, int b) { int c; c=a; a=b; b=c; } void f2 (int *a, int *b) { int c; c=*a; *a=*b;*b=c; } int main() { int a=4, b=5, c=6; f1(a, b); f2(&b, &c); printf (“%d”, c-a-b); return 0; }

-5 | |

-4 | |

5 | |

3 |

**Functions**

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

**Discuss it**

Question 22 |

2 | |

4 | |

8 | |

16 |

**Memory Management**

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

**Discuss it**

Number of entries in page table = 2^{32}/ 4Kbyte = 2^{32 / 212 = 220 Size of page table = (No. page table entries)*(Size of an entry) = 220 * 4 bytes = 222 = 4 Megabytes }

Question 23 |

Viable prefixes appear only at the bottom of the stack and not inside | |

Viable prefixes appear only at the top of the stack and not inside | |

The stack contains only a set of viable prefixes | |

The stack never contains viable prefixes |

**Parsing and Syntax directed translation**

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

**Discuss it**

Question 24 |

A | |

B | |

C | |

D |

**Propositional and First Order Logic.**

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

**Discuss it**

**Conjunction**Conjunction of p and q, denoted by p ∨q, is the proposition ‘p or q’.The Conjunction p ∨q is when anyone of p or q is TRUE.

**Disjunction**Disjunction of p and q, denoted by p ∧q, is the proposition ‘p and q’. The Disjunction p ∧q is TRUE when both p and q is TRUE.

**Logical Implication**It is a type of relationship between two statements or sentence. Denoted by ‘p → q’. The conditional statement p → q is false when p is true and q is false, and true otherwise. i.e. p→ q = ¬p ∨q B

**i-Condition**A bi-conditional statement is a compound statement formed by combining two conditionals under “and.” Bi-conditionals are true when both statements have the exact same truth value.

**Solution :**p←→q means both p→q and q→p p→q is equivalent to ⌉p ∨ q So A and B are fine. D is a different way of writing A p ↔ q = (p→ q) ∧ (q→p) (⌉p ∨ q) ∧ (q → p) ( As p→ q = ⌉p ∨ q ) (⌉p ∨ q) ∧ (⌉q ∨ p) = (¬p ∧ p )∨ (¬p ∧¬q )∨ (q ∧p ) ∨(q ∧¬q ) (

**Distributive law**) As ((¬p∧ p )=0,(q ∧¬q )=0) (

**Complementation**) (⌉p ∧ ⌉q) ∨ (p ∧ q) So, answer C

Question 25 |

1. XML overcomes the limitations in HTML to support a structured way of organizing content. 2. XML specification is not case sensitive while HTML specification is case sensitive. 3. XML supports user defined tags while HTML uses pre-defined tags. 4. XML tags need not be closed while HTML tags must be closed.

2 only | |

1 only | |

2 and 4 only | |

3 and 4 only |

**HTML and XML**

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

**Discuss it**

1.TRUE-XML is a structured way of organizing content.2.FALSE-XML isCASE SENSITIVEwhereasHTML is NOT case sensitive.3.TRUE-XML facilitates User Defined tagswhereas HTML hasonly Pre-Defined tags 4.FALSE-XML tagsMUST be closedwhileHTML tags may NOT be closed.

Question 26 |

^{A}. If A = {5, {6}, {7}}, which of the following options are True.

I and III only | |

II and III only | |

I, II and III only | |

I, II and IV only |

**Combinatorics**

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

**Discuss it**

A = {5, {6}, {7}} Below is Powerset of A { φ, 5, {6}, {7}, {5, {6}}, {5, {7}}, {{6}, {7}}, {5, {6}, {7}} }I is true, as φ belongs to Powerset. II is true, as an empty set is a subset of every set. III is true as {5, {6}} belongs to Powerset. IV is false, {5, {6}} is not a subset, but {{5, {6}}} is.

Question 27 |

HTTP, FTP | |

HTTP, TELNET | |

FTP, SMTP | |

HTTP, SMTP |

**Application Layer**

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

**Discuss it**

**ONE connection**at a time.

Question 28 |

| 2 2 | | 4 9 |, if the diagonal elements of U are both 1, then the lower diagonal entry l

_{22}of L is

4 | |

5 | |

6 | |

7 |

**Linear Algebra**

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

**Discuss it**

| 2 2 | = | l_{11 }0 | * | 1 u_{12}| | 4 9 | | l_{21}l_{22}| | 0 1 | l_{21}* u_{12}+ l_{22}* 1 = 9 ------ (1) We need to find l_{21}and u_{12}l_{21}* 1 + l_{22}* 0 = 4ll_{21}= 4_{11}* U_{12}+ 0 * 1 = 2 l_{11}= 2UPutting value of l_{12}= 1_{21}and u_{12}in (1), we get 4 * 1 + l_{22}* 1 = 9 l_{22}= 5

Question 29 |

**False**with respect to the TCP connection?

1. If the sequence number of a segment is m, then the sequence number of the subsequent segment is always m+1. 2. If the estimated round trip time at any given point of time is t sec, the value of the retransmission timeout is always set to greater than or equal to t sec. 3. The size of the advertised window never changes during the course of the TCP connection. 4. The number of unacknowledged bytes at the sender is always less than or equal to the advertised window

3 only | |

1 and 3 only | |

1 and 4 only | |

2 and 4 only |

**Transport Layer**

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

**Discuss it**

Question 30 |

0, 1, 3, 7, 15, 14, 12, 8, 0 | |

0, 1, 3, 5, 7, 9, 11, 13, 15, 0 | |

0, 2, 4, 6, 8, 10, 12, 14, 0 | |

0, 8, 12, 14, 15, 7, 3, 1, 0 |

**Digital Logic & Number representation**

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

**Discuss it**

Question 31 |

2N | |

N(N – 1) | |

N(N – 1)/2 | |

(N – 1) ^{2} |

**Network Security**

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

**Discuss it**

**Answer is therefore C**

Question 32 |

Checksum | |

Source address | |

Time to Live (TTL) | |

Length |

**Network Layer**

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

**Discuss it**

**Only Source Address is what IP address can not change SO B is the answer.**

Question 33 |

Θ(logn) for both insertion and deletion | |

Θ(n) for both insertion and deletion | |

Θ(n) for insertion and Θ(logn) for deletion | |

Θ(logn) for insertion and Θ(n) for deletion |

**Binary Search Trees**

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

**Discuss it**

Question 34 |

Dense | |

Sparse | |

Clustered | |

Unclustered |

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

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

**Discuss it**

Question 35 |

63 and 6, respectively | |

64 and 5, respectively | |

32 and 6, respectively | |

31 and 5, respectively |

**Binary Trees**

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

**Discuss it**

Number of nodes is maximum for a perfect binary tree. A perfect binary tree of height h has 2^{h+1}- 1 nodes Number of nodes is minimum for a skewed binary tree. A perfect binary tree of height h has h+1 nodes.

Question 36 |

0.99 | |

1 | |

99 | |

0.9 |

**Numerical Methods and Calculus**

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

**Discuss it**

S = 1/1*2 + 1/2*3 + 1/3*4 + ..... + 1/99*100 = (1 - 1/2) + (1/2 - 1/3) + (1/3 - 1/4) + .... + (1/99 - 1/100) = (1 + 1/2 + 1/3 .... 1/99) - (1/2 + 1/3 + 1/4 ... 1/100) = 1 - 1/100 = 99/100 = 0.99

Question 37 |

SELECT S. Student_Name, sum(P.Marks) FROM Student S, Performance P WHERE S.Roll_No = P.Roll_No GROUP BY S.Student_NameThe number of rows that will be returned by the SQL query is _________

0 | |

1 | |

2 | |

3 |

**SQL**

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

**Discuss it**

Student_Name Marks Raj 310 Rohit 140

Question 38 |

Both commutative and associative | |

Commutative but not associative | |

Not commutative but associative | |

Neither commutative nor associative |

**Set Theory & Algebra**

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

**Discuss it**

**commutative and associative.**

Question 39 |

0.462 | |

0.711 | |

0.5 | |

0.652 |

**Data Link Layer**

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

**Discuss it**

The probability of sending a frame in the first slot without any collision by any of these four stations is sum of following 4 probabilities Probability that S1 sends a frame and no one else does + Probability thatS2 sends a frame and no one else does + Probability thatS3 sends a frame and no one else does + Probability thatS4 sends a frame and no one else does = 0.1 * (1 - 0.2) * (1 - 0.3) *(1 - 0.4) + (1 -0.1) * 0.2 * (1 - 0.3) *(1 - 0.4) + (1 -0.1) * (1 - 0.2) * 0.3 *(1 - 0.4) + (1 -0.1) * (1 - 0.2) * (1 - 0.3) * 0.4 = 0.4404

Question 40 |

8 | |

9 | |

10 | |

11 |

**Input Output Systems**

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

**Discuss it**

Given a disk with 100 tracks And Sequence 45, 20, 90, 10, 50, 60, 80, 25, 70. Initial position of the R/W head is on track 50.In SSTF, requests are served as followingNext Served Distance Traveled 50 0 45 5 60 15 70 10 80 10 90 10 25 65 20 5 10 10 ----------------------------------- Total Dist = 130If Simple SCAN is used, requests are served as followingNext Served Distance Traveled 50 0 60 10 70 10 80 10 90 10 45 65 [disk arm goes to 100, then to 45] 25 20 20 5 10 10 ----------------------------------- Total Dist = 140 Extra Distance traveled in SSTF = 140 - 120 = -10

**If SCAN with LOOK is used, requests are served as following**

Next Served Distance Traveled 50 0 60 10 70 10 80 10 90 10 45 45 [disk arm comes back from 90] 25 20 20 5 10 10 ----------------------------------- Total Dist = 120 Extra Distance traveled in SSTF = 130 - 120 = 10

Question 41 |

int fun1 (int n) { int i, j, k, p, q = 0; for (i = 1; i<n; ++i) { p = 0; for (j=n; j>1; j=j/2) ++p; for (k=1; k<p; k=k*2) ++q; } return q; }Which one of the following most closely approximates the return value of the function fun1?

n ^{3} | |

n (logn) ^{2} | |

nlogn | |

nlog(logn) |

**Analysis of Algorithms**

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

**Discuss it**

int fun1 (int n) { int i, j, k, p, q = 0; // This loop runs Θ(n) time for (i = 1; i < n; ++i) { p = 0; // This loop runs Θ(Log n) times. Refer this for (j=n; j > 1; j=j/2) ++p; // Since above loop runs Θ(Log n) times, p = Θ(Log n) // This loop runs Θ(Log p) times which loglogn for (k=1; k < p; k=k*2) ++q; } return q; }T(n) = n(logn + loglogn) T(n) = n(logn) dominant But please note here we are return q which lies in loglogn so ans should be T(n) = nloglogn Refer this for details.

Question 42 |

40, 30, 20, 10, 15, 16, 17, 8, 4, 35 | |

40, 35, 20, 10, 30, 16, 17, 8, 4, 15 | |

40, 30, 20, 10, 35, 16, 17, 8, 4, 15 | |

40, 35, 20, 10, 15, 16, 17, 8, 4, 30 |

**Heap**

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

**Discuss it**

40 / \ 30 20 / \ / \ 10 15 16 17 / \ 8 4After insertion of 35, we get

40 / \ 30 20 / \ / \ 10 15 16 17 / \ / 8 4 35After swapping 35 with 15 and swapping 35 again with 30, we get

40 / \ 35 20 / \ / \ 10 30 16 17 / \ / 8 4 15

Question 43 |

begin q := 0 r := x while r >= y do begin r := r – y q := q + 1 end endThe post condition that needs to be satisfied after the program terminates is

{r = qx + y ∧ r < y} | |

{x = qy + r ∧ r < y} | |

{y = qx + r ∧ 0 < r < y} | |

{ q + 1 < r–y ∧ y > 0} |

**Misc**

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

**Discuss it**

1) It initializes r as x. 2) It repeatedly subtracts y from r until r becomes smaller than y. For every subtraction, it increments count q. 3) Finally r contains remainder, i.e., x%y and q contains ⌊x/y⌋See below pseudo code with comments.

begin q := 0 // q is going to contain floor(x/y) r := x // r is going to contain x % y // Repeatedly subtract y from x. while r >= y do begin r := r – y q := q + 1 end end

Question 44 |

^{3}= {(x,y,z): x, y, z ∈ L} be the set of all ordered triplets of the elements of L. Let pr be the probability that an element (x,y,z) ∈ L

^{3}chosen equiprobably satisfies x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z). Then

Pr = 0 | |

Pr = 1 | |

0 < Pr ≤ 1/5 | |

1/5 < Pr < 1 |

**Set Theory & Algebra**

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

**Discuss it**

Number of triplets in L^{3}= Number of ways in which we can choose 3 elements from 5 with repetition = 5 * 5 * 5 = 125. Now, when we takex = t, then the given condition for L is satisfied for any y and z. Here, y and z can be taken in 5 * 5 = 25 ways. Takex = r, y = p, z = p. Here also, the given condition is satisfied. So, pr > 25 / 125 > 1/5. Forx = q, y = r, z = s, the given condition is not satisfied as q ⋁ (r ⋀ s) = q ⋁ p = q, while (q ⋁ r) ⋀ (q ⋁ s) = t ⋀ t = t. So, pr ≠ 1. Hence D choice.

Question 45 |

#include <stdio.h> int main() { unsigned int x[4][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}}; printf("%u, %u, %u", x+3, *(x+3), *(x+2)+3); }

2036, 2036, 2036 | |

2012, 4, 2204 | |

2036, 10, 10 | |

2012, 4, 6 |

**Advanced Pointer**

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

**Discuss it**

x = 2000 Since x is considered as a pointer to an array of 3 integers and an integer takes 4 bytes, value of x + 3 = 2000 + 3*3*4 = 2036 The expression, *(x + 3) also prints same address as x is 2D array. The expression *(x + 2) + 3 = 2000 + 2*3*4 + 3*4 = 2036

Question 46 |

A = | 1 4 | | b a |

a = 6, b = 4 | |

a = 4, b = 6 | |

a = 3, b = 5 | |

a = 5, b = 3 |

**Linear Algebra**

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

**Discuss it**

The character equation for given matrix is | 1-λ 4 | = 0 | b a-λ| (1-λ)*(a-λ) - 4b = 0 Putting λ = -1, => (1 - (-1)) * (a - (-1)) - 4b = 0 => 2a + 2 - 4b = 0 => 2b - a = 1 Putting λ = 7, => (1 - 7) * (a - 7) - 4b = 0 => -6a + 42 - 4b = 0 => 2b + 3a = 21 Solving the above two equations, we get a = 5, b = 3

Question 47 |

0110110... | |

0100100... | |

011101110... | |

011001100... |

**Digital Logic & Number representation**

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

**Discuss it**

- Toggle: J = K = 1
- Hold : J = K = 0

**Another Explanation:**Here, it is given that JK flip flop will toggle when J = K = 1 and it will retain the output if J = K = 0. Also, the output of the D flip flop would remain the same as the input. So, we have Initial output : D = 1

JK = 0

After clock 1 : D = 0 (D gets 0 as input from initial output of JK, so output = 0)

JK = 1 (J = K = 1 from initial output of D, so output would be toggled from 0 to 1)

After clock 2 : D = 1 (D gets 1 as input from previous output of JK, so output = 1)

JK = 1 (J = K = 0 from previous output of D, so output would be retained to 1)

After clock 3 : D = 1 (D gets 1 as input from previous output of JK, so output = 1)

JK = 0 (J = K = 1 from previous output of D, so output would be toggled from 1 to 0)

After clock 4 : D = 0 (D gets 0 as input from previous output of JK, so output = 0)

JK = 1 (J = K = 1 from previous output of D, so output would be toggled from 0 to 1)

After clock 5 : D = 1 (D gets 1 as input from previous output of JK, so output = 1)

JK = 1 (J = K = 0 from previous output of D, so output would be retained to 1)

Thus, the bit sequence generated at the Q output of the JK flip flop will be 0110110...Question 48 |

3.2 | |

3.0 | |

2.2 | |

2.0 |

**Computer Organization and Architecture**

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

**Discuss it**

Speedup = ExecutionTimeRefer http://www.cs.berkeley.edu/~pattrsn/252F96/Lecture2a.pdf for more information on this topic._{Old}/ ExecutionTime_{New}ExecutionTime_{Old}= CPI_{Old}* CycleTime_{Old}[HereCPIisCyclesPerInstruction] = CPI_{Old}* CycleTime_{Old}= 4 * 1/2.5 Nanoseconds = 1.6 ns Since there are no stalls, CPU_{new}can be assumed 1 on average. ExecutionTime_{New}= CPI_{new}* CycleTime_{new}= 1 * 1/2 = 0.5 Speedup = 1.6 / 0.5 = 3.2

Question 49 |

Both {f} and {g} are functionally complete | |

Only {f} is functionally complete | |

Only {g} is functionally complete | |

Neither {f} nor {g} is functionally complete |

**Digital Logic & Number representation**

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

**Discuss it**

**Property 1:**We say that boolean function f preserves zero, if on the 0-input it produces 0. By the 0-input we mean such an input, where every input variable is 0 (this input usually corresponds to the ﬁrst row of the truth table). We denote the class of zero-preserving boolean functions as T0 and write f ∈ T0.

**Property 2:**Similarly to T0, we say that boolean function f preserves one, if on 1-input, it produces 1. The 1-input is the input where all the input variables are 1 (this input usually corresponds to the last row of the truth table). We denote the class of one-preserving boolean functions as T1 and write f ∈ T1.

**Property 3:**We say that boolean function f is linear if one of the following two statements holds for f:

- For every 1-value of f, the number of 1’s in the corresponding input is odd, and for every 0-value of f, the number of 1’s in the corresponding input is even.

- For every 1-value of f, the number of 1’s in the corresponding input is even, and for every 0-value of f, the number of 1’s in the corresponding input is odd.

**Property 4:**We say that boolean function f is monotone if for every input, switching any input variable from 0 to 1 can only result in the function’s switching its value from 0 to 1, and never from 1 to 0. We denote the class of monotone boolean functions with M and write f ∈ M.

**Property 5:**We say that boolean function f(x1,...,xn) is self-dual if f(x1,...,xn) = ¬f(¬x1,...,¬xn). The function on the right in the equality above (the one with negations) is called the dual of f. We will call the class of self-dual boolean functions S and write f ∈ S. As in our case we can see on giving all i/p to 0 (g )produce 0 so it preserving 0 and can’t be functionally complete. But f is neither preserving 0 nor 1.

- F is not linear(see defn. of linear above)
- F is not monotone(see defn. of monotone above)
- F is not self dual as f(x,y,z) is not equal to –f(-x,-y,-z)

**So f is functionally complete.**

**Hence ans is (B) part**

Question 50 |

^{1/2}find operations, N insert operations, (logN)

^{1/2}operations, and (logN)

^{1/2}decrease-key operations on a set of data items with keys drawn from a linearly ordered set. For a delete operation, a pointer is provided to the record that must be deleted. For the decrease-key operation, a pointer is provided to the record that has its key decreased. Which one of the following data structures is the most suited for the algorithm to use, if the goal is to achieve the best total asymptotic complexity considering all the operations?

Unsorted array | |

Min-heap | |

Sorted array | |

Sorted doubly linked list |

**Array**

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

**Discuss it**

- For unsorted array, we can always insert an element at end and do insert in O(1) time
- For Min Heap, insertion takes O(Log n) time. Refer Binary Heap operations for details.
- For sorted array, insert takes O(n) time as we may have to move all elements worst case.
- For sorted doubly linked list, insert takes O(n) time to find position of element to be inserted.

Question 51 |

_{12}, E1 and E3 are connected by a 1 : n (1 on the side of E1 and n on the side of E3) relationship R

_{13}. E1 has two single-valued attributes a

_{11}and a

_{12}of which a

_{11}is the key attribute. E2 has two single-valued attributes a

_{21}and a

_{22}is the key attribute. E3 has two single-valued attributes a

_{31}and a

_{32}of which a

_{31}is the key attribute. The relationships do not have any attributes. If a relational model is derived from the above ER model, then the minimum number of relations that would be generated if all the relations are in 3NF is ___________.

2 | |

3 | |

4 | |

5 |

**Database Design(Normal Forms)**

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

**Discuss it**

Entity E1. a1 a12 -------- a11 is key Entity E2 a21 a22 -------- a22 is key Entity E3 a31 a32 -------- a31 is key R12 is m:n Relationship between E1 and E2 R12 a11 a22 ------------- (a11, a22) is key. R13 is 1:n Relationship between E1 and E3 R13 a11 a31 ----------- (a11, a31) is key. We need minimum no. of tables. Can we remove any of the above tables without loosing information and keeping the relations in 3NF? We can combine R13 and R12 into one. a11 a31 a22 ------------------ (a11, a31, a22) is key. The relation is still in 3NF as for every functional dependency X -> A, one of the following holds 1) X is a superkey or 2) A-X is prime attribute

Question 52 |

while (first <= last) { if (array [middle] < search) first = middle +1; else if (array [middle] == search) found = True; else last = middle – 1; middle = (first + last)/2; } if (first < last) not Present = True;The cyclomatic complexity of the program segment is __________.

3 | |

4 | |

5 | |

6 |

**Software Engineering**

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

**Discuss it**

M = E − N + 2P, where E = the number of edges of the graph. N = the number of nodes of the graph. P = the number of connected components.Source: http://en.wikipedia.org/wiki/Cyclomatic_complexity For a single program (or subroutine or method), P is always equal to 1. So a simpler formula for a single subroutine is

M = E − N + 2For the given program, the control flow graph is:

E = 13, N = 10. Therefore, E - N + 2 = 5.

Question 53 |

66 | |

69 | |

68 | |

70 |

**Graph Minimum Spanning Tree**

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

**Discuss it**

Question 54 |

0 | |

-1 | |

1 | |

infinite |

**Numerical Methods and Calculus**

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

**Discuss it**

Question 55 |

-1 | |

0 | |

1 | |

2 |

**Graph Shortest Paths**

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

**Discuss it**

Question 56 |

Both incur the same number of page faults | |

FIFO incurs 2 more page faults than LRU | |

LRU incurs 2 more page faults than FIFO | |

FIFO incurs 1 more page faults than LRU |

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

**Discuss it**

3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3 In both FIFO and LRU, we get following after considering 3, 8, 2, 3, 9, 1, 3 8 2 9 1FIFO6 replaces 3 8 2 9 1 6 3 replaces 8 2 9 1 6 3 8 replaces 2 9 1 6 3 8 2 replaces 9 1 6 3 8 2 No more page faultsLRU6 replaces 8 3 2 9 1 6 8 replaces 2 3 9 1 6 8 2 replaces 1 3 9 6 8 2 1 replaces 8 3 9 6 2 1

Question 57 |

14020 | |

14000 | |

25030 | |

15000 |

**Input Output Systems**

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

**Discuss it**

Seek time (given) = 4ms RPM = 10000 rotation in 1 min [60 sec] So, 1 rotation will be =60/10000 =6ms [rotation speed] Rotation latency= 1/2 * 6ms=3ms # To access a file, total time includes =seek time + rot. latency +transfer time TO calc. transfer time, find transfer rate Transfer rate = bytes on track /rotation speed so, transfer rate = 600*512/6ms =51200 B/ms transfer time= total bytes to be transferred/ transfer rate so, Transfer time =2000*512/51200 = 20ms Given as each sector requires seek tim + rot. latency = 4ms+3ms =7ms Total 2000 sector takes = 2000*7 ms =14000 ms To read entire file ,total time = 14000 + 20(transfer time) = 14020 ms

Question 58 |

_{n}represent the number of bit strings of length n containing two consecutive 1s. What is the recurrence relation for a

_{n}?

a _{n–2} + a_{n–1} + 2^{n–2} | |

a _{n–2} + 2a_{n–1} + 2^{n–2} | |

2a _{n–2} + a_{n–1} + 2^{n–2} | |

2a _{n–2} + 2a_{n–1} + 2^{n–2} |

**Misc**

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

**Discuss it**

**Simple Solution**One way to solve this is to try for small values and rule out options.

aIf we check for a_{0}= 0 a_{1}= 0 a_{2}= 1 ["11"] a_{3}= 3 ["011", "110", "111"] a_{4}= 8 ["0011", "0110", "0111", "1101", "1011", "1100", "1110", "1111"]

_{3}, we can see that only A and C satisfy the value. Among (A) and (C), only (A) satisfies for a

_{4}.

**Another Solution (With Proof)**

A string of length n (n >= 2) can be formed by following 4 prefixes 1)11followed by a string of length n-2 2)00followed by a string of length n-2 3)01followed by a string of length n-2 4)10followed by a string of length n-2 Number 1 has already two consecutive 1's so number of binary strings beginning with number 3 is 2^{n-2}as remaining n-2 bits can have any value. Number 2 has two 0's so remaining n-2 bits must have two consecutive 1's. Therefore number of binary strings that can be formed by number 2 is a_{n-2}. Number 3 and Number 4 together form all strings of length n-1 and two consecutive 1's.

Question 59 |

1. There exists a statement Sj that uses x 2. There is a path from Si to Sj in the flow graph corresponding to the program 3. The path has no intervening assignment to x including at Si and SjThe variables which are live both at the statement in basic block 2 and at the statement in basic block 3 of the above control flow graph are

p, s, u | |

r, s, u | |

r, u | |

q, v |

**Software Engineering**

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

**Discuss it**

**live**if it holds a value that may be needed in the future. In other words, it is used in future before any new assignment.

Question 60 |

10110 | |

10010 | |

01010 | |

01001 |

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

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

**Discuss it**

Question 61 |

0 | |

1 | |

2 | |

3 |

**Regular languages and finite automata**

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

**Discuss it**

Question 62 |

160 | |

320 | |

640 | |

220 |

**Data Link Layer**

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

**Discuss it**

Transmission or Link speed = 64 kb per sec Propagation Delay = 20 milisec Since stop and wait is used, a packet is sent only when previous one is acknowledged. Let x be size of packet, transmission time = x / 64 milisec Since utilization is at least 50%, minimum possible total time for one packet is twice of transmission delay, which means x/64 * 2 = x/32 x/32 > x/64 + 2*20 x/64 > 40 x > 2560 bits = 320 bytesAnswer in GATE keys says 160 bytes, but the answer keys seem incorrect. See question 36 here.

Question 63 |

24 | |

20 | |

32 | |

64 |

**Graph Theory**

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

**Discuss it**

v − e + f = 2. v -> Number of vertices e -> Number of edges f -> Number of faces As per the question v = 10 And number of edges on each face is three Therefore, 2e = 3f [Note that every edge is shared by 2 faces] Putting above values in v − e + f = 2 10 - e + 2e/3 = 2 e = 3*10 - 6 = 24

Question 64 |

4 | |

8 | |

7 | |

9 |

**Computer Organization and Architecture**

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

**Discuss it**

The correct answer is 8. This question was asked as a fill in the blank type question in the exam.

Three address code is an intermediate code generated by compilers while optimizing the code. Each three address code instruction can have atmost three operands (constants and variables) combined with an assignment and a binary operator. The point to be noted in three address code is that the variables used on the left hand side (LHS) of the assignment cannot be repeated again in the LHS side. Static single assignment (SSA) is nothing but a refinement of the three address code.

So, in this question, we havet1 = r / 3; t2 = t * 5; t3 = u * v; t4 = t3 / w; t5 = q + t1; t6 = t5 + s; t7 = t6 - t2; t8 = t7 + t4;Therefore, we require 8 temporary variables (t1 to t8) to create the three address code in static single assignment form.

Question 65 |

5 | |

10 | |

12 | |

15 |

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

**CPU Scheduling**

**Discuss it**

Periods of T1, T2 and T3 are 3ms, 7ms and 20ms Since priority is inverse of period, T1 is the highest priority task, then T2 and finally T3 Every instance of T1 requires 1ms, that of T2 requires 2ms and that of T3 requires 4ms Initially all T1, T2 and T3 are ready to get processor, T1 is preferred Second instances of T1, T2, and T3 shall arrive at 3, 7, and 20 respectively. Third instance of T1, T2 and T3 shall arrive at 6, 14, and 49 respectively. Time-Interval Tasks 0-1 T1 1-2 T2 2-3 T2 3-4 T1 [Second Instance of T1 arrives] 4-5 T3 5-6 T3 6-7 T1 [Third Instance of T1 arrives] [Therefore T3 is preempted] 7-8 T2 [Second instance of T2 arrives] 8-9 T2 9-10 T1 [Fourth Instance of T1 arrives] 10-11 T3 11-12 T3 [First Instance of T3 completed]

See GATE Corner for all papers, notes and other important information.