arrow
arrow
arrow
A system has 4 processes and 3 resource types. The following matrices are given:Allocation Matrix Process R1 R2 R3 P1 0 1 0 P2
Question

A system has 4 processes and 3 resource types. The following matrices are given:

Allocation Matrix

Process

R1

R2

R3

P1

0

1

0

P2

2

0

0

P3

3

0

2

P4

2

1

1

Maximum Matrix

Process

R1

R2

R3

P1

7

5

3

P2

3

2

2

P3

9

0

2

P4

2

2

2

Available Resources

R1

R2

R3

3

2

1

Using Banker’s Algorithm, determine the number of safe sequences possible.

A.

0

B.

1

C.

2

D.

3

E.

4

Correct option is A

First, calculate the Need Matrix using:

Need = Maximum - Allocation

Need Matrix

Process

R1

R2

R3

P1

7

4

3

P2

1

2

2

P3

6

0

0

P4

0

1

1

Initial Available Resources = (3, 2, 1)

Now check which process can execute:

  • P1: Needs (7,4,3) → Cannot execute
  • P2: Needs (1,2,2) → Cannot execute because R3 needed = 2 but available = 1
  • P3: Needs (6,0,0) → Cannot execute because R1 needed = 6 but available = 3
  • P4: Needs (0,1,1) → Can execute

After executing P4, resources released:

Available = (3,2,1) + (2,1,1) = (5,3,2)

Now check remaining processes:

  • P1: Needs (7,4,3) → Cannot execute
  • P2: Needs (1,2,2) → Can execute

After executing P2:

Available = (5,3,2) + (2,0,0) = (7,3,2)

Now:

  • P3: Needs (6,0,0) → Can execute

After executing P3:

Available = (7,3,2) + (3,0,2) = (10,3,4)

Now:

  • P1: Needs (7,4,3) → Cannot execute because R2 needed = 4 but available = 3

Thus, all processes cannot complete successfully, so the system is in an unsafe state and no complete safe sequence exists.

Therefore, the number of safe sequences possible is 0.

Important Key Points:

  1. Banker’s Algorithm is used for deadlock avoidance.
  2. The Need Matrix is calculated as:
    Need = Maximum - Allocation
  3. A process can execute only if its need is less than or equal to available resources.
  4. If all processes cannot complete, the system is in an unsafe state.

Knowledge Booster:

  1. (b) 1: Incorrect because no complete safe sequence exists for all processes.
  2. (c) 2: Incorrect because the system cannot generate even one full safe sequence.
  3. (d) 3: Incorrect because the resource allocation state is unsafe.
  4. (e) 4: Incorrect because all processes cannot complete successfully under current available resources.

Free Tests

Free
Must Attempt
Video Solutions

SBI Clerk Mains 2026 Full Mock Test-01

languageIcon English
  • pdpQsnIcon190 Questions
  • pdpsheetsIcon200 Marks
  • timerIcon160 Mins
languageIcon English
Free
Must Attempt

SBI Clerk Mains MBT (29th October 2026 S1)- Based on Backlog Vacancies

languageIcon English
  • pdpQsnIcon190 Questions
  • pdpsheetsIcon200 Marks
  • timerIcon160 Mins
languageIcon English
Free
Must Attempt

SBI Clerk Mains 2026 : Reasoning Section Test - 01

languageIcon English
  • pdpQsnIcon50 Questions
  • pdpsheetsIcon60 Marks
  • timerIcon45 Mins
languageIcon English

Similar Questions

test-prime-package

Access ‘IBPS SO IT Officer’ Mock Tests with

  • 1.5 Lakhs+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
590k+ students have already unlocked exclusive benefits with Test Prime!

Similar Questions

Our Plans
Monthsup-arrow