SEARCH HOME
Math CentralQuandaries & Queries

search

i have a problem. I have a 5 button lock and i seem to have forgotten the combination. You can only push each button once but you can push more than one button at a time and you don't have to use each button but i am pretty sure i used all five. for example it can be 1,2,3,4,5 or 1,2&3,4,5. I was wondering if anyone can get me a list of all the possibilities because i really need to get the box open. Thank you

Hi,

I am not going to give you a list but I will show you how to construct the list yourself. I am going to assume that you used all five buttons.

If you didn't use any pairs there are 5! = 120 possible combinations. You can list them is dictionary order, as if they were words in a dictionary

1,2,3,4,5
1,2,3,5,4
1,2,4,3,5
1,2,4,5,3
...
2,1,3,4,5
2,1,3,5,4
...
5,4,3,2,1

If you have one pair as in the example you sent 1,2&3,4,5 there are 5 choose 2 or 10 ways to choose a pair. They are

1&2, 1&3, 1&4, 1&5, 2&3, 2&4, 2&5, 3&4, 3&5, 4&5

In each case there are 3 remaining buttons so you have a 4 stroke combination. The pair can be in any of the 4 positions and the remaining 3 buttons can be pushed in 3! = 6 possible orders. Thus if your combination has 1 pair there are

10 × 4 × 3! = 240

possible combinations. For example if 1&2 is the pair and it is in the first position the possible combinations are

1&2,3,4,5
1&2,3,5,4
1&2,4,3,5
1&2,4,5,3
1&2,5,3,4
1&2,5,4,3

If 1&2 is in the second position the combinations are

3,1&2,4,5
3,1&2,5,4
and so on

If there are 2 pairs in the combination, for example 1&2,3&4,5, then there are 5 choose 2 or 10 ways to choose the first pair and 3 choose 2 or 3 ways to choose a pair from the remaining 3 buttons. The one remaining button can be in 3 possible positions first, second or third. For example if you choose the pairs 1&2 and 3&4 then you have combinations

5,1&2,3&4
1&2,5,3&4
1&2,3&4,5

But there are twice this many possible combinations here since you can change the order of the pairs

5,3&4,1&2
3&4,5,1&2
3&4,1&2,5

Thus if the combination has 2 pairs then there are

10 × 3 × 3 × 2 = 180

possibilities.

Hence if total there are 120 + 240 + 180 = 540 possible combinations.

Good luck with this,
Penny

About Math Central
 

 


Math Central is supported by the University of Regina and The Pacific Institute for the Mathematical Sciences.
Quandaries & Queries page Home page University of Regina PIMS