CS and IT Gate 2016 Set-2 Questions with Answer

Ques 53 Gate 2016 Set-2


The value of the expression 1399(mod 17), in the range 0 to 16, is

A

4

B

13

C

8

D

16


(Number System) is the correct answer.

PROCESSED

Ques 54 Gate 2016 Set-2


Consider the systems, each consisting of m linear equations in n variables.

I. If m < n, then all such systems have a solution
II. If m > n, then none of these systems has a solution
III. If m = n, then there exists a system which has a solution

Which one of the following is CORRECT?

A

I, II and III are true

B

Only II and III are true

C

Only III is true

D

None of them is true


(L) is the correct answer.

Given:
A system of m linear equations in n variables.
Statement I: If m < n, then all such systems have a solution.
Statement II: If m > n, then none of these systems has a solution.
Statement III: If m = n, then there exists a system which has a solution.
To find:
The correct statement(s) among I, II, and III.
Solution:
Let me analyze each statement one by one.
First, checking statement I: "If m < n, then all such systems have a solution."
Let me take a counterexample with m = 2 equations and n = 3 variables:
x + y + z = 1
x + y + z = 2
Here, the two parallel planes never intersect, so there is no solution.
Since an inconsistent underdetermined system can exist, not all such systems have a solution.
So statement I is FALSE.
Now, checking statement II: "If m > n, then none of these systems has a solution."
Let me test an overdetermined system where m = 3 and n = 2:
x + y = 2
2x + 2y = 4
3x + 3y = 6
Clearly, this has infinitely many solutions. Even a system like x = 1, y = 1, x + y = 2 has a unique solution.
So overdetermined systems can have solutions.
Thus, statement II is FALSE.
Now, looking at statement III: "If m = n, then there exists a system which has a solution."
This statement just says "there exists", so I only need to show one example.
Let m = n and choose the identity matrix for coefficients:
In X = B
Since det(In) = 1 โ‰  0, this system always has a unique solution.
So statement III is definitely TRUE.
Therefore, only statement III is correct.
Answer:
(C) Only III is true

Ques 55 Gate 2016 Set-2


Consider a non-negative counting semaphore S. The operation P(S) decrements S, and V(S) increments S. During an execution, 20 P(S) operations and 12 V(S) operations are issued in some order. The largest initial value of S for which at least one P(S) operation will remain blocked is ________.


(a) is the correct answer.

Ques 56 Gate 2016 Set-2


Consider the following processes, with the arrival time and the length of the CPU burst given in milliseconds. The scheduling algorithm used is preemptive shortest remaining-time first.

Process Arrival Time Burst Time
P1 0 10
P2 3 6
P3 7 1
P3 8 3

The average turn around time of these processes is ___________ milliseconds.


(a) is the correct answer.

Ques 57 Gate 2016 Set-2


Consider the following two-process synchronization solution.

Process 0
---------
Entry: loop while (turn == 1);
(critical section)
Exit: turn = 1;

Process 1
----------
Entry: loop while (turn == 0);
(critical section)
Exit: turn = 0;

The shared variable turn is initialized to zero. Which one of the following is TRUE?

A

This is a correct two-process synchronization solution.

B

This solution violates mutual exclusion requirement.

C

This solution violates progress requirement.

D

This solution violates bounded wait requirement.


(process synchronization) is the correct answer.

PROCESSED

Ques 58 Gate 2016 Set-2


In which one of the following page replacement algorithms it is possible for the page fault rate to increase even when the number of allocated frames increases?

A

LRU (Least Recently Used)

B

OPT (Optimal Page Replacement)

C

MRU (Most Recently Used)

D

FIFO (First In First Out)


(P) is the correct answer.

Given:
Page replacement algorithms: LRU, OPT, MRU, and FIFO.
Condition: Page fault rate increases even when the number of allocated frames increases.
To find:
The page replacement algorithm that shows this behavior.
Solution:
Okay, I know that this phenomenon is called Belady's Anomaly.
Let me recall which algorithms suffer from Belady's Anomaly.
Stack-based algorithms never exhibit Belady's anomaly because the set of pages in memory for n frames is always a subset of the pages in memory for n + 1 frames.
Both LRU and Optimal (OPT) are stack algorithms, so they never suffer from this issue.
Now looking at FIFO, the First-In-First-Out algorithm does not satisfy the inclusion property.
Because of this, for certain reference strings, increasing the number of page frames actually leads to more page faults in FIFO.
So FIFO is definitely the algorithm that shows this behavior.
Answer: (D) FIFO (First In First Out)

Unique Visitor Count

Total Unique Visitors

Loading......