yes @wanted , please see what i did here,
The standard Rule is :
" A system with m resources of same type being shared by n processes. The system is deadlock free if and only if --> The sum of all max needs is < m+n "
Now here in this question
1. n processes each requiring 4 resources. So total maximum need are 4n.
2. There are 21 resources are in total which is shared by n processes.
so applying above stated Rule
4n < 21+n
=> 3n< 21
=> n < 7 hence number of process must be less than 7 , which is 6 ( as maximum no of process can be executed asked in the question ).