The number of keys on your key ring has been growing steadily over time, and now you already have 15 keys to keep track of! Unfortunately, you are unable to distinguish one key from another (apart from testing on doors), as they all look something like this:

enter image description here

There is no engraving or mark of any kind on any of the keys to tell you which door it opens. So every time you've opened a door, it involved tediously checking each key until you use the right key. Surely there must be a better way!

So, how can you place the keys on the key ring so that every time you want to open a door, the first key you try is guaranteed to work?


  • You are not allowed to mark the keys or key ring in any way.
  • The keys must always remain on the key ring after the initial arrangement.
  • You may not add anything to the key ring except the 15 identical-looking keys you need to keep track of.
  • You should always be able to identify the right key only by examining the arrangement of the keys on the key ring.
  • Your solution should be easily modifiable if the number of keys increases.
  • Between opening doors, the keys sit in your pocket. No holding on to one key as a reference.
  • 1
    $\begingroup$ I guess there's no solution if there are only two locks $\endgroup$
    – Jasen
    Aug 4, 2018 at 10:59

2 Answers 2


Since the keys are arranged in a circular fashion, I think I need to identify both an origin and a direction, no matter which way the key ring is rotated, and no matter how many keys are moved from one side to the other along the ring.

This should do it with minimum trouble:

Number the locks 1 to N.

1. Arrange the keys on the key ring in clockwise numerical order, with every key's teeth pointing up
2. Turn key 1 on the keyring so that its teeth point down.

You can always return the keyring to this position, and thereby identify each key.

To extend this to accommodate for more keys,

any new lock should get the next number in the series.

The operation needed in case you have to return one of the keys is a bit more tedious though, since

you'll have to renumber all the locks with a greater number than the one that got removed.

(PS. I think the keys actually do look different: that kind of keys' functionality is entirely in the shape, so it two keys look exactly identical, they open the same lock)

  • $\begingroup$ Nice, this is a good simple solution that meets all requirements. Regarding your P.S., of course the keys do not have identical teeth. But you are unable to distinguish them. Let's say you cannot read the subtle features in the teeth. Also, it is unreasonable to expect you to study all of the keys' teeth. $\endgroup$
    – Riley
    Aug 4, 2018 at 4:55

You should be able to tell the difference between a key which is

in an up (U) or down (D) position by the teeth.

Even if the key ring is large enough so than the key can rotate around it, each key's teeth will remain in the same up or down position when pointing out from the ring.

Then arrange them in a circular pattern from one key to the last like:


You can continue this sequence, adding one to the up-downs each time. There doesn't have to be a complete triangular number of keys - even if the last U/D sequence is only, one or two like XY, you can tell from the reverse countdown 3U, 2D, 1U, XY than the X is the last door's key.

Need to know at the start which key works for each door and arrange them in this order on the ring.

  • $\begingroup$ Could you elaborate on rot13(ubj lbh qrgrezvar juvpu qverpgvba vf hc) and rot13(ubj guvf pna or rkgraqrq rnfvyl gb zber xrlf)? $\endgroup$
    – Riley
    Aug 4, 2018 at 4:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.