# Salesman's claim for mechanical keypad lock - 5 buttons and 545 combinations!

A company makes mechanical keypad locks.

The keypad is a set of five buttons arranged vertically.

O
O
O
O
O


The buttons are quite close together. Once a button is pushed in it stays in until the lock is opened or reset.

If the right combination of buttons are pushed in the correct order then a separate handle can be turned and the door opens. If not the action of turning the handle resets all the buttons so you start again.

The salesman says that there are $$545$$ different simple 'unlock combinations or sequences' which can be 'programmed' into this mechanical lock. Simple unlock combinations are combinations which can be punched into the keypad with a single finger.

Is the salesman correct? why or why not?

• Have to ask: Is this a 'real' scenario? It sounds like this guy used to sell snake oil before getting into the mechanical lock game. Oct 22, 2018 at 23:46
• @Chowzen, I use a mechanical lock like this most days... This lock I use inspired the puzzle.
– tom
Oct 23, 2018 at 0:12
• @Chowzen Look up "simplex cipher lock" Oct 23, 2018 at 2:23
• I'm confused - everyone seems to assume that order matters, but there's nothing in the question that indicates that it does. I see five buttons with two states each = 32 combinations. Oct 23, 2018 at 10:16
• The key word here is "combination" - many of these locks are indeed combination locks, and the buttons may be pressed in any order. It sounds like the salesman's calculation is for a permutation lock (where the order of the pressed buttons is significant). Oct 23, 2018 at 10:44

Using only combinations of either single or double button presses:

Using 1 press

1 single button = 5 combinations
2 together = 4
TOTAL 9

Using 2 presses

2 single buttons = 5*4=20
1 single button then 2 together = 12
2 together then 1 single button = 12
2 together then 2 together = 6
TOTAL 50

Using 3 presses

3 single buttons = 5*4*3=60
1 single button then 2 together then 1 single button = 24
2 together then 1 single button then 1 single button = 24
1 single button then 1 single button then 2 together = 24
2 together then 2 together then 1 single button = 6
2 together then 1 single button then 2 together = 6
1 single button 2 together then 2 together = 6
TOTAL 150

Using 4 presses

4 single buttons = 5*4*3*2=120
2 together then 1 single button then 1 single then 1 single = 24
1 single button then 2 together then 1 single then 1 single = 24
1 single button then 1 single then 2 together then 1 single = 24
1 single button then 1 single then 1 single then 2 together = 24
TOTAL 216

Using 5 presses

5 single buttons = 5*4*3*2*1=120
TOTAL 120

Total

9+50+150+216+120 = 545

For anyone curious as to my internal process of coming up with these values, I made a quick chart of each type of press combo and how many variations there were for each type, with x indicating it has already been counted; the ones with 1 or 2 (for 2 at a time) added together result in the total above:

1,1,1,1,1      5,20,60,120,120 = 325

2,1,1,1      4,12,24,24 = 64
1,2,1,1      x,12,24,24 = 60
1,1,2,1      x,x,24,24 = 48
1,1,1,2      x,x,x,24 = 24

2,2,1      x,6,6 = 12
2,1,2      x,x,6 = 6
1,2,2      x,x,6 = 6

3,1,1      3,6,6 = 15
1,3,1      x,6,6 = 12
1,1,3      x,x,6 = 6

3,2      x,2 = 2
2,3      x,2 = 2

4,1      2,2 = 4
1,4      x,2 = 2

5      1 = 1

as an example, the 1,3,1 means that a single button press is already counted (as 5 combinations), a single button followed by a triple results in 6 unique combinations, and a single button followed by triple and then another single results in 6 unique combinations

• And, of course, the 0-press... Oct 23, 2018 at 8:46
• great work, plus one - but it looks like two of you figured it out more or less simultaneously and I can only accept one of you as the correct answer - and both of you are new so I want to accept both your answers.... I will have to choose one of you, but be assured I would be happy to have accepted either of your answers as the correct answer to this problem.
– tom
Oct 23, 2018 at 10:02
• Is there not some double counting here? If I hit the first and second buttons with a single press that's the same as pressing button 1 then button2 isn't it?
– JimM
Oct 23, 2018 at 11:46
• @JimM No, for some locks you must press a pair of buttons together as part of the combination. So pressing 1+2 at (roughly) the same instant is not the same as pressing 1 then a second or two later pressing 2 (or vice versa).
– MT0
Oct 23, 2018 at 12:32

You have all the possibilities using only single button press

325 possibilities from Excited Raichu's answer.

Then the possible combinations using one pair are:

