title: Banker's algorithm solution for given system state
body: <p>I have final test in OS Course, in the morning tomorrow, and I got stuck with an problem.</p>
  
  <p>Say we have 4 processes in our system: P1, P2, P3, P4, and 4 different resources: R1, R2, R3, R4.
  Current state of the system shown in this picture.</p>
  
  <p><img src="https://i.stack.imgur.com/4yBsZ.jpg" alt="enter image description here"></p>
  
  <p>The question is - "Is system in deadlock or not?" I solved few similar problems, so, I think, the system IS in deadlock, because there aren't enough available resources (for example P4 requests 2 instances of R3, but in available list exists only 1 resource of R3).</p>
  
  <p>I'm little confused because answer of my practitioner is : system isn't in deadlock, and processes running in this order: P4->P3->P1->P2</p>
  
  <p>Which Solution is Right?</p>
  
  <p>Thanks.</p>