There is a numeric lock which has a 3-digit PIN. The PIN contains digits 1 to 7. There is no repetition of digits. The digits in the PIN from left to right are in decreasing order. Any two digits in the PIN differ by at least 2. How many maximum attempts does one need to find out the PIN with certainty?
Correct Answer :
10
Solution :
The correct option is 10.
Let the 3-digit PIN be represented by three digits from left to right as , , and .
According to the problem, the digits must satisfy the following conditions:
1. The digits are selected from the set {1, 2, 3, 4, 5, 6, 7}.
2. There is no repetition of digits.
3. The digits are in decreasing order from left to right, which means:
4. Any two digits in the PIN differ by at least 2. Since the digits are in decreasing order, this means:
and
To find the maximum number of attempts needed to find the PIN with certainty, we need to find the total number of possible PINs that satisfy all the above conditions. We can list the possible combinations systematically by choosing the first digit from the highest possible value (7) downwards:
• If :
Since , the possible values for are 5, 4, and 3 (since must allow with a difference of at least 2).
- If , then can be 3, 2, or 1. (3 possibilities: 7-5-3, 7-5-2, 7-5-1)
- If , then can be 2 or 1. (2 possibilities: 7-4-2, 7-4-1)
- If , then can only be 1. (1 possibility: 7-3-1)
Total for is combinations.
• If :
The possible values for are 4 and 3.
- If , then can be 2 or 1. (2 possibilities: 6-4-2, 6-4-1)
- If , then can only be 1. (1 possibility: 6-3-1)
Total for is combinations.
• If :
The only possible value for is 3.
- If , then can only be 1. (1 possibility: 5-3-1)
Total for is 1 combination.
For any value of , it is impossible to choose and such that the difference between each adjacent digit is at least 2 (for example, if , the maximum possible is 2, which leaves no valid option for since , but the PIN only contains digits from 1 to 7).
Adding all the valid combinations together:
Since there are 10 possible unique PINs that satisfy the given conditions, one would need a maximum of 10 attempts to find out the PIN with absolute certainty.
Access expert-curated educational resources and study materials—completely free.
Create, conduct, and manage professional online assessments with Mindyard. Perfect for teachers and institutes.
Copyright © 2026 Mindyard. All Rights Reserved.