(12)345, 1(23)45, 12(34)5 and 123(45).
pressed : possible pairs × possible single × order
2 buttons : 4 × 1 × 1 = 4
3 buttons : 4 × 3 × 2 = 24
4 buttons : 4 × 3 × 6 = 72
5 buttons : 4 × 1 × 24 = 96
Total with one pair = 4 + 24 + 72 + 96 = 196

Then you have the possibilities using multiples pairs:

(12)(34)5, (12)3(45), 1(23)(45)
You have either 4 or 5 buttons pressed by having 2 pairs and you cannot have more than 2 pairs since there are 5 buttons total.
4 buttons : 3 × 2 = 6
5 buttons : 3 × 6 = 18
Total with 2 pairs = 6 + 18 = 24

325 + 196 + 24 = 545

Which is the expected answer from the question!

• great work, plus one - but it looks like two of you figured it out more or less simultaneously and I can only accept one of you as the correct answer - and both of you are new so I want to accept both your answers.... I will have to choose one of you, but be assured I would be happy to have accepted either of your answers as the correct answer to this problem.
– tom
Oct 23, 2018 at 10:02
• Ok from the timings I can see on the page now it looks like @RichieFrame was just before you with the answer, though I am sure that you were both typing out these answers at the same time. - so I will accept Richie's answer, but the answer you gave is good too - well done for sorting out all the spoilers as well.
– tom
Oct 23, 2018 at 18:20

Well, let's see. It's possible for 1 to 5 buttons to be pushed to create a combination, so let's calculate the number of possibilities for each individually, assuming you can pick the order of the buttons to be pushed.

1 Button

Well, there are only 5 possible combinations. This isn't hard.

2 Buttons

The number of possible combinations is C(5,2), or 10. You can arrange the order of each possible combination in 2!, or 2 ways. So the number of possible 2-button combinations is 20.

3 Buttons

Since C(5,3) is also 10, there are 10 different combinations. Each of these combinations can be reordered in 3!, or 6 ways. So the number of possible 3-button combinations is 60.

4 Buttons

C(5,4) is 5. So, there are 5 different combinations which each can be rearranged into 4!, or 24 ways. So the number of possible 4-button combinations is 120.

5 Buttons

Obviously, there is only 1 5-digit combination, but that can be rearranged in 5!, or 120 ways.

Total

5+20+60+120+120 = 325 possible combinations. Assuming there isn't any trickery here, the salesman is indeed incorrect.

• Great logic and this is correct as far as it goes, but I am afraid that there is something missing from this answer ... plus one for very useful contribution, but not correct I am afraid
– tom
Oct 22, 2018 at 23:21
• no Button pressed is also a possible combination :D Oct 23, 2018 at 7:16
• Note that $C(n,p)*p!=A(n,p)=\frac{n!}{(n-p)!}$ , which could simplify your notations Oct 23, 2018 at 8:42
• As Richie Frames answer makes clear, you've missed the set of combinations of single and multiple presses, and multiple/multiple presses. Oct 23, 2018 at 15:19

I believe the salesman may be underestimating the possibilities. In addition to Excited Raichu's 325 arrangements there are the following possibilities:

1)

No buttons pressed = 1 extra possibility

2)

Two neighboring buttons pressed simultaneously. For example (12)345, or 1(23)45, or 12(34)5, or 123(45). For each of these there is one possibility with a single button pair press (the pair would have to be pressed first). 12 consisting a pair and a single, 24 consisting a pair and 2 singles, and 24 consisting a pair and 3 singles. So an extra 61 combinations for each of the above. = 244 extra possibility

3)

Two pairs of neighboring buttons pressed so either (12)(34)5, or (12)3(45) or 1(23)(45). In each of these cases there is no option in which one button or pair is pressed (as it would be identical to one of the already covered possibilities). 2 options consisting pressing the two pairs (in either order), and 6 options pressing the 2 pairs and the single. So 8 in total for each of the above . = 24 possibilities

4)

If the buttons were really small then there could be 3 or more pressed simultaneously - but I will ignore these calculations as if that were the case it may be difficult to press only one at a time.

So the total could be at least

325 + 1 + 244 + 24 = 594

• I don't understand how pressing 2 buttons simultaneously doesn't just count as if they were pressed individually? How would it affect whether or not the lock works?
– ESR
Oct 23, 2018 at 1:17
• In your step #2, you count too much possibilities for a pair and either 1 or 2 singles. It should be 6 and 18 instead of 12 and 24. Also, we could assume that no button pressed could be rejected as the lock would be open by default. See my answer. Oct 23, 2018 at 3:38
• if neighbour buttons pressed is allowed, you can also press non-neighbour buttons at the same time too? @tom
– Oray
Oct 23, 2018 at 7:54
• @Oray the question says they are "quite close together", so it seems reasonable
– Kat
Oct 23, 2018 at 9:23
• @tom we can conclude that one finger can press all at once?
– Oray
Oct 23, 2018 at 10:31

