Math Question

Damn Yankee

Member
Joined
Jan 28, 2006
Messages
1,634
Reaction score
1,066
City & State/Province
Gulf Coast Mississippi
How many different combinations are their on my gun safe key pad with numbers from 1-9 +0 using five numbers in the combination and one number is used twice?
 
If there are five numbers in the combo, using digits 0 - 9, there are a possible 100,000 combinations, going from 00000 to 99999.

Using one digit twice, as in 15020, there would be, on a rough SWAG, a quarter of that. 25,000.

I know the first sentence is right.

The second one is a guess. :D
 
For a straight 5-digit 0-9 combo, the answer is easy - 10 to the 5th power (10^5) or 100,000 possible settings (including 00000)

The requirement that one digit must repeat makes it a bit more complicated to calculate, but seems to me it lowers the possible combo count by 10 (possible selections) multiplied by 5 (possible positions for the duplicate).

So, 100,000 minus 50, or 99,950 would be my off-the-cuff answer.
 
Using 0-9 - Five Digits - One of the digits being repeated.

Math term clarification:
Combination - a group of terms in any order ( e.g. 123, 231, 312, 132, 213, 321)
Permutation - a group of terms in SPECIFIC order. (e.g 231)

What is commonly called Combination for a safe is really a mathematician’s permutation.

Start with FOUR UNREPEATED DIGITS - Results in 5040 possible permutations. ( 10 * 9 * 8 *7 )

Now we need to add the FIFTH digit which is one of the FOUR in each permutation.
Results in 20,160 possible permutations.
Each of the 5040 four digit permutations can have any one of the FOUR digits repeated.

Warning: A Mathematician explaining this would invoke factorials in his calculations.

Bekeart
 
Last edited:
Using 0-9 - Five Digits - One of the digits being repeated.

Math term clarification:
Combination - a group of terms in any order ( e.g. 123, 231, 312, 132, 213, 321)
Permutation - a group of terms in SPECIFIC order. (e.g 231)

What is commonly called Combination for a safe is really a mathematician’s permutation.

Start with FOUR UNREPEATED DIGITS - Results in 5040 possible permutations. ( 10 * 9 * 8 *7 )

Now we need to add the FIFTH digit which is one of the FOUR in each permutation.
Results in 20,160 possible permutations.
Each of the 5040 four digit permutations can have any one of the FOUR digits repeated.

Warning: A Mathematician explaining this would invoke factorials in his calculations.

Bekeart

Very clearly expressed... however, I see no restriction against more than one repeated digit in the OP. One re-use is required by the question, but nothing stipulates that the remaining digits must not duplicate.

I think I'll have to stand by my initial answer, absent further clarification. ;)

If one and only one repetition is both required and allowed, then 5,040 is the correct answer... and it also clearly demonstrates how the inherent security of the lock would be greatly diminished by excluding repetitions, by elimination of roughly 95,000 potential correct answers from the pool.

Incidentally, a requirement for "no more than one repetition" would likely be intended to eliminate the 12 most commonly set and therefore most commonly guessed combinations - those being 00000, 11111, 22222,... 99999, plus 12345 (The "Scroob Modulus"*) and 54321. People being lazy and all.


(*Blatant apocryphal film reference)
 
Last edited:
Based on the stipulation of one (and only one) digit repeating, I believe the correct answer is....

10*9*8*7 gives the number of unique 4 digit combos without repetition. Everyone has agreed on that so far.

For the fifth digit, there are 4 digits to choose from and 4 unique positions to put it. 4*4 gives number of variations on the 4 digit combo with a duplicate fifth digit.

The hardest part of the whole thing is realizing that you really have only 4 slots to put the duplicate digit (instead of 5) because a code of 12234 can arise by puting the duplicate 2 in the second or third slot. Obviously, the code is the same either way.

10*9*8*7*4*2=80,640 unique 5 digit codes with one and only one digit repeating.
 
Last edited:
Based on the stipulation of one (and only one) digit repeating, I believe the correct answer is....

10*9*8*7 gives the number of unique 4 digit combos without repetition. Everyone has agreed on that so far.

For the fifth digit, there are 4 digits to choose from and 4 unique positions to put it. 4*4 gives number of variations on the 4 digit combo with a duplicate fifth digit.

The hardest part of the whole thing is realizing that you really have only 4 slots to put the duplicate digit (instead of 5) because a code of 12234 can arise by puting the duplicate 2 in the second or third slot. Obviously, the code is the same either way.

10*9*8*7*4*2=80,640 unique 5 digit codes with one and only one digit repeating.

The more I look at this, the more I think I agree mostly WRT one-and-only-one-dupe, except for the typo - - should be "10*9*8*7*4*4".

The final number of 80,640 is correct; I think you just mistyped.
 
I believe that Alpo has the right answer in his first sentence, regardless of whether YOU choose to use one number twice. I don't believe that the lock requires you to use one number twice, and I don't believe that you will post a sign on the safe saying that one number is used twice. And if you did post it, nobody would believe it, bringing us back to Alpo's first sentence.
 
