1. For any combination of 3 robbers, say robber 1, 2 and 3, they can not open the safe. This means there exists at least one lock that none of them has the key to. However, since 4 robbers can open the safe, this means each of the remaining three robbers has the key to this lock.
2. Thus, each combination of 3 robbers corresponds to at least one lock that only these 3 robbers don’t have the key to. So the total number of locks is at lease C(6,3) = 20.
3. 20 locks are sufficient. Name each lock after a 3-robber combination, e.g. Lock (1, 2, 3), Lock (2, 3, 5) and so forth. There are exactly 20 locks. For lock (1, 2, 3), give its keys only to robber 1, 2, and 3, and we do similarly to other locks. Then for each 3-robber combination, say (1, 2, 3), there is just one lock that they can not open: Lock (4, 5, 6). However, since robber 4, 5 or 6 has the key to this lock, every 4-robber combination can open the safe.
4. Generalization: If there are N robbers, and we want to hold the majority rule, there the number of locks required is: C(N, N/2) if N is even, C(N, (N-1)/2) = C(N, (N+1)/2) if N is odd.