Your lock looks a lot like a Kaba Simplex. This lock allows for codes where the order in which the buttons are pressed matters. Also, it allows for buttons needing to be pressed in unison, or not at all. Each button can be pressed only once, though.

Going by this assumption, we have:

## 325 Single Buttons Codes

Let's start by just pressing a single button at a time. Each code can be anywhere from 1–5 buttons long.

### Codes with 1 button

The number of single button codes is simply $$5$$ since that's the number of buttons.

### Codes with 2 buttons

For the first button, you can pick any of the 5 buttons, which leaves you 4 for the second button. This allows for a total of $$5 \times 4 = 20$$ two-button combinations. This is the number of permutations of 2 out of 5, or $$_5P_2$$

### Codes with 3 buttons

$$_5P_3 = 5 \times 4 \times 3 = 60$$

### Codes with 4 buttons

$$_5P_4 = 5 \times 4 \times 3 \times 2 = 120$$

### Codes with 5 buttons

$$_5P_5 = 5 \times 4 \times 3 \times 2 \times 1 = 5! = 120$$

The total number of codes you can enter this way is $$5 + 20 + 60 + 120 + 120 = 325$$ which is a lot less than the $$545$$ promised.

## 545 Codes including Pairs

But wait,

The buttons are quite close together.

so we can push two adjacent buttons together. After all, the Simplex allows for buttons to be pressed simultaneously with one finger. This adds a number of multi-button codes.

### Codes with 2 buttons

This adds $$4$$ codes, since there are 4 pairs of adjacent buttons that can be pressed together with one finger.

### Codes with 3 buttons

There are again $$4$$ possible pairs, which leave $$3$$ options for the single button. All of these can be used in two ways: either the pair first, or the single button first.
That gives us a total of $$4 \times 3 \times 2 = 24$$ codes with a pair and a single button.

### Codes with 4 buttons

Here we have two options. We can either use two pairs, or a pair and two single buttons.
With two pairs, we have $$3$$ options for the button we leave unpushed: either an outer button, or the middle button. We can push the top pair first, or the bottom pair first, so we have a total of $$3 \times 2 = 6$$ codes with two pairs.
With a single pair and two single buttons, we have $$4$$ options for the pair, then $$3$$ for the unpushed button, so that's $$4 \times 3 = 12$$ combinations. We can push the pair first, last, or in between the single buttons, and we can either push the top single button first or last. So that's $$12 \times 3 \times 2 = 72$$ codes.
That gives us a total of $$6 + 72 = 78$$ codes for 4 buttons with pairs.

### Codes with 5 buttons

Again, we have two options: two pairs and a single, or one pair and three singles.
With two pairs, the single button can be in $$3$$ places (just like the unpushed button). We can push the single button first, last, or in between the pairs, and we can push the top pair first or last. This gives us $$3 \times 3 \times 2 = 18$$ codes.
With a single pair, that pair can be in $$4$$ positions, the rest of the buttons being the single ones. We can push those single buttons in $$3 \times 2 \times 1 = 6$$ different orders, and we can push the pair first, second, third, or last. This gives us $$4 \times 6 \times 4 = 96$$ codes.
The total for 5 buttons with pairs comes to $$18 + 96 = 124$$ different codes.

Adding these all up gives us $$4 + 24 + 78 + 124 = 230$$ different codes when adding pairs into the mix.

Adding this to the number of single button codes, we get $$325 + 230 = 545$$ codes as promised.

## 582 Codes including Triplets

But can we do more? If we're really fat-fingered, or if the buttons are really close together, maybe we can try pressing 3 adjacent buttons at once.

### Codes with 3 buttons

There are just $$3$$ triplets we can pick here.

### Codes with 4 buttons

We have the same $$3$$ triplets and $$2$$ different single buttons to pick, and we can push the single button either first or last, for a total of $$3 \times 2 \times 2 = 12$$ different codes.

### Codes with 5 buttons

We can combine a triplet with either a pair, or two single buttons.
There are $$2$$ different ways to divide the 5 buttons into a pair and a triplet, and $$2$$ orders in which to press these, so that's $$2 \times 2 = 4$$ codes.
Or we can pick our triplet in $$3$$ ways, our remaining single buttons in $$2$$ different orders, and our triplet either first, last, or in between, so that's $$3 \times 2 \times 3 = 18$$ codes.
That's $$4 + 18 = 22$$ different codes.

