10,000 Word Combinations

I recently decided to learn lock picking. While buying a couple of padlocks to start with, I noticed an alphabetic combination lock advertising "10,000 Word Combinations."

The Master Lock 643DASTWD in its packaging. The packaging states, among other things, "10,000 Word Combinations."

The lock1.

The lock in question consists of 4 wheels, each with 10 letters, which obviously gives 10,000 possible combinations. But the packaging doesn't just promise 10,000 combinations - it specifically mentions 10,000 word combinations, which is clearly wrong since not all combinations will actually be words.

I didn't buy the lock, but I was able to find a blog post describing the letter configuration used by most Master Lock 4-letter fixed-disk combination locks, so I decided to do some experimenting.

I used this word list for my analysis. It's pretty broad and definitely contains some very niche and arguably-not-English words, as well as acronyms, but I chose this over a smaller list of more common words in order to be as charitable as possible to Master Lock.

Right off the bat, we have a problem: the list only contains 7,186 words, which is well under the advertised 10,000. And of these words, the Master Lock configuration only allows 1,508 of them as combinations. That's less than a sixth of the advertised 10,000.

This raises two obvious questions: what is the optimal letter configuration (in the sense of allowing the greatest number of English words), and how did Master Lock choose its own configuration?

What is the optimal configuration?

One naive approach to creating a "good" lock would be to put the 10 most common letters on each wheel. But this is actually a lot worse than the Master Lock configuration, yielding only 870 words.

A better approach would be to pick the 10 most common initial letters for the first wheel, the 10 most common second letters for the second wheel, and so on. This gets us 1,732 possible words, which is already better than the Master Lock configuration.

But it turns out that we can do a bit better than this. I tried two optimization approaches - a beam search and an evolutionary algorithm. Both found the same configuration, which allows for 1,841 words. That's a 22% improvement over the Master Lock. I can't prove that this is optimal2, but the fact that both algorithms reach the same conclusion makes me suspect that it is.

Approach Words Configuration
Frequency (naive) 870 AEILNORSTU
AEILNORSTU
AEILNORSTU
AEILNORSTU
Master Lock 1508 BDJLMNPRST
AEHILORTUY
ACDELNORST
DEHKLNRSTY
Frequency (per wheel) 1732 ABCDGLMPST
AEHILNORUY
AEILNORSTU
ADEKLNOSTY
Beam Search 1841 BCDFGLMPST3
AEHILORTUY
AEILNORSTU
ADEKLMNRST
Evolutionary Algorithm 1841 BCDFGLMPST
AEHILORTUY
AEILNORSTU
ADEKLMNRST

Finally, I should point out that the meaning of "optimal" depends on the word list, although when I ran the same experiments on a smaller English word list I got similar results4.

How did Master Lock design their locks?

It's not immediately clear why Master Lock chose the configuration that they did.

The fact that their configuration is reasonably similar to my possibly-optimal one suggests that they did do some optimization for a list consisting mostly of English words, but there are some weird characteristics - particularly the J on the first wheel - that seem unlikely to arise from just a list of English words.

My hypothesis is that the target word list used by Master Lock also included names. I started to suspect this when I noticed that this instruction sheet provided by Master Lock includes not only a list of 300 possible words (very few of which begin with J) but also a separate list of 53 names, 17 of which begin with J. And when I briefly tried re-running my beam search and evolutionary algorithm experiments on a list including names as well as words, I did end up with a J on the first wheel, as well as other similarities to the Master Lock configuration not found when optimizing for words only. So I think it's pretty likely that this more-or-less explains how Master Lock chose the configuration that they chose.


  1. Image from [officeworks.com](https://www.officeworks.com.au/shop/officeworks/p/master-lock-40mm-word-padlock-mlword40mm). I'm pretty sure this can be considered fair use, but I also intend to replace it with a photo of my own next time I go to the hardware store.
  2. There are about 7.96e26 possible configurations, which is way too many to check.
  3. The L can be replaced with H for an equivalent score.
  4. i.e. the different optimization approaches were still ranked in the same order, the resulting configurations were fairly similar, and the final two algorithms still both converged to the same value.