Question

In: Computer Science

Consider the following snapshot of a system: Allocation                   Max                 Availa

Consider the following snapshot of a system:

Allocation                   Max                 Available

A B C D              A B C D                    A B C D

P0                    0 0 1 2                0 0 1 2                      1 5 2 0

P1                    1 0 0 0                1 7 5 0

P2                    1 3 5 4                2 3 5 6

P3                    0 6 3 2                0 6 5 2

P4                   0 0 1 4               0 6 5 6

Answer the following questions using the banker’s algorithm:

a. What is the content of the matrix Need?

b. Is the system in a safe state? Demonstrate the reason for your answer.

c. If a request from process P1 arrives for (0,4,2,0), can the request be granted immediately? Demonstrate the reason for your answer.

IN TEXT ONLY!!!

Solutions

Expert Solution

Allocated Max

A B C D A B C D
P0 0 0 1 2 0 0 1 2
P1 1 0 0 0 1 7 5 0
P2 1 3 5 4 2 3 5 6
P3 0 6 3 2 0 6 5 2
P4 0 0 1 4 0 6 5 6

Available = ( 1 5 2 0 )

a) Need = Max - Allocated

Need

A B C D
P0 0 0 0 0
P1 0 7 5 0
P2 1 0 0 2
P3 0 0 2 0
P4 0 6 4 2

b) Available = 1 5 2 0

P0 allocated = 0 0 1 2 (P0 releases all the resources allocated to it)

Available = 1 5 3 2

P2 allocated = 1 3 5 4

Available = 2 8 8 6

P1 allocated = 1 0 0 0

Available = 3 8 8 6

P3 allocated = 0 6 3 2

Available = 3 14 11 8

P4 allocated = 0 0 1 4

Available =3 14 12 12

All processes are served successfully so System is in a safe state.

c) If P1 is allocated with ( 0 4 2 0 ) then Allocated and need matrices, Available vector will be changed.

Allocated Need

A B C D A B C D
P0 0 0 1 2 0 0 0 0
P1 1 4 2 0 0 3 3 0
P2 1 3 5 4 1 0 0 2
P3 0 6 3 2 0 0 2 0
P4 0 0 1 4 0 6 4 2

Available = ( 1 1 0 0 )

P0 allocated = 0 0 1 2

Available = 1 1 1 2

P2 allocated = 1 3 5 4

Avaiable = 2 4 6 6

P1 allocated = 1 4 2 0

Available = 3 8 8 6

P3 allocated = 0 6 3 2

Available = 3 14 11 8

P4 allocated = 0 0 1 4

Avaialable = 3 14 12 12

All processes are served successfully So system is safe if we serve P1. So request can be granted.


Related Solutions

Consider the following snapshot of a system:
Consider the following snapshot of a system:           Allocation       Max          Available             ABCD         ABCD           ABCDT0        3141           6473            2224T1        2102           4232 T2        2413           2533 T3        4110           6332T4       ...
Consider the following snapshot of a system that has four resource types: A, B, C, and...
Consider the following snapshot of a system that has four resource types: A, B, C, and D and five processes, P0, P1, P2, P3, and P4. Allocation Max A B C D A B C D P0 3 0 1 5 5 1 1 7 P1 2 2 1 0 3 2 1 1 P2 3 1 2 1 3 3 2 1 P3 0 5 1 0 4 6 1 2 P4 4 2 1 3 6 3 2...
Consider the optimal allocation (c0;c2e;c2u) that is implemented by the optimal insurance system you computed in...
Consider the optimal allocation (c0;c2e;c2u) that is implemented by the optimal insurance system you computed in question 1 part c. Observe that we assumed agents cannot borrow or save on their own. If they were allowed to save and borrow privately, can the optimal insurance system still implement the optimal allocation? Show your work.
consider the following equation, max r = 4x + y + 6z 2x + y +...
consider the following equation, max r = 4x + y + 6z 2x + y + 2z <= 10 x + 2y + z <= 9 x + 2z <= 6 x, y, z >= 0 The tableau corresponds with a step of the SIMPLEX method applied to the previous problem Basic x y z s1 s2 s3 bi s1 1 1 0 1 0 -1 4 s2 1 / 2 2 0 0 1 -1 / 2 6 z...
Consider the following linear program:    MAX Z = 25A + 30B    s.t. 12A +...
Consider the following linear program:    MAX Z = 25A + 30B    s.t. 12A + 15B ≤ 300    8A + 7B ≤ 168 10A + 14B ≤ 280    Solve this linear program graphically and determine the optimal quantities of A, B, and the    value of Z. Show the optimal area.
Consider the following linear programming problem: Max Z =          3x1 + 3x2 Subject to:      ...
Consider the following linear programming problem: Max Z =          3x1 + 3x2 Subject to:       10x1 + 4x2 ≤ 60                   25x1 + 50x2 ≤ 200                   x1, x2 ≥ 0 Find the optimal profit and the values of x1 and x2 at the optimal solution.
Consider an investor who wishes to invest 40% allocation to defensive investments and 60% allocation to...
Consider an investor who wishes to invest 40% allocation to defensive investments and 60% allocation to growth investments. The investor has worked out the forecasted volatility, expected return and correlation between the two types of investments as below: Investments Volatility Return Defensive 6% per annum 5% per annum Growth 18% per annum 11% per annum The correlation between growth and defensive investments is 0.05 Calculate the return and volatility of the portfolio. Group of answer choices 8.6% and 11.18% 8.6%...
Q1. Graphical Solution Consider the following model and answer to the questions. Max 16X + 12Y...
Q1. Graphical Solution Consider the following model and answer to the questions. Max 16X + 12Y S.T. Constraint 1 5X + 4Y ≤ 60 Constraint 2 5X + 8Y ≤ 80 Constraint 3 X ≥ 2 Constraint 4 Y ≥ 4 Constraint 5 -6X + 2Y ≤ 0 X, Y ≥ 0 A) Plot all constraints and determine the feasible region. How many angles does your feasible region have? B) What is the optimal point? C) What is the optimal...
Consider the following linear program:    MAX Z = 25A + 30B    s.t. 12A + 15B ≤...
Consider the following linear program:    MAX Z = 25A + 30B    s.t. 12A + 15B ≤ 300    8A + 7B ≤ 168   10A + 14B ≤ 280    Solve this linear program graphically and determine the optimal quantities of A, B, and the    value of Z. Show the optimal area.
4-Consider the following problem: max − 3x1 + 2x2 − x3 + x4 s.t. 2x1 −...
4-Consider the following problem: max − 3x1 + 2x2 − x3 + x4 s.t. 2x1 − 3x2 − x3 + x4 ≤ 0 − x1 + 2x2 + 2x3 − 3x4 ≤ 1 − x1 + x2 − 4x3 + x4 ≤ 8 x1, x2, x3, x4 ≥ 0 Use the Simplex method to verify that the optimal objective value is unbounded. Make use of the final tableau to construct an unbounded direction..
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT