In worst case, all 3 programs may be allocated two-two resources each. So, currently 6 resource are allocated and system still in deadlock, if we have one more resource i.e total 7 resources then one program among three programs can take this 7th resource and will finish its execution and release all three allocated resources. Now, these free resources can be used by other two programs. So, with minimum 7 resource we never have deadlock.