Picking a Lock The 5-button Simplex Lock has only 1,082 possible combinations.

Picking a Lock The 5-button Simplex Lock has only 1,082 possible combinations. By comparison, this 3-dial lock (three wheels, each with digits 0-9) has 10 \times 10 \times 10 = 1, 000 possible combinations. Eag Creek 19 19 11019 The total number of combinations is not very different, but the Simplex Lock is much harder to pick because it is harder to systematically test each possible combination. In the lock above, you can simply list numbers 000-999, lowest to highest, and you will test each combination. If you change the lock to 4 dials, the number of combinations is now 10,000, but you can still step through all of them using the same strategy: List the numbers 0000-9999. How could you systematically test each combination of a 5- button Simplex Lock? This requires finding a way to list them all without missing any and without duplication. Can you extend your algorithm for lisiting combinations to an
-button lock?

The Correct Answer and Explanation is:

Algorithm for an n-Button Lock

A systematic method involves iterating through all possibilities in a structured way. For a lock with n buttons (e.g., n=5):

  1. Select the Subset of Buttons: First, choose a subset of buttons that will be used in the combination. You must cycle through all possible non-empty subsets. For a 5-button lock, this means first testing all combinations using just one button ({1}, {2}, etc.), then all combinations using a subset of two buttons ({1,2}, {1,3}, etc.), and so on, up to the subset of all five buttons {1,2,3,4,5}.
  2. Partition the Subset: For each subset of buttons selected, you must find all ways to partition it into smaller groups. Each group represents a single step in the combination (buttons to be pressed simultaneously).
    • Example: If your chosen subset is {1,2,3}, you can partition it as {{1},{2},{3}} (three separate presses), or {{1,2},{3}} (1 and 2 together, then 3), or {{1,3},{2}}, or {{2,3},{1}}, or {{1,2,3}} (all three at once).
  3. Order the Partitions: For each partition, you must test all possible orderings (permutations) of the groups.
    • Example: For the partition {{1},{2},{3}}, there are 3! = 6 orderings to test: (1-2-3), (1-3-2), (2-1-3), (2-3-1), (3-1-2), and (3-2-1).
    • Example: For the partition {{1,2},{3}}, there are 2! = 2 orderings to test: ((1,2)-3) and (3-(1,2)).

By methodically applying these three steps—iterating through all subsets, then all partitions of each subset, then all orderings of each partition—you will generate every possible combination without duplication or omission. This algorithm works for a lock with any number of buttons, n.


Explanation

Unlike a simple dial lock where combinations are ordered sequences of digits (e.g., 1-2-3), a Simplex lock combination is an ordered partition of a subset of buttons. This distinction is what makes it harder to “brute-force.” The key challenges are that a combination can use any number of the available buttons (from one to all five), and more than one button can be pressed simultaneously as a single step.

Our algorithm tackles this complexity by breaking it down logically. The first step, selecting a subset, addresses the fact that not all buttons must be used. For a 5-button lock, we would first test the 5 combinations that use one button (1; 2; 3; 4; 5). Then we would move to subsets of two buttons, like {1,2}.

The second and third steps work together to find all the ways to use that subset. For the subset {1,2}, we can partition it in two ways. The first partition is {{1},{2}}, representing two distinct presses. We must then test both possible orderings: 1-then-2 and 2-then-1. The second partition is {{1,2}}, representing a single, simultaneous press. This has only one ordering: (1,2).

By systematically generating every subset, then every partition of that subset, and finally every ordering of those partitions, we create a complete and non-redundant list of all 1,082 valid combinations for the 5-button lock. This same three-step logic—select, partition, and order—can be applied to generate the complete combination set for a Simplex lock with any number (n) of buttons.

Scroll to Top