A number of processes could be in a deadlock state if none of them they execute due to nonavailability of sufficient resources. Let $P_i, 0 \leq i \leq 4$ represent five processes and let there be four resources types $r_j, 0 \leq j \leq 3$. Suppose the following data structures have been used.
Available: A vector of length 4 such that if Available $[i]=k$, there are k instances of resource type $r_j$ available in the system.
Allocation. A 5 $\times$ 4 matrix defining the number of each type currently allocated to each process. If Allocation $[i,j]=k$ then process $p_i$ is currently allocated $k$ instances of resource type $r_j$.
Max. A 5 $\times$ 4 matrix indicating the maximum resource need of each process. If $Max[i,j]=k $ then process $p_i$, may need a maximum of $k$ instances of resource type $r_j$ in order to complete the task.
Assume that system allocated resources only when it does not lead into an unsafe state such that resource requirements in future night cause a deadlock state. Now consider the following snapshot of the system.
$$\textbf{Allocation}$$ 

r0 
r1 
r2 
r3 
$p_0$ 
0 
0 
1 
2 
$p_1$ 
1 
0 
0 
0 
$p_2$ 
1 
3 
5 
4 
$p_3$ 
0 
6 
3 
2 
$p_4$ 
0 
0 
1 
4 
$$\textbf{Max}$$ 
r0 
r1 
r2 
r3 
0 
0 
1 
2 
1 
7 
5 
0 
2 
3 
5 
6 
0 
6 
5 
2 
0 
6 
5 
6 
$$\textbf{Available}$$ 
r0 
r1 
r2 
r3 
1 
5 
2 
0 
Is the system currently in a safe state? If yes, explain why.