Let the no.of processes = N
Let each process requires r resources and Total Resources = R
for avoiding deadlock:-
N*(r-1) + 1 ≤ R
N * 2 + 1 ≤ 100 ===> 2 N ≤ 99 ===> N ≤ 49.5
Now the doubt arises... we have take 49 or 50?
take 50 processes ===> allocate 2 resources for P1,...P49, ===> 49*2=98 resources consumed
now allocate remaining resources P50 ===> Lead to DEADLOCK
take 49 processes ===> allocate 2 resources for P1,...P49, ===> 49*2=98 resources consumed
now allocate remaining resources to any process it will never Lead to DEADLOCK
Therefore Maximum no.of processes, never lead to deadlock = 49