# GATE Numerical Answer Questions

Question 1

**The pie chart below has the breakup of the number of students from different departments in an engineering college for the year 2012. The proportion of male to female students in each department is 5:4. There are 40 males in Electrical Engineering. What is the difference between numbers of female students in the Civil department and the female students in the Mechanical department?**

.

Correct answer is =32

Question 2

**The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.The number of distinct values that B can possibly take after the execution is**

.

Correct answer is =3

Solution :

If we execute P2 process after P1 process, then B = 3

If we execute P1 process after P2 process, then B = 4

If we did preemption between P1 & P2 processes, then B = 2 (Preemption have done from P1 to P2) or B = 3 (Preemption have done from P2 to P1). So, among 2 & 3 values, only one value will be saved in B. So, total no. of distinct values that B can possibly take after the execution is 3.

Question 3

**In the following LU decomposition of the matrix , if the diagonal elements of U are both 1, then the lower diagonal entry 1**

_{22}of L is.

Correct answer is =5

Question 4

**The output of the following C program is __________.**

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);

}

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);

}

.

Correct answer is =-5

Solution :

Question 5

**Consider a system with byte-addressable memory, 32 bit logical addresses, 4 kilobyte page size and page table entries of 4 bytes each. The size of the page table in the system in megabytes is ___________.**

.

Correct answer is =4

Solution :

Given LA = 32 bits

LAS = 232 = 448 & Page size = 4 kB

# of pages = LAS/PS = 44GB/4KB = G/K = 2

^{20}= 1m

Sie of page table entry = 4 byte

Page table size = 4B×1m = 4 mB

Question 6

**Consider the DFAs M and N given below. The number of states in a minimal DFA that accepts the language L(M) ? L(N) is __________.**

.

Correct answer is =1

Solution :

M accepts the strings which end with a and N acceptsthe strings which end with B. Their intersection should accept empty language

Question 7

**Consider a non-pipelined processor with a clock rate of 2.5 gigahertz and average cycles per instruction of four. The same processor is upgraded to a pipelined processor with five stages; but due to the internal pipeline delay, the clock speed is reduced to 2 gigahertz. Assume that there are no stalls in the pipeline. The speed up achieved in this pipelined processor is __________.**

.

Correct answer is =3.2

Question 8

**The least number of temporary variables required to create a three-address code in static single assignment form for the expression q + r/3 + s – t * 5 + u * v/w is _________.**

.

Correct answer is =3

Question 9

**Consider an Entity-Relationship (ER) model in which entity sets E1and E2 are connected by an m : n relationship R12, E1 and E3 are connected by a 1 : n (1 on the side of E1 and n on the side of E3) relationship R13. E1 has two single-valued attributes a11 and a12 of which a11 is the key attribute. E2 has two singlevalued attributes a21 and a22 of which a21 is the key attribute. E3 has two single-valued attributes a31 and a32 of which a31 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 ___________.**

.

Correct answer is =5

Solution :

E1(a11,a12) , E2(a21,a22) , E3 and R13 (a11,a31,a32) , R12(a11,a21)

But in table (a11,a31,a32) there may be transitive dependency between a11 and a32 so we should decompose this table into 2 more tables

=> 5 tables

Question 10

**The graph shown below 8 edges with distinct integer edge weights. The minimum spanning tree (MST) is of weight 36 and contains the edges: {(A, C), (B, C), (B, E), (E, F), (D, F)}. The edge weights of only those edges which are in the MST are given in the figure shown below. The minimum possible sum of weights of all 8 edges of this graph is ______________.**

.

Correct answer is =69

Solution :

Total sum=10+9+ 2+15+ 7 +16+ 4+ 6 = 69

Question 11

**Consider a disk pack with a seek time of 4 milliseconds and rotational speed of 10000 rotations per minute (RPM). It has 600 sectors per track and each sector can store 512 bytes of data. Consider a file stored in the disk. The file contains 2000 sectors. Assume that every sector access necessitates a seek, and the average rotational latency for accessing each sector is half of the time for one complete rotation. The total time (in milliseconds) needed to read the entire file is _________.**

