Combinatorics riddle: keys and a safe There are 8 crew members, The leading member wants that only a crew of 5 people or more could open a safe he bought, To each member he gave equal amount of keys, and locked the safe with several locks.
What's the minimal number of locks he should put:


*

*at least 5 crew members would be required to open the safe?

*Any team of 5 crew members could open the safe, but none of the 4 team crew members.


1,2 stands individually of course.

This can easily be generalized, replacing 8 and 4 with a variable each.
Let the set of keys (and locks) be denoted by $K$. Let the set of keys that crew member $i$ doesn't receive be $K_i$.
For distinct indices, Condition 1 states that $K_{ijkl} = K_i \cap K_j \cap K_k \cap K_l \neq \emptyset$ (no 4 crew can open the safe), and condition 2 states that $K_i \cap K_j \cap K_k \cap K_l \cap K_m = \emptyset$ (any 5 crew can open the safe).
Claim: $ K_{ijkl} \cap K_{i'j'k'l'} = \emptyset$ for distinct quadruple sets.
Proof: Suppose not. Then $\{i, j, k, l, i', j', k', l'\}$ is a set with at least 5 distinct elements, contradicting condition 2. $_\square$
Hence, there must be at least $8 \choose 4$ locks.
Claim. $8 \choose 4$ is sufficient.
Proof: Label each of the locks with a distinct quadruple from 1 to 8. To each crew member, give him the key to the lock, if it doesn't have his number on it. Then, any 4 crew members $i, j, k, l$ will not be able to open lock $\{i, j, k, l\}$. Any 5 crew members will be able to open all locks.
