Who is asking: Student
Level of the question: Secondary
Question: I have a 4-digit Combination Lock but i have forgotten the code. i do know that it is an even number, all the digits are different, the second digit is zero and the largest digit is 6. what are all the possibilities.
You can work this out in steps:
- You know the second digit, so let's ignore that. Now there are just three digits to work out.
- The largest digit is a six, so that means each remaining digit is 0,1,2,3,4,5,6 - seven possibilities.
- The code is even. That means the last digit is a 0, 2, 4 or 6.
- All the digits are different. That means the zero is ruled out (it is the second digit) and that the other digits have progressively one less digit possibility each.
So that means the last digit is a 2, 4 or 6.
The first and third digits (as a set) are some non-repeating combination of two of (1,2,3,4,5,6) MINUS the digit used in the last position. That means there are 3 possibilities for the last digit and 5x4 possibilities for the other two spots.
By multiplying them together, we get 3 x 5 x 4 = 60 possible combinations.
If you need to list all of them, then you can
- Choose a number from the set (2,4,6) to use for the last digit.
- Remove this digit from the set (1,2,3,4,5,6) and choose a number from the remaining five numbers for the first digit.
- Remove the two digits you chose from (1,2,3,4,5,6) and choose a number from the remaining four numbers for the third digit.
If you do this for all unique permutations, you will have all the possible codes.
Stephen La Rocque>