Peak demands of p1,p2,p3 are 2,5 and 7.
allocate 1 less than peak demand i.e,, p1 --> 1 ,p2-->4 ,p3-->6
the number of resources for which deadlock occurs is 1+4+6 = 11
Add one to the number of resources we get 12 ,the value for which deadlock will not occur . ( 13 is nearest possible answer )