1.
What is Resource Allocation Graph (RAG)? What are the necessary conditions for deadlock? Explain. Determine if the system is safe from deadlock or not using Banker's Algorithm for given condition.
$\begin{array}{|c|c|c|c|}\hline \text{Need Matrix} & & & \\ \hline \text{Process} & A & B & C \\ \hline P1 & 11 & 6 & 4 \\ P2 & 3 & 4 & 1 \\ P3 & 8 & 2 & 3 \\ P4 & 3 & 2 & 4 \\ P5 & 5 & 2 & 3 \\ \hline \end{array}$
$\begin{array}{|c|c|c|c|}\hline \text{Allocation Matrix} & & & \\ \hline \text{Process} & A & B & C \\ \hline P1 & 3 & 1 & 1 \\ P2 & 3 & 1 & 0 \\ P3 & 4 & 1 & 1 \\ P4 & 1 & 0 & 1 \\ P5 & 2 & 0 & 1 \\ \hline \end{array}$
$\begin{array}{|c|c|c|}\hline \text{MAX Resource Matrix} & & \\ \hline A & B & C \\ \hline 17 & 8 & 10 \\ \hline \end{array}$
[10]