Last edited:
Thanks everyone for your answers. The reason I asked is the key pad has started to show the ware pattern on the numbers I have it programed it too.

Thinking about changing the combo but with over eighty thousand different combo's and the safe locking for twenty minutes after entering three wrong numbers I will leave it as is.

Just goes to show everyone if you got a question, ask and you will get a answer from our fine members.
 
Tain't so McGee

The more I look at this, the more I think I agree mostly WRT one-and-only-one-dupe, except for the typo - - should be "10*9*8*7*4*4".

The final number of 80,640 is correct; I think you just mistyped.

******
The calculation above "10*9*8*7*4*4" represents SIX digits. NOT the FIVE given in initial conditions.

******

For UNIQUE FOUR DIGIT Permutations:

10 Possible Values for the First Digit
9 Possible Values for the Second Unique Digit
8 Possible Values for the Third Unique Digit
7 Possible Values for the Fourth Unique Digit


10 * 9 * 8 * 7 = 5040 number of Permutations for FOUR UNIQUE digits.

From given initial conditions of one digit being repeated:
The FIFTH digit must be one of these four. Thusly * 4

QED 10 * 9 * 8 * 7 * 4
 
Last edited:
******
The calculation above "10*9*8*7*4*4" represents SIX digits. NOT the FIVE given in initial conditions.

******

For UNIQUE FOUR DIGIT Permutations:

10 Possible Values for the First Digit
9 Possible Values for the Second Unique Digit
8 Possible Values for the Third Unique Digit
7 Possible Values for the Fourth Unique Digit


10 * 9 * 8 * 7 = 5040 number of Permutations for FOUR UNIQUE digits.

From given initial conditions of one digit being repeated:
The FIFTH digit must be one of these four. Thusly * 4

QED 10 * 9 * 8 * 7 * 4

Not quite QED my friend. The fifth digit has five potential slots to go in. Only four of them are unique. Thus the four tacked on the end. It is a calc for a 5 digit number. Did you read it?

Your calc assumes the duplicate is in only one slot (say the last slot). My calc assumes any slot is eligible for the duplicate.
 
Then how many licks does it take to get to the center of a Tootsie Pop?
 
100,000 is the correct answer. Combinations of 0 - 9 among five digits include repeating any of those digits up to five times: 00000, 00001, 00002 ... 11111. 11112, --- 99999.
 
Thanks everyone for your answers. The reason I asked is the key pad has started to show the ware pattern on the numbers I have it programed it too.

Thinking about changing the combo but with over eighty thousand different combo's and the safe locking for twenty minutes after entering three wrong numbers I will leave it as is.

Just goes to show everyone if you got a question, ask and you will get a answer from our fine members.


If you're saying it's getting to the point someone could tell which 5 digits (4 since you reuse one?) are the used digits, that's a different number from considering all 10 buttons, but I'm also wondering if a potential thief would know how many digits are required for the combo. if I didn't know how many digits it would be theoretically I'd have to try from 1 to 8 or so, though I'd start at 4 since 4 show wear and then try 5 digit combos, etc.

As a thief I'd have to test with replacement b/c I don't know how many digits repeat, so with only 4 to choose from, the 4 that show wear, I think it would be (been a while since I did this) a permutation with replacement:

4x4x4x4 or 4^4 to test the 4 digit combos = 256
4x4x4x4x4 or 4^5 to test the 5 digit combos = 1024

since your code is 5 digits if I start with testing 4 digit codes (4 show wear) , then test 5 digit, i should hit it between my 257th and 1,280th try.

Am I understanding the situation correctly? Doing the math off the cuff too, hope someone jumps in to fix it but I think it's a straight permutation with replacement from the thief's perspective if you've only got wear on 4 buttons so he only tries those 4.
 
100,000 is the correct answer. Combinations of 0 - 9 among five digits include repeating any of those digits up to five times: 00000, 00001, 00002 ... 11111. 11112, --- 99999.

Nope.

There are 100,000 five digit numbers TOTAL.

The OP said using one (and we have been presuming ONLY one) number twice (and not three or four or five times).
 
Nope.

There are 100,000 five digit numbers TOTAL.

The OP said using one (and we have been presuming ONLY one) number twice (and not three or four or five times).
Got it but it doesn't change the odds of finding any combination.
 
OP wants to know the number of 5 digit combos with one repeated, not the odds of someone guessing them.

The odds of blindly guessing the correct combo would be 1/80,640 ASSUMING the their knew it was a 5 digit code with one and only one numeral repeated.

The odds of blindly guessing the correct combo with no PRIOR information about the code (digits repeated, etc) would be 1/100,000.

The odds of guessing it if you KNOW the four digits used (worn keypad revealing the digits) is substantially smaller than either of the above.
 
Too many for the common thief to try in a normal burglary attempt. He'll just put a log chain around your safe, drag it to his pickup, take into the country and pry it apart. :-)
 
Back
Top