 |
 |
Puzzle / Permutation question? |
 |
Jun1-06, 10:34 AM
|
#1
|
thx1138 is
Offline:
Posts: 6
|
Puzzle / Permutation question?
Puzzle question...
I am developing an interactive combination lock that involves utilizing a total of 9 buttons to open a door. I am wondering how many combinations there are if the answer requires a certain three to be pushed on?
I am not sure how to calculate this, but I am trying to decide if I need to use more than nine or less to make this challenging?
I have never taken a stat class so I am basically starting from scratch but I have looked on the internet for permutations, etc...with no real progress...
I would appreciate any information about this...
Thanks
THX1138
|
|
|
|
Jun1-06, 11:21 AM
|
#2
|
Tide is
Offline:
Posts: 3,132
Recognitions:
Homework Helper
Science Advisor
|
Will the three buttons need to be pressed in a particular order?
|
|
|
|
Jun1-06, 11:31 AM
|
#3
|
thx1138 is
Offline:
Posts: 6
|
No;
They will just have to have the correct three turned on when they try to open the door. Order of pressing does not matter.
Thanks
THX1138
|
|
|
|
Jun1-06, 12:17 PM
|
#4
|
mattmns is
Offline:
Posts: 1,115
|
If order does not matter, then I believe the number of combinations will be: (9 choose 3) = 84
|
|
|
|
Jun1-06, 12:33 PM
|
#5
|
thx1138 is
Offline:
Posts: 6
|
Thats it?
I thought it would be more than 84...?
Now I am depressed because I need it to be more than 84 combinations
Thanks for your help...
THX1138
|
|
|
|
Jun1-06, 03:25 PM
|
#6
|
Tide is
Offline:
Posts: 3,132
Recognitions:
Homework Helper
Science Advisor
|
If you push it up to 4 buttons the number becomes 126, FWIW.
|
|
|
|
Jun1-06, 03:32 PM
|
#7
|
thx1138 is
Offline:
Posts: 6
|
Both 84 and 126 seem low to me. However I am not a math person. Can someone explain or show how these numbers are calculated....?
My thought process is:
At first you have nine choices, then eight, then seven....
so 9 X 8 X 7 = 504....?
Please set me straight.
THX1138
|
|
|
|
Jun1-06, 03:59 PM
|
#8
|
Hurkyl is
Offline:
Posts: 13,008
|
My thought process is:
At first you have nine choices, then eight, then seven....
so 9 X 8 X 7 = 504....?
Please set me straight.
|
The trick to counting is to figure out just what you counted.
You've counted the number of ways to choose a sequence of three (different) numbers.
Is that the same as a combination 1? No! 123 and 321 are different sequences of three numbers, but they denote the same combination, right?
So you've counted the number of ways to punch in three digits. (504)
How many different ways is there to punch in each individual combination?
Once you know that, you can divide to find the number of combinations! (Because the answer to that second question is the same for any combination)
|
|
|
|
Jun1-06, 04:31 PM
|
#9
|
thx1138 is
Offline:
Posts: 6
|
Correct... 123 would be the same as 321.
The order does not matter, just having them actually pushed.
So I guess I am still confused...
How many ways are there to punch in given combination?
I am not sure:
123, 213, 321, 231, 132, 312, others...?hmmm....
Then divide by 504?
THX1138
|
|
|
|
Jun1-06, 08:53 PM
|
Last edited by mattmns; Jun1-06 at 08:58 PM..
#10
|
mattmns is
Offline:
Posts: 1,115
|
504/6 = 84
Note how "Choose" works (I am going to assume you are familiar with factorials!)
By definition (N Choose R) =
So (9 Choose 3) =
And if we cancel the 6, 5, 4, 3, 2, 1, from the bottom and top we are left with:
Note that on the bottom we have your 6 combination of pushed buttons (the exact 6 you posted), and on the top we have your 9x8x7 = 504
edit...
If you are not happy with 124, then you will have no choice but to make more possible buttons. For example, if you increase the number of buttons to 12, and still require 3 for the combination, then there will be (12 Choose 3) = 220 combination. Or if you increase the number from 3 to 4, you will have (12 choose 4) = 495 combinations, or you can increase even more, to say 5 required to open the lock, and get (12 choose 5) = 792. Whatever you decide to do, you will need more than 9 possible buttons to get more than 126 combinations.
|
|
|
|
Jun2-06, 08:59 AM
|
Last edited by thx1138; Jun2-06 at 09:02 AM..
#11
|
thx1138 is
Offline:
Posts: 6
|
Thank you "Mattmns" as well as others who helped here.
I now have an understanding of the logic with this idea.
Not sure what I am going to do yet, but I think I might settle for
10 choose 4 .
Another note, what happens if the participants do not know how many buttons are needed for the combination  ....?
Then that opens the door for every possible arrangement. Any Idea how I fiqure all possible combinations for 9 or 10 buttons?
Thanks again
THX1138
EDIT: BTW if you type "10 choose 4" in google it calculates automatically for you; most of you most likely already know that.
|
|
|
|
Jun2-06, 09:44 AM
|
#12
|
mattmns is
Offline:
Posts: 1,115
|
Making the number required to open the lock unknown would definitely increase the combinations, and difficulty. To figure out the number of combinations you would just need to add up the number of combinations for each number from 1-9 if there are 9 total, or 1-10 if there are 10 total. For example, if we wanted to find this out for 9 total buttons we would do the following:
(9 choose 1) + (9 choose 2) + (9 choose 3) + (9 choose 4) + (9 choose 5) + (9 choose 6) + (9 choose 7) + (9 choose 8) + (9 choose 9) = 511 total combinations.
|
|
|
|
Jun2-06, 10:07 AM
|
#13
|
rhj23 is
Offline:
Posts: 20
|
wouldn't it be easier to consider that in any set arrangement any individual button is either on or off, and each independently. so the total number of possibles is 2^9 = 512. it is clear that all of these are distinct
(i have one more than you because my method includes 'all off' as a possible arrangement, which it is not in this case)
|
|
|
|
Jun3-06, 11:21 PM
|
#14
|
mattmns is
Offline:
Posts: 1,115
|
Originally Posted by rhj23
wouldn't it be easier to consider that in any set arrangement any individual button is either on or off, and each independently. so the total number of possibles is 2^9 = 512. it is clear that all of these are distinct
(i have one more than you because my method includes 'all off' as a possible arrangement, which it is not in this case)
|
Yep that is much easier
|
|
|
|
Jun9-06, 05:20 AM
|
#15
|
Jeff Reid is
Offline:
Posts: 2,696
|
At first you have nine choices, then eight, then seven....
so 9 X 8 X 7 = 504
|
Here's an answer that doesn't require knowledge of the choose function:
In order to get 3 good buttons, on the first pick, you have 3 good buttons out of 9 total buttons that are good, then on the second pick you have 2 good buttons out of 8 that are good, and on the third pick you have 1 out of 7 buttons that are good.
3/9 x 2/8 x 1/7 = 6/504 = 1/84
Success happens when there are no bad picks:
There are 8 possible outcomes when pushing the buttons:
Code:
(all good, 0 bad) = 3/9 x 2/8 x 1/7 = 6/504 = 1/84
1st bad = 6/9 x 3/8 x 2/7 = 36/504 = 6/84
2nd bad = 3/9 x 6/8 x 2/7 = 36/504 = 6/84
3rd bad = 3/9 x 2/8 x 6/7 = 36/504 = 6/84
1st + 2nd bad = 6/9 x 5/8 x 3/7 = 90/504 = 15/84
1st + 3rd bad = 6/9 x 3/8 x 5/7 = 90/504 = 15/84
2nd + 3rd bad = 3/9 x 6/8 x 5/7 = 90/504 = 15/84
1st + 2nd + 3rd bad = 6/9 x 5/8 x 4/7 = 120/504 = 20/84
-------------------------------------------------------
sum of all cases = 504/504 = 84/84
|
|
|
|
Jun9-06, 05:39 AM
|
#16
|
Jeff Reid is
Offline:
Posts: 2,696
|
I've seen some 5 button locks on doors, but these allow 1 or 2 buttons to be pushed at a time, and three patterns are used to unlock the door. I haven't seen a case where the same button is pressed twice in a row, but it appears the mechanism allows this.
If double buttons were used for all three patteerns, then you'd have (5 choose 2)^3 or 1/1000 chance of guessing the pattern.
If only single buttons were used, then it would be 1/125 chance.
The fact that it could be either on any of the 3 tries makes it even more unlikely to guess the combination.
|
|
|
|
|
 |
 |
|
 |
|