Qm
BrainteasersJane StreetCitadel

Locks and keys for a majority of five

Five people want to keep a document in a safe fitted with several locks. Every lock must be opened to open the safe, each lock can have several copies of its key, and each key opens only its own lock.

They want: any three of the five can open the safe together, but no two of them can.

What is the smallest number of locks needed, and how many keys must each person carry?

Show a hint

For every pair of people, there must be a lock that neither of them can open. Could one lock do this job for two different pairs?

Your answer

Solving needs a free account

Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

Handshakes at a partySplitting a team and scoring the productsHow many 3 by 3 Latin squares?100 prisoners and the light bulbAnts on a triangle
All questions →