So that's $$3 + 12 + 22 = 37$$ additional codes using triplets. If we add this to the $$545$$ codes we already had, we can even get $$545 + 37 = 582$$ codes in total.

We might as well continue. Let's try pressing 4 buttons at once. We have the choice of $$2$$ different quads, and the choice of pressing the remaining button before that, after that, or not at all. That's $$2 \times 3 = 6$$ codes with quads.

Adding these to what we already had, we get $$582 + 6 = 588$$ codes in total.

## 589 Codes including Quints

Let's go all the way and add the last possibility of pressing all 5 buttons at once. There's only $$1$$ way to do that.

That gives us a final total of $$588 + 1 = 589$$ possible codes that can theoretically entered using just a single finger.

I see my latest attempt is similar to @excited-raichu's answer, but I have a slightly different count...

There are

32 different combinations after pushing buttons

Of those, there are:

5 combos where 1 button is pushed, 11 combos where 2 buttons are pushed, 9 combos where 3 buttons are pushed, 5 combos where 4 buttons are pushed, and 1 combo where all 5 buttons are pushed.

Each can be pushed in:

#ButtonsPushed factorial ways

So:

5*1 + 11*2 + 9*6 + 5*24 + 1*120 = 321 possible combos (assuming you don't count no buttons being pushed as a combo).

• I like your logic, but the mechanical device is more clever than just knowing whether the button is pushed in or not... does that give a hint? Plus one for a useful contribution.
– tom
Oct 22, 2018 at 23:05
• in response to the question edit... interesting edit, but it is way too early for any (more) hints
– tom
Oct 22, 2018 at 23:22
• Oh, I see what I'm missing: r13(gur beqre gurl ner chfurq va) Oct 22, 2018 at 23:27
• Updated my answer Oct 22, 2018 at 23:38

If you are allowed to press every button one by one only, the answer will be;

$$\sum_{i=0}^{5}C(5,i)\cdot i!=326$$

which includes non pressing any button to unlock as well. But it seems

You are allowed to press two buttons or more at the same time with one finger.

But after this point this requires a computer programming in my opinion so I wrote a simple program which calculates all possibilities as below:

1
2
3
4
5
12
23
34
45
123
234
345
1234
2345
12345
1 2
1 3
1 4
1 5
1 23
1 34
1 45
1 234
1 345
1 2345
2 1
2 3
2 4
2 5
2 34
2 45
2 345
3 1
3 2
3 4
3 5
3 12
3 45
4 1
4 2
4 3
4 5
4 12
4 23
4 123
5 1
5 2
5 3
5 4
5 12
5 23
5 34
5 123
5 234
5 1234
12 3
12 4
12 5
12 34
12 45
12 345
23 1
23 4
23 5
23 45
34 1
34 2
34 5
34 12
45 1
45 2
45 3
45 12
45 23
45 123
123 4
123 5
123 45
234 1
234 5
345 1
345 2
345 12
1234 5
2345 1
1 2 3
1 2 4
1 2 5
1 2 34
1 2 45
1 2 345
1 3 2
1 3 4
1 3 5
1 3 45
1 4 2
1 4 3
1 4 5
1 4 23
1 5 2
1 5 3
1 5 4
1 5 23
1 5 34
1 5 234
1 23 4
1 23 5
1 23 45
1 34 2
1 34 5
1 45 2
1 45 3
1 45 23
1 234 5
1 345 2
2 1 3
2 1 4
2 1 5
2 1 34
2 1 45
2 1 345
2 3 1
2 3 4
2 3 5
2 3 45
2 4 1
2 4 3
2 4 5
2 5 1
2 5 3
2 5 4
2 5 34
2 34 1
2 34 5
2 45 1
2 45 3
2 345 1
3 1 2
3 1 4
3 1 5
3 1 45
3 2 1
3 2 4
3 2 5
3 2 45
3 4 1
3 4 2
3 4 5
3 4 12
3 5 1
3 5 2
3 5 4
3 5 12
3 12 4
3 12 5
3 12 45
3 45 1
3 45 2
3 45 12
4 1 2
4 1 3
4 1 5
4 1 23
4 2 1
4 2 3
4 2 5
4 3 1
4 3 2
4 3 5
4 3 12
4 5 1
4 5 2
4 5 3
4 5 12
4 5 23
4 5 123
4 12 3
4 12 5
4 23 1
4 23 5
4 123 5
5 1 2
5 1 3
5 1 4
5 1 23
5 1 34
5 1 234
5 2 1
5 2 3
5 2 4
5 2 34
5 3 1
5 3 2
5 3 4
5 3 12
5 4 1
5 4 2
5 4 3
5 4 12
5 4 23
5 4 123
5 12 3
5 12 4
5 12 34
5 23 1
5 23 4
5 34 1
5 34 2
5 34 12
5 123 4
5 234 1
12 3 4
12 3 5
12 3 45
12 4 3
12 4 5
12 5 3
12 5 4
12 5 34
12 34 5
12 45 3
23 1 4
23 1 5
23 1 45
23 4 1
23 4 5
23 5 1
23 5 4
23 45 1
34 1 2
34 1 5
34 2 1
34 2 5
34 5 1
34 5 2
34 5 12
34 12 5
45 1 2
45 1 3
45 1 23
45 2 1
45 2 3
45 3 1
45 3 2
45 3 12
45 12 3
45 23 1
123 4 5
123 5 4
234 1 5
234 5 1
345 1 2
345 2 1
1 2 3 4
1 2 3 5
1 2 3 45
1 2 4 3
1 2 4 5
1 2 5 3
1 2 5 4
1 2 5 34
1 2 34 5
1 2 45 3
1 3 2 4
1 3 2 5
1 3 2 45
1 3 4 2
1 3 4 5
1 3 5 2
1 3 5 4
1 3 45 2
1 4 2 3
1 4 2 5
1 4 3 2
1 4 3 5
1 4 5 2
1 4 5 3
1 4 5 23
1 4 23 5
1 5 2 3
1 5 2 4
1 5 2 34
1 5 3 2
1 5 3 4
1 5 4 2
1 5 4 3
1 5 4 23
1 5 23 4
1 5 34 2
1 23 4 5
1 23 5 4
1 34 2 5
1 34 5 2
1 45 2 3
1 45 3 2
2 1 3 4
2 1 3 5
2 1 3 45
2 1 4 3
2 1 4 5
2 1 5 3
2 1 5 4
2 1 5 34
2 1 34 5
2 1 45 3
2 3 1 4
2 3 1 5
2 3 1 45
2 3 4 1
2 3 4 5
2 3 5 1
2 3 5 4
2 3 45 1
2 4 1 3
2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
4 2 3 5 1
4 2 5 1 3
4 2 5 3 1
4 3 1 2 5
4 3 1 5 2
4 3 2 1 5
4 3 2 5 1
4 3 5 1 2
4 3 5 2 1
4 5 1 2 3
4 5 1 3 2
4 5 2 1 3
4 5 2 3 1
4 5 3 1 2
4 5 3 2 1
5 1 2 3 4
5 1 2 4 3
5 1 3 2 4
5 1 3 4 2
5 1 4 2 3
5 1 4 3 2
5 2 1 3 4
5 2 1 4 3
5 2 3 1 4
5 2 3 4 1
5 2 4 1 3
5 2 4 3 1
5 3 1 2 4
5 3 1 4 2
5 3 2 1 4
5 3 2 4 1
5 3 4 1 2
5 3 4 2 1
5 4 1 2 3
5 4 1 3 2
5 4 2 1 3
5 4 2 3 1
5 4 3 1 2
5 4 3 2 1


so there are

590 possibilities exist including non pressing any button.

if you can press two buttons at the same time at most with your finger, the answer would be

$$545$$ indeed. (non including non pressing any button)

so

If our salesman is really correct, then you cannot press more than two buttons at the same time with your fingers or it will not be functional on this mechanical keylock and non-pressing any button would not be considered a combination.

One outside the box solution:

The handle is not a true reset per-say. It's actually a sixth switch.

Your "true" passcode requires a "wrong" five digit code, a reset followed by the "right" one.

Both codes are in fact full codes in their own right.

So your code that appears to the world to be 12345 is obfuscated by doing 54321, Resetting then doing 12345.

Given there are 120 permutations of 5 digits, there are a truly staggering number of permutations of 10 digits (with a Reset in the middle). far more than 545, and so satisfying the salesman's claim by a significant margin.

• Fun answer, plus one, but sorry not correct
– tom
Oct 23, 2018 at 17:35

It seems that some of the solutions are double-counting combinations. The order of the pushes does not matter. Therefore, there are only 32 combinations.

• Welcome to Puzzling SE! It seems from other answers and comments from the creator that this lock is a permutation lock meaning the order is important to the locking mechanism. Oct 23, 2018 at 16:46