.

Correct answer is =14020

Solution :

Given Seek time = 4ms

60s -> 10000 rotations

60/10000 = 6ms <- 1 rotation

Rotational latency=1/2* 6ms =3ms

1track-> 600sectors

6ms <- 600 sectors (1 rotation means 600 sectors (or) 1 track)

1 sector -> 6ms/600 = 0.01ms

2000 sector -> 2000 (0.01) = 20 ms

total time needed to read the entire file is

= 2000 (4+3) +20 =8000+6000+20 = 14020 ms

Question 12

.

Correct answer is =-1

Question 13

**Consider the following C program segment.**

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) notPresent = True;

The cyclomatic complexity of the program segment is __________.

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) notPresent = True;

The cyclomatic complexity of the program segment is __________.

.

Correct answer is =5

Question 14

**Consider a uniprocessor system executing three tasks T1, T2 and T3, each of which is composed of an infinite sequence of jobs (or instances) which arrive periodically at intervals of 3, 7 and 20 milliseconds, respectively. The priority of each task is the inverse of its period and the available tasks are scheduled in order of priority, with the highest priority task scheduled first. Each instance of T1, T2 and T3 requires an execution time of 1, 2 and 4 milliseconds, respectively. Given that all tasks initially arrive at the beginning of the 1st millisecond and task preemptions are allowed, the first instance of T3 completes its execution at the end of ______________ milliseconds.**

.

Correct answer is =13

Solution :

According to the given data, we can get this Gantt chart.

Question 15

**Consider the following relations:**

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

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

.

Correct answer is =2

Solution :

Output :

Raj 310

Rohit 140

Question 16

**Let G be a connected planar graph with 10 vertices. If the number of edges on each face is three, then the number of edges in G is _______________.**

.

Correct answer is =24

Solution :

By euler's formula :

|V|+|R| = |E|+2 _________(1) where |V|, |E|, |R| are respectively number of vertices, edges and faces (regions)

Given |V| = 10 _______(2) and number of edges on each face is three

3|R| = 2|E| => |R| = (2/3) |E| __________ (3)

substituting 2 , 3 in 1 ,we get

10 + (2/3)|E| = |E| +2 => (|E| /3) = 8 => |E| =24

Question 17

**Consider a LAN with four nodes S1, S2, S3 and S4. Time is divided into fixed-size slots, and a node can begin its transmission only at the beginning of a slot. A collision is said to have occurred if more than one node transmit in the same slot. The probabilities of generation of a frame in a time slot by S1, S2, S3 and S4 are 0.1, 0.2, 0.3 and 0.4, respectively. The probability of sending a frame in the first slot without any collision by any of these four stations is _________.**

.

Correct answer is =0.462

Question 18

**Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is given: 45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W head is on track 50. The additional distance that will be traversed by the R/W head when the Shortest Seek Time First (SSTF) algorithm is used compared to the SCAN (Elevator) algorithm (assuming that SCAN algorithm moves towards 100 when it starts execution) is _________ tracks.**

.

Correct answer is =10

Question 19

**Suppose that the stop-and-wait protocol is used on a link with a bit rate of 64 kilobits per second and 20 milliseconds propagation delay. Assume that the transmission time for the acknowledgment and the processing time at nodes are negligible. Then the minimum frame size in bytes to achieve a link utilization of at least 50% is _________.**

.

Correct answer is =320

Solution :

Given B = 64 kbps

T

_{p}= 20 ms n ? 50%

For n>= 50% => L >= BR

=> L=64 * 10

^{3}* 2 * 20 * 10

^{-3}

=2560bits= 320bytes

Question 20

.

Correct answer is =0.99

**MY REPORT**

TOTAL = 20 | |||

ANSWERED = | |||

CORRECT / TOTAL = | /20 | ||

POSITIVE SCORE = | |||

NEGATIVE SCORE = | |||

FINAL SCORE = |