Hiya Bright Folks,
They just installed a new keyless lock on the pharmacy back door at
the hospital at work. It has a
key pad, with the numbers 1- 5 and the handle. The key is 5 digits
long, using each number only
once. Initially, I thought the chances of randomly discovering the
combination was 1: 54,321 but
that can't be right. 11111 and 22222 and 33333 and even 51332 (the
double 3's) need to be
eliminated. So, just how many combinations are there? Is there a
formula that is used?
Thanks my bright friends!
DMI
Dave Irontail <14...@BigFoot.com> wrote in message
<35936667.12414132@news>...
SEE BELOW
Dave, I need clarification of these rules, and I don't see where the 54321
comes from.
a) If you allow any of 1...5 in any position, there are 3125 possibilities
(5*5*5*5*5).
b) If you don't allow any digit more than once, there are 120 possibilities
(5*4*3*2*1).
c) If you don't allow any digit to appear next to itself, there are 1280
possibilities (5*4*4*4*4).
In any case, there are five possibilities for the first digit.
For each remaining digit, multiply by the number of allowable digits.
Ben
ps.: 14EEE is certainly a big foot!
I just wanted to point out that 54, 321 could not work as the number of
possible combinations, because you only have the five numbers. What I mean is,
if that were the right number, than 34, 789 for instance could be a choice, but
three of these numbers are unavailable to us.
At any rate, ther are far less choices than you think. 120 combinations,
which I believe someone already said, is correct, provide we can;t re-use
numbers.
Walt Breymier
The formula is 5! = 5*4*3*2*1
>Thanks my bright friends!
>
>DMI
I have these at work, too, and have wondered how long it would take me
to get one open (without knowing the combo).
I can only use each number once, but sometimes they combine two
numbers together, i.e. hit 2+3 at the exact same time. Also, not all
of the numbers have to be used.
So- how many possible combinations?
jim
P(n,r) designates the number of permutations of n things taken r
at a time, and is given by P(n,r) = n!/(n-r)!.
Three cases need to be considered, each with several subcases.
A. No paired key-presses.
B. One paired key-press.
C. Two paired key-presses.
A. Only individual keys.
A1. One key. Obviously 5 possibilities.
A2. Two keys. P(5,2) = 20.
A3. Three keys. P(5,3) = 60.
A4. Four keys. P(5,4) = 120.
A5. Five keys. P(5,5) = 120.
A total = 325.
B. One paired keypress, plus zero to three keys pressed individually,
in any order. There are 10 distinct pairs (12,13,14,15,23,24,25,34,35,45).
B1. paired keypress only. Obviously 10 possibilities.
B2. paired keypress plus one individual key. 10 * 3 (each of 10 pairs,
with each of 3 remaining individual keys) * 2 (because the pair can occur
in either of two positions) equals 60.
B3. paired keypress plus two individual keys. 10 * P(3,2) * 3 (because
the paired keypress can occur in any of the first, second, or third
positions) = 10 * 3 * 3 = 90.
B4. paired keypress plus three individual keys. 10 * P(3,3) * 4 = 240.
(Four possible positions for the paired keypress)
B total = 10 + 60 + 90 + 240 = 400.
C. Two paired keypresses, plus zero or one individual keys.
C1. Two paired keypresses. P(10,2) = 90.
C2. Two paired keypresses plus one individual key (there's only one
left). Again, P(10,2) = 90.
C total = 90 + 90 = 180.
Total = A + B + C = 325 + 400 + 180 = 905.
Through tedious counting you can arrive at 1082 combinations.
Will Watson
The first part is right -- you don't need to use all the numbers. But the
ones that I've used do not permit more than two keys to be pressed at once.
Well, there are 5 digits that can be used, but each only once.. So look at
it this way. In choosing the first number, you have 5 choices, but when
you go to choose the second number, you can't use the same as the first..
etc, etc.. until the last number, you only have one choice (i.e. the one
digit not yet used) -- so, there are 5*4*3*2*1 = 120 combinations.. not a
very good lock, is it? <G> (btw, how did you come up with the number 54321
as a number of combinations?)
--
+--------------------------------+----------------------------+
| Matt Parker | "Intellectuals solve |
| ~~~~~~~~~~~ | problems, geniuses prevent |
| rot13 encrypted email address: | them" |
| zngg....@ujpa.bet | - Einstein |
+--------------------------------+----------------------------+