215 views
consider a system having 22 resources of the same type. These resources are shared by 4 processes P, Q, R, and S having peak demands of 3,6, a, and b respectively. How many ordered pairs (a,b) are possible, such that the system is deadlock free?

I cant understand the calculation of overall pair. Please elaborate.

(0,1) can also be there na.
a+b <= 16
if u put  the value zero then this resource are not shared by this perticular process

To determine the number of possible ordered pairs (a,b) such that the system is deadlock-free, we need to first understand what a deadlock is in a system and how it can be avoided.

A deadlock occurs in a system when two or more processes are unable to proceed because they are waiting for a resource that is being held by another process. In a system with multiple processes and resources, deadlocks can be avoided by ensuring that the system satisfies certain conditions, such as the mutual exclusion condition, the hold and wait condition, the no preemption condition, and the circular wait condition.

In the case of the system described in the question, we can ensure that the system is deadlock-free by ensuring that the total demand for resources by the processes does not exceed the total number of resources available. In this case, the total demand for resources is 3 + 6 + a + b, and the total number of resources available is 22. Therefore, for the system to be deadlock-free, we must have 3 + 6 + a + b <= 22.

Solving this inequality for (a,b), we get -9 <= a + b <= 16. This means that the possible values for (a,b) are any ordered pair of integers such that the sum of the two integers is between -9 and 16, inclusive. There are a total of 26 possible values for the sum of two integers between -9 and 16, inclusive. Therefore, there are 26 possible ordered pairs (a,b) such that the system is deadlock-free.

### 1 comment

moved

For finding the value pairs (a,b)

such that :  a + b <= 16

Let’s fix a = 1 then, b = 1, 2, 3, … 15  // count = 15

a = 2 then, b = 1, 2, 3, …. 14 // count = 14

similarly for a = 3  → count  = 13

… upto a = 15 → count = 1

Total pairs = 1 + 2 + 3 + .. + 15 = 120 Hope it helps yu 😊