Every day when Frank goes to work, he needs to enter a keycode with six different digits to get into the building. The front door has one keypad style and the back door has a different keypad style. One day, Frank realized that each digit in his keycode was horizontally, vertically or diagonally adjacent to the next digit on both keypads.
If the first digit of Frank's keycode is larger than the last, can you determine his keycode?
Front Back
+---+---+---+ +---+---+---+---+---+
| 1 | 2 | 3 | | 1 | 2 | 3 | 4 | 5 |
+---+---+---+ +---+---+---+---+---+
| 4 | 5 | 6 | | 6 | 7 | 8 | 9 | 0 |
+---+---+---+ +---+---+---+---+---+
| 7 | 8 | 9 |
+---+---+---+
| 0 |
+---+
Example: 2,6 is a possible part of the keycode but 3,6 and 1,6 are not since those are adjacent on only one keypad.
Looking at the keypads the only possible pairing of digits to satisfy both are:
0-9
1-2
2-3
2-6
4-5
4-8
5-9
7-8
8-9
the digits 1, 3 and 6 only appear once so therefore can only appear either at the end or the beginning of the code. However all these three digits only pair with 2, and 2 pairs with no other so it isn't possibly to use these in a 6-digit code (can only produce a 3 digit code). This leaves the pairs of:
0-9
4-5
4-8
5-9
7-8
8-9
The 6 different digits are therefore 0, 4, 5, 7, 8 and 9.
0 only appears once so must be at the beginning or end. The first digit is larger than the last digit so 0 must be at the end and so 9 must be the 2nd to last digit.
A-B-C-D-9-0
There is only one 7 so this must be the first digit and 8 must therefore be the 2nd digit.
7-8-C-D-9-0
8 can be paired with 7, 9 and 4.
7 and 9 have already been used in the code so the 3rd digit is 4 and therefore the 4th digit is 5.
7-8-4-5-9-0
Nice puzzle Brian!
|
Posted by Lisa
on 2007-09-11 05:51:42 |