Got a credit card? use our Credit Card & Finance Calculators
Thanks to GrahamPlatt,gpadsa,Steffers0,lansdown,Wasron, for Donating to support the site
Calling all mathematicians
Forum rules
Direct questions and answers, this room is not for general discussion please
Direct questions and answers, this room is not for general discussion please
-
- Lemon Quarter
- Posts: 4113
- Joined: November 4th, 2016, 9:24 am
- Has thanked: 3266 times
- Been thanked: 2857 times
Calling all mathematicians
My aged brain can't handle this.....
I'm getting a key safe fitted tomorrow. It has keys 0-9, plus A and B. It requires codes between 4 and 8 digits, digits cannot be used more than once, and the sequence does not matter, so a code of 123A can be typed in as 1A32, A321, etc.
Since a safebreaker does not know how many digits are used, is a 4-digit code any less secure than an 8-digit code? Obviously a 4-digit code is easier to remember and less hassle to type in than an 8-digit code.
--kiloran
I'm getting a key safe fitted tomorrow. It has keys 0-9, plus A and B. It requires codes between 4 and 8 digits, digits cannot be used more than once, and the sequence does not matter, so a code of 123A can be typed in as 1A32, A321, etc.
Since a safebreaker does not know how many digits are used, is a 4-digit code any less secure than an 8-digit code? Obviously a 4-digit code is easier to remember and less hassle to type in than an 8-digit code.
--kiloran
-
- Lemon Slice
- Posts: 780
- Joined: November 4th, 2016, 7:18 am
- Has thanked: 212 times
- Been thanked: 491 times
Re: Calling all mathematicians
There is some maths here. You have 12 buttons and this link assumes only 10.
If you can use any order there are surprisingly few combinations (only around 200 different 4 digit combinations using 10 buttons)edit:1000 if you read the comments. 5 seemed the optimum with 5 buttons, so maybe 6 for yours?
https://bugadvisor.com/2013/08/09/key-l ... nk-update/
If you can use any order there are surprisingly few combinations (only around 200 different 4 digit combinations using 10 buttons)edit:1000 if you read the comments. 5 seemed the optimum with 5 buttons, so maybe 6 for yours?
https://bugadvisor.com/2013/08/09/key-l ... nk-update/
-
- Lemon Slice
- Posts: 713
- Joined: November 19th, 2016, 1:35 pm
- Has thanked: 43 times
- Been thanked: 433 times
Re: Calling all mathematicians
This should help
https://www.mathsisfun.com/combinatorics/combinations-permutations-calculator.html
As Midsmartin suggests, 6 is the optimum number of characters with 924 combinations. 5 & 7 have 592 each, and 4 & 8 have 495 each.
https://www.mathsisfun.com/combinatorics/combinations-permutations-calculator.html
As Midsmartin suggests, 6 is the optimum number of characters with 924 combinations. 5 & 7 have 592 each, and 4 & 8 have 495 each.
-
- Lemon Quarter
- Posts: 4113
- Joined: November 4th, 2016, 9:24 am
- Has thanked: 3266 times
- Been thanked: 2857 times
Re: Calling all mathematicians
Midsmartin wrote:There is some maths here. You have 12 buttons and this link assumes only 10.
If you can use any order there are surprisingly few combinations (only around 200 different 4 digit combinations using 10 buttons)edit:1000 if you read the comments. 5 seemed the optimum with 5 buttons, so maybe 6 for yours?
https://bugadvisor.com/2013/08/09/key-l ... nk-update/
Perfect! Many thanks, I'll go for 6
--kiloran
-
- Lemon Quarter
- Posts: 2013
- Joined: November 4th, 2016, 10:25 am
- Has thanked: 226 times
- Been thanked: 481 times
Re: Calling all mathematicians
mike wrote:This should help
https://www.mathsisfun.com/combinatorics/combinations-permutations-calculator.html
As Midsmartin suggests, 6 is the optimum number of characters with 924 combinations. 5 & 7 have 592 each, and 4 & 8 have 495 each.
By experimentation with that calculator, I see that the optimum number of characters to choose is half the number of characters available. (If the total number is odd, the optimum number will be half rounded up or down)
I'll leave it for someone better at maths than me to explain why
-
- Lemon Half
- Posts: 6101
- Joined: November 21st, 2016, 4:26 pm
- Has thanked: 443 times
- Been thanked: 2344 times
Re: Calling all mathematicians
chas49 wrote:mike wrote:This should help
https://www.mathsisfun.com/combinatorics/combinations-permutations-calculator.html
As Midsmartin suggests, 6 is the optimum number of characters with 924 combinations. 5 & 7 have 592 each, and 4 & 8 have 495 each.
By experimentation with that calculator, I see that the optimum number of characters to choose is half the number of characters available. (If the total number is odd, the optimum number will be half rounded up or down)
I'll leave it for someone better at maths than me to explain why
Consider it symmetrically with the puzzle the same for the number of choices made, as left out.
So if there are 8 characters available, choosing 2 (and omitting 6) is the same as choosing 6 (and omitting 2). With an odd number the optimal is the "middle" (so with 9, 5 is optimal), with an even it is a tie (so with 8, 4 and 5 are optimal).
-
- Lemon Quarter
- Posts: 2013
- Joined: November 4th, 2016, 10:25 am
- Has thanked: 226 times
- Been thanked: 481 times
Re: Calling all mathematicians
dealtn wrote:chas49 wrote:mike wrote:This should help
https://www.mathsisfun.com/combinatorics/combinations-permutations-calculator.html
As Midsmartin suggests, 6 is the optimum number of characters with 924 combinations. 5 & 7 have 592 each, and 4 & 8 have 495 each.
By experimentation with that calculator, I see that the optimum number of characters to choose is half the number of characters available. (If the total number is odd, the optimum number will be half rounded up or down)
I'll leave it for someone better at maths than me to explain why
Consider it symmetrically with the puzzle the same for the number of choices made, as left out.
So if there are 8 characters available, choosing 2 (and omitting 6) is the same as choosing 6 (and omitting 2). With an odd number the optimal is the "middle" (so with 9, 5 is optimal), with an even it is a tie (so with 8, 4 and 5 are optimal).
But that calculator shows for a 9 character set, order irrelevant, no repetitions - the optimal value is 4 or 5 (they both give 126 combinations). For 8 characters, it's 5 (56 combinations). Is the calculator wrong? Or have I misunderstood your post?
-
- Lemon Half
- Posts: 6101
- Joined: November 21st, 2016, 4:26 pm
- Has thanked: 443 times
- Been thanked: 2344 times
Re: Calling all mathematicians
chas49 wrote:dealtn wrote:chas49 wrote:
By experimentation with that calculator, I see that the optimum number of characters to choose is half the number of characters available. (If the total number is odd, the optimum number will be half rounded up or down)
I'll leave it for someone better at maths than me to explain why
Consider it symmetrically with the puzzle the same for the number of choices made, as left out.
So if there are 8 characters available, choosing 2 (and omitting 6) is the same as choosing 6 (and omitting 2). With an odd number the optimal is the "middle" (so with 9, 5 is optimal), with an even it is a tie (so with 8, 4 and 5 are optimal).
But that calculator shows for a 9 character set, order irrelevant, no repetitions - the optimal value is 4 or 5 (they both give 126 combinations). For 8 characters, it's 5 (56 combinations). Is the calculator wrong? Or have I misunderstood your post?
No it's my explanation!
So consider 10 character selection for instance (as we work in base 10 and have 10 fingers it's intuitively easiest!).
How many unique solutions are there if you have to choose 10? Only one "all of them", which is the same number as "none of them".
How many unique solutions are there if you have to choose 1? Intuitively we should be able to see there are 10 (the number of possible fingers!). Hopefully, intuitively, you can see that is the same number of solutions to the question of choosing 9. The question of choosing 9 can be rephrased as "leaving out 1".
So 0 and 10 will pair, 1 and 9 will pair, 2 and 8 will pair, etc. with progressively higher numbers of solutions, until you get to 5 which doesn't pair, being optimal.
I got the "odd" and "even" explanation wrong in my explanation as you need to include "zero" in the range, so odd numbers have an even number of potential characters, and vice versa. It wasn't clear in my explanation I was using zero!
-
- Lemon Quarter
- Posts: 2577
- Joined: November 4th, 2016, 3:36 pm
- Has thanked: 1112 times
- Been thanked: 1171 times
Re: Calling all mathematicians
This is not a simple matter of calculating how many combinations there are for different numbers of digits/letters (I will refer to "digits" from now on for brevity).
With a 12 button safe, if a safe cracker were to use brute force, four digits is not the same as eight digits even though 12C4 and 12C8 are both 495. It would take, on average, about 248 attempts to guess the correct combination in each case but try this: get a safe and try 248 different 4-digit combinations, then, with the same safe, try out 248 different 8-digit combinations. The latter will require more button presses and will take longer.
It is more to do with psychology, however. If the safe cracker relies upon brute force, I would guess that smaller numbers of digits would be attempted first (before giving up). Keeping a tally of which 8-digit combinations have been tried is likely to appear more daunting as well as taking longer. If someone just tries their luck with a few random presses, they might try more buttons, say, six. To a non-mathematically minded safe cracker, it may (incorrectly) seem obvious that there are insurmountably more 8-digit combinations than 4-digit ones so the former may not be attempted.
For these reasons, it may be preferable to err on the side of more digits rather than fewer.
Julian F. G. W.
With a 12 button safe, if a safe cracker were to use brute force, four digits is not the same as eight digits even though 12C4 and 12C8 are both 495. It would take, on average, about 248 attempts to guess the correct combination in each case but try this: get a safe and try 248 different 4-digit combinations, then, with the same safe, try out 248 different 8-digit combinations. The latter will require more button presses and will take longer.
It is more to do with psychology, however. If the safe cracker relies upon brute force, I would guess that smaller numbers of digits would be attempted first (before giving up). Keeping a tally of which 8-digit combinations have been tried is likely to appear more daunting as well as taking longer. If someone just tries their luck with a few random presses, they might try more buttons, say, six. To a non-mathematically minded safe cracker, it may (incorrectly) seem obvious that there are insurmountably more 8-digit combinations than 4-digit ones so the former may not be attempted.
For these reasons, it may be preferable to err on the side of more digits rather than fewer.
Julian F. G. W.
-
- Lemon Half
- Posts: 7814
- Joined: January 22nd, 2017, 2:29 pm
- Has thanked: 665 times
- Been thanked: 1289 times
Re: Calling all mathematicians
kiloran wrote:Obviously a 4-digit code is easier to remember and less hassle to type in than an 8-digit code.
An 8 digit code only requires that you remember which 4 keys not to press.
-
- Lemon Slice
- Posts: 281
- Joined: April 11th, 2017, 5:27 pm
- Has thanked: 50 times
- Been thanked: 83 times
Re: Calling all mathematicians
Nothing to do with your basic question but worth remembering if I am right!
Your mention of keys and no repeats suggests to me that perhaps as you press the keys they stay down.
If that is the case there will also be a RESET button.
Do make sure you tell users of the keysafe that they MUST press the RESET button when finished using the device otherwise anybody can take in the relevant keys at a glance, for them to try at their leisure.
For example for a four-key permutation, your are reducing the possibilities from millions for ten keys to just 24.
Regards,
ep
Your mention of keys and no repeats suggests to me that perhaps as you press the keys they stay down.
If that is the case there will also be a RESET button.
Do make sure you tell users of the keysafe that they MUST press the RESET button when finished using the device otherwise anybody can take in the relevant keys at a glance, for them to try at their leisure.
For example for a four-key permutation, your are reducing the possibilities from millions for ten keys to just 24.
Regards,
ep
-
- Lemon Quarter
- Posts: 2577
- Joined: November 4th, 2016, 3:36 pm
- Has thanked: 1112 times
- Been thanked: 1171 times
Re: Calling all mathematicians
IME, these push-button locks usually reset themselves when they are opened. The C (clear) key (if there is one) is only really needed if a wrong button is pressed.
The buttons are usually (not always) spring-loaded so they always return, although it would be possible to feel if they had been pressed and not reset.
These are true combination locks, i.e., the order in which the buttons are pressed makes no difference. 1234 does the same as 4321, and they both do the same as 12324322114312.
If a safe cracker marks every key with a UV pen, then comes back at a later date and examines the keys with a UV lamp, it is possible to see which buttons have been pressed.
Julian F. G. W.
The buttons are usually (not always) spring-loaded so they always return, although it would be possible to feel if they had been pressed and not reset.
These are true combination locks, i.e., the order in which the buttons are pressed makes no difference. 1234 does the same as 4321, and they both do the same as 12324322114312.
If a safe cracker marks every key with a UV pen, then comes back at a later date and examines the keys with a UV lamp, it is possible to see which buttons have been pressed.
Julian F. G. W.
Who is online
Users browsing this forum: No registered users and 2 guests