What is the combination probability?

Capodecina
Soldato
Joined
1 Aug 2005
Posts
20,001
Location
Flatland
We have digilocks at work with buttons which say 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, X, Y, Z.

Format of codes is normally <number><number><number><number><letter>

Now, the order of the numbers + letter doesn't matter. You will find this with many non-electrical digilocks.

What probably is there that someone can gain entry after just hitting four random numbers and one random letter in any order?
 
Soldato
Joined
1 Jun 2012
Posts
2,817
Location
UK
Is it just the probability you're after? Cause another thing as well. How used is the keypad?
If its the same keycode for everyone, makes it very obvious after a while what the 5 digits are. Then its just trial and error.
 
Capodecina
Soldato
OP
Joined
1 Aug 2005
Posts
20,001
Location
Flatland
There are 210 combinations of 4 numbers, and 3 letters to choose, so 630 possible combinations

The order of numbers and letters doesn't matter.

So 1234Y will gain you entry just as 14Y23 will.

If we don't think of them as letter + numbers but just five characters, surely the chance will increase?
 
Soldato
Joined
6 Sep 2005
Posts
5,996
Location
Essex
The order of numbers and letters doesn't matter.

So 1234Y will gain you entry just as 14Y23 will.

If we don't think of them as letter + numbers but just five characters, surely the chance will increase?

It's easier to think about whether you are right with each key press.

1. First guess is 4 numbers out of 10 possible.
2. Second is 3 numbers out of 9 possible.
3. Third is 2 numbers out of 8 possible.
4. Fourth is 1 number out of 7 possible.
5. Fifth is 1 letter out of 3 possible.

Which gives:

4/10 x 3/9 x 2/8 x 1/7 x 1/3 = 0.16%.

FYI - the result is the same if you change where the letter is in the equation.

If my vague memories of A level maths is right.
 
Man of Honour
Joined
11 Dec 2002
Posts
10,815
Location
Darkest Norfolk
I think the context here is probably important, chances are theres wear showing on the keys that are used & its quite possible who ever 'guessed' the code (if thats what happened) got the code or gained access a different way.
 
Associate
Joined
1 Dec 2017
Posts
293
If its the same keycode for everyone, makes it very obvious after a while what the 5 digits are.

Exactly this. I had a contractor let himself into the building I was working in once. When questioned how, he said that it was obvious what the numbers where on the keypad due to the build up of grime. Needless to say they were cleaning thoroughly after that.
 
Soldato
Joined
18 May 2004
Posts
2,864
Location
Lincoln, Uk
Exactly this. I had a contractor let himself into the building I was working in once. When questioned how, he said that it was obvious what the numbers where on the keypad due to the build up of grime. Needless to say they were cleaning thoroughly after that.

I have a colleague who is pretty good at this, we would often be working in a building out of hours and after being assured that Yes, all the doors are open for you (Fixed electrical testing - we need access to all places, except the smallest cupboards with no light in), we invaraibly find some small office or cleaning store secured with one of these, I've managed it a time or two but not reliably, athough I do remember some place that has an electronic keypad and maglocks (order does matter here) you could see which 4 buttons were pressed which would narrow it down to 24 codes, but two of them were keys were 1 and 9, pretty good shot that it would be year then, one combination would be about 90 years ago.... perhaps not that one, enter the other one... door open on first try :p (No one asked how I got in though)

As to the original question, a key is either set or unset (as stated order doesn't matter and repeat digits are just the same as single ones*) so there are 13^2 = 8192 unique ways it could be set, so someone who knew this could have a 1 in 8192 of opening it each time they tried, however someone who didn't would have to go through a lot more combinations as codes in a different order, or containing repeating digits would map to the same one of the 8192 settings as another one

You could probably 'brute force' all the locking combinations in about 24 hours (and expect it on avaerage to take half that time to find the answer), however you can also 'brute force' it in 2 minutes with an oversized pair of pipe grips on the thumb turn and the internal locking pins bend and let it turn, it'll never work again though!

*If you set the code to 1111X, you could just press 1X to open it
 
Back
Top Bottom