A group of five people want to put a set of locks on a chest and distribute keys to the locks amongst themselves in such a way that all the locks on the chest could be opened only when at least three of them were present to open it.

How many locks would be needed, and how many keys?

Here is a solution with 13 locks and 39 keys. It probably isn't the minimum number. After the latest revision to the terms of the puzzle, determining and proving the minimum has become just another sorry candidate for a software program solution.

:-(

Any two people must be unable to unlock one of the locks. But then the other three can open it; otherwise there would be three people who couldn't open it. As there are 10 distinct groups of 2 people out of 5, there are AT LEAST 10 locks.

Let the people be A,B,C,D,E.

Possible groups of 3 are:

5*4*3/(3!) = 60/6 = 10

A+B+C

A+B+D

A+B+E

A+C+D

A+C+E

A+D+E

B+C+D

B+C+E

B+D+E

C+D+E

Lets use integers to signify both the locks and the keys to open them.

We can distribute 30 keys to 10 locks among the 5 people as follows:

A[1,2,3,4,7]

B[1,3,4,5,6,7]

C[2,4,5,7,8,9,10]

D[1,5,6,8,9,10]

E[2,3,6,8,9,10]

But now A+D, B+C and B+E can open the chest !!!!!!