17. An old emperor placed his will in an iron box, which was equipped with several locks, each having several keys. The keys were distributed among his five sons. The old emperor required that after his death, the iron box could be opened only if at least three of his sons were present. How many locks are needed at least? And how should the keys be distributed among his sons?
17. Let the set of the five sons be $\{1,2,3,4,5\}$. The set of its binary subsets is $S=\{\{1,2\},\{1,3\}, \cdots,\{4,5\}\}$. Clearly, the number of elements in $S$ is $|S|=C_{5}^{2}=10$. Let the set of locks that the $i$-th son can open be $A_{i}, i=1,2,3,4,5$. Thus, the set of locks is $A=A_{1} \cup A_{2} \cup A_{3} \cup A_{1} \cup A_{5}$.

We now establish a mapping $\varphi$ from $S$ to $A$. For any $i, j (1 \leqslant i<j \leqslant 5)$, by the condition, there is at least one lock that cannot be opened by the $i$-th son and the $j$-th son. Let this lock be $a_{i j}$, then $a_{i j} \notin A_{i} \cup A_{j}$. Thus, let $\varphi:\{i, j\} \rightarrow a_{i j}$, which is a mapping from $S$ to $A$. It is easy to see that $\varphi$ must be injective. In fact, if there are $k, m, 1 \leqslant k<m \leqslant 5, \{i, j\} \neq\{m, k\}$, and $\varphi:\{m, k\} \rightarrow a_{i j}$, then $|\{i, j\} \cup\{m, k\}| \geqslant 3$, but they all cannot open $a_{i j}$, which contradicts the condition. Therefore, $|A| \geqslant|S|=10$, meaning at least 10 locks are needed. 

Furthermore, it can be proven that 10 locks are sufficient. In this case, $\varphi$ is a one-to-one mapping from $S$ to $A$. If $\{i, j\}$ corresponds to $a_{i j}$, then all sons except the $i$-th and $j$-th sons are given the key to open $a_{i j}$. This way, for any $i$ and $j$, there is exactly one lock $a_{i j}$ that cannot be opened by the $i$-th and $j$-th sons, and if another son is added, they can open